Bug#994172: grub2 cutmem not working propertly

Alexey Kuznetsov kuznetsov.alexey at gmail.com
Mon Sep 13 09:14:36 BST 2021


Package: grub2
Version: 2.04-20
Severity: normal

Dear Maintainer,

Hello!

My old notebook has memory issues and requires to cut last 20M memory
region to work propertly (no matter how much installed 1G or 2G I had to
cut last 20M)

>From kernel perspective it looks like this:

[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007f73ffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000007f740000-0x000000007f74ffff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000007f750000-0x000000007f7fffff] ACPI NVS
[ 0.000000] e820: remove [mem 0x7e400000-0xfffffffffffffffe] usable
[ 0.000000] Notice: NX (Execute Disable) protection missing in CPU!
[ 0.000000] user-defined physical RAM map:
[ 0.000000] user: [mem 0x0000000000000000-0x000000000009fbff] usable
[ 0.000000] user: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[ 0.000000] user: [mem 0x00000000000e0000-0x00000000000fffff] reserved
[ 0.000000] user: [mem 0x0000000000100000-0x000000007e3fffff] usable
[ 0.000000] user: [mem 0x000000007f740000-0x000000007f74ffff] ACPI data
[ 0.000000] user: [mem 0x000000007f750000-0x000000007f7fffff] ACPI NVS

If this region is not removed my notebook works SUPER slow and every
click takes few seconds to process. Same affects grub2. If region in use
grub2 takes 2 minutes to boot into kernel. I recorded youtube video:

https://youtu.be/BlTii6QL5oY

I know grub2 has a 'cutmem' command which is not working propertly. When
I issue a:

'cutmem 0x7e40000 0x7f73ffff'

grub2 reports no change in 'lsmmap' output, which is not correct! I
tested 'cutmem' on my second notebook with efi loader, and cutmem
affects 'lsmmap' output with 'BADRAM regions' printed out.

fast logs:

https://linux-hardware.org/?probe=59b41381ed

slow logs:

https://linux-hardware.org/?probe=28a5b48a05

'grub-legacy' works fine, no slow downs!

I report it on grub2 bug tracker with no response:

https://savannah.gnu.org/bugs/index.php?61148


-- Package-specific info:

*********************** BEGIN /proc/mounts
/dev/sda1 / ext4 rw,relatime,errors=remount-ro 0 0
/dev/loop0 /snap/core/11609 squashfs ro,nodev,relatime 0 0
/dev/loop4 /snap/librepcb/516 squashfs ro,nodev,relatime 0 0
/dev/loop2 /snap/core18/2123 squashfs ro,nodev,relatime 0 0
/dev/loop1 /snap/core/11422 squashfs ro,nodev,relatime 0 0
/dev/loop3 /snap/core18/2069 squashfs ro,nodev,relatime 0 0
/dev/loop6 /snap/openscad/112 squashfs ro,nodev,relatime 0 0
/dev/loop5 /snap/librepcb/272 squashfs ro,nodev,relatime 0 0
/dev/loop7 /snap/openscad/133 squashfs ro,nodev,relatime 0 0
/dev/loop8 /snap/snapd/12881 squashfs ro,nodev,relatime 0 0
/dev/loop9 /snap/snapd/12706 squashfs ro,nodev,relatime 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0) /dev/disk/by-id/ata-FUJITSU_MHV2120AH_NT59T7C2S0BV
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="4"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
insmod png
if background_image
/usr/share/desktop-base/homeworld-theme/grub/grub-4x3.png; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class
gnu --class os $menuentry_id_option
'gnulinux-simple-8a9a2822-70c7-45c0-a01b-379c952d190d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
echo 'Loading Linux 5.10.0-8-686 ...'
linux /boot/vmlinuz-5.10.0-8-686
root=UUID=8a9a2822-70c7-45c0-a01b-379c952d190d ro mem=2020M echo
'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-8-686
}
submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option
'gnulinux-advanced-8a9a2822-70c7-45c0-a01b-379c952d190d' {
menuentry 'Debian GNU/Linux, with Linux 5.10.0-8-686' --class debian
--class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-5.10.0-8-686-advanced-8a9a2822-70c7-45c0-a01b-379c952d190d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
echo 'Loading Linux 5.10.0-8-686 ...'
linux /boot/vmlinuz-5.10.0-8-686
root=UUID=8a9a2822-70c7-45c0-a01b-379c952d190d ro mem=2020M echo
'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-8-686
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-8-686 (recovery mode)'
--class debian --class gnu-linux --class gnu --class os
$menuentry_id_option
'gnulinux-5.10.0-8-686-recovery-8a9a2822-70c7-45c0-a01b-379c952d190d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
echo 'Loading Linux 5.10.0-8-686 ...'
linux /boot/vmlinuz-5.10.0-8-686
root=UUID=8a9a2822-70c7-45c0-a01b-379c952d190d ro single mem=2020M
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-8-686
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-7-686' --class debian
--class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-5.10.0-7-686-advanced-8a9a2822-70c7-45c0-a01b-379c952d190d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
echo 'Loading Linux 5.10.0-7-686 ...'
linux /boot/vmlinuz-5.10.0-7-686
root=UUID=8a9a2822-70c7-45c0-a01b-379c952d190d ro mem=2020M echo
'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-7-686
}
menuentry 'Debian GNU/Linux, with Linux 5.10.0-7-686 (recovery mode)'
--class debian --class gnu-linux --class gnu --class os
$menuentry_id_option
'gnulinux-5.10.0-7-686-recovery-8a9a2822-70c7-45c0-a01b-379c952d190d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
echo 'Loading Linux 5.10.0-7-686 ...'
linux /boot/vmlinuz-5.10.0-7-686
root=UUID=8a9a2822-70c7-45c0-a01b-379c952d190d ro single mem=2020M
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.10.0-7-686
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-17-686' --class debian
--class gnu-linux --class gnu --class os $menuentry_id_option
'gnulinux-4.19.0-17-686-advanced-8a9a2822-70c7-45c0-a01b-379c952d190d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
echo 'Loading Linux 4.19.0-17-686 ...'
linux /boot/vmlinuz-4.19.0-17-686
root=UUID=8a9a2822-70c7-45c0-a01b-379c952d190d ro mem=2020M echo
'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-17-686
}
menuentry 'Debian GNU/Linux, with Linux 4.19.0-17-686 (recovery mode)'
--class debian --class gnu-linux --class gnu --class os
$menuentry_id_option
'gnulinux-4.19.0-17-686-recovery-8a9a2822-70c7-45c0-a01b-379c952d190d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'
8a9a2822-70c7-45c0-a01b-379c952d190d
else
search --no-floppy --fs-uuid --set=root 8a9a2822-70c7-45c0-a01b-379c952d190d
fi
echo 'Loading Linux 4.19.0-17-686 ...'
linux /boot/vmlinuz-4.19.0-17-686
root=UUID=8a9a2822-70c7-45c0-a01b-379c952d190d ro single mem=2020M
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.19.0-17-686
}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
*********************** END /boot/grub/grub.cfg

*********************** BEGIN /proc/mdstat
cat: /proc/mdstat: No such file or directory
*********************** END /proc/mdstat

*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root 9 Sep 12 17:24 ata-FUJITSU_MHV2120AH_NT59T7C2S0BV
-> ../../sda
lrwxrwxrwx 1 root root 10 Sep 12 17:25
ata-FUJITSU_MHV2120AH_NT59T7C2S0BV-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Sep 12 17:24 ata-QSI_CD-RW_DVD-ROM_SBW-242 ->
../../sr0
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Sep 12 17:25
8a9a2822-70c7-45c0-a01b-379c952d190d -> ../../sda1
*********************** END /dev/disk/by-uuid

-- System Information:
Debian Release: 11.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.19.0-17-686 (SMP w/1 CPU thread)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE
not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages grub2 depends on:
ii grub-common 2.04-20
ii grub-pc 2.04-20

grub2 recommends no packages.

grub2 suggests no packages.

-- no debconf information



More information about the Pkg-grub-devel mailing list