[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-28 Thread Alexey Kuznetsov
Follow-up Comment #24, bug #64471 (project grub): One thing to ask? Did grub has any code related to reading / parsing paging tables? Looks like it dosn't. How to read physical memory? Is here grub_ method for that? Or should I switch to some protected mode back and forth using asm code?

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-28 Thread Alexey Kuznetsov
Follow-up Comment #23, bug #64471 (project grub): What I understand from Paging is that I had to request memory from efi using allocate_pages then check if pages table contains this virtual address, so it was mapped correctly by the efi. page table located at physical address pointed by part of

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #22, bug #64471 (project grub): Ok. I simplified the patch, now it does not change grub_efi_allocate_pages_real. Wild guess does it fix a) issue, since grub_efi_mm_add_regions only affecting grub_malloc? I'm going to bed, I'll check paging later.. (file #54987)

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #20, bug #64471 (project grub): Ok I understand now. a) I guess you didn't mention that allocating disk buffers from above 4GB can corrupt the data? Otherwise why not let it fail during to disk operation if it going to fail due to out of memory error? b) No idea what is paging

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #18, bug #64471 (project grub): [comment #17 comment #17:] > > [comment #16 commentaire #16 :] > > > > [comment #15 comment #15:] > > > Where do you check the page table? > > > > I do not understand. Can you view the smartmem.patch? > > Yes, I've seen it. And you need to

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #16, bug #64471 (project grub): [comment #15 comment #15:] > Where do you check the page table? I do not understand. Can you view the smartmem.patch? ___ Reply to this item at:

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #12, bug #64471 (project grub): When I said "no patches" I mean grub 2.06+argon2 patches+new grub2.12 memory patches. no bigmem (4GB+) patches. ___ Reply to this item at:

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #14, bug #64471 (project grub): Desktop e820 with 32GB output. dmesg | awk '/usable/ && /BIOS-e820/ && match($0, /mem ([0-9a-z]+)-([0-9a-z]+)/,aa){s=strtonum(aa[1]);e=strtonum(aa[2]);if(e-s>1*1024*1024*1024)printf("0x%x-0x%x %dGB\n",s,e,((e-s)/1024/1024/1024))}'

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #11, bug #64471 (project grub): Without any patches (<4GB usage range). On desktop Grub corrupt screen when trying to allocate a lot of memory. Looks like it touching the regions of memory it should not touch. Photo attached. (file #54985)

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #13, bug #64471 (project grub): I made it work by adding smart memory patch as I described below in comment 9. Here is a code. It working! https://gitlab.com/axet/homebin/-/blob/debian/dbuild.d/bookworm/grub2/smartmem.patch (file #54986)

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-27 Thread Alexey Kuznetsov
Follow-up Comment #10, bug #64471 (project grub): I had to install 4GB into my machine here is a dmesg for 4GB. Almost the same, only 1GB+ at 0x1 dmesg | awk '/usable/ && /BIOS-e820/ && match($0, /mem

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-26 Thread Alexey Kuznetsov
Follow-up Comment #9, bug #64471 (project grub): I guess we need smi-automatic GRUB_EFI_MAX_USABLE_ADDRESS variable. If we have enough memory from low memory segment (<4GB), then use it. If we have no memory and grub about to return out of memory error, instead crashing, why not to try allocate

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-26 Thread Alexey Kuznetsov
Follow-up Comment #8, bug #64471 (project grub): base_addr = 0x0, length = 0x92000, available RAM base_addr = 0x92000, length = 0xc000, available RAM base_addr = 0x9e000, length = 0x1000, reserved RAM base_addr = 0x9f000, length = 0x1000, available RAM base_addr = 0x10, length = 0x1a21,

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-26 Thread Alexey Kuznetsov
Follow-up Comment #6, bug #64471 (project grub): On desktop the only memory segment larger than 1GB is at 0x1 - 0x7c000 which is equivalent to 31G Desktop has no 1G+ blocks below 4GB (0x1) ___ Reply to this item at:

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-26 Thread Alexey Kuznetsov
Follow-up Comment #5, bug #64471 (project grub): I have secure boot disabled all the time. Since I compile grub manually for argon2id ___ Reply to this item at:

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-26 Thread Alexey Kuznetsov
Follow-up Comment #4, bug #64471 (project grub): You are right. Not every EFI works with GRUB_EFI_MAX_USABLE_ADDRESS 0xffULL. My laptop won't boot if I change it. Grub simply unable to open drive (ssd) and unlock the key. Not sure what is going on. Laptop: [0.00] BIOS-e820: [mem

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-26 Thread Alexey Kuznetsov
Follow-up Comment #2, bug #64471 (project grub): My laptop wont boot with GRUB_EFI_MAX_USABLE_ADDRESS 0xffULL (asus), but desktop works fine (gigabyte). Looks like we can detect how much memory we have. Running simple script can show how much memory we have below 4GB mark and above:

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-25 Thread Alexey Kuznetsov
Follow-up Comment #1, bug #64471 (project grub): GRUB_EFI_MAX_USABLE_ADDRESS 0xffULL make it work! Default for amd64 0x0x ___ Reply to this item at:

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-25 Thread Alexey Kuznetsov
Additional Item Attachment, bug #64471 (project grub): File name: lsmmap2.jpgSize:1732 KB File name: lsmmap3.jpgSize:1835 KB

[bug #64471] grub efi memory allocation (efi/mm) does not work on every machine

2023-07-25 Thread Alexey Kuznetsov
Tue 25 Jul 2023 06:04:05 PM UTC By: Alexey Kuznetsov Hello! I have installed grub 2.06 + argon2 and new memory management from grub 2.12 and new algorithm failed to allocate additional memory on some machines. Looks like it trying to allocate memory from heap, then try few more times using low a

[bug #61148] cutmem not wokring on old machines

2021-11-03 Thread Alexey Kuznetsov
Follow-up Comment #4, bug #61148 (project grub): GRUB_TERMINAL=console makes gurb2 works fast! ___ Reply to this item at: ___ Message sent via

[bug #61148] cutmem not wokring on old machines

2021-09-16 Thread Alexey Kuznetsov
Follow-up Comment #3, bug #61148 (project grub): My guess was limit memory map returned by e820 by size of 20M manually. So, I did patch grub source code with following: diff --git a/grub-core/kern/i386/pc/mmap.old b/grub-core/kern/i386/pc/mmap.c index c0c3c35..0eb76d9 100644 ---

[bug #61148] cutmem not wokring on old machines

2021-09-12 Thread Alexey Kuznetsov
Follow-up Comment #2, bug #61148 (project grub): I forget to mention 'grub-legacy' works fine, not slowdowns! ___ Reply to this item at: ___ Message

[bug #61148] cutmem not wokring on old machines

2021-09-12 Thread Alexey Kuznetsov
Follow-up Comment #1, bug #61148 (project grub): fast logs: https://linux-hardware.org/?probe=59b41381ed slow logs: https://linux-hardware.org/?probe=28a5b48a05 ___ Reply to this item at:

[bug #61148] cutmem not wokring on old machines

2021-09-12 Thread Alexey Kuznetsov
URL: Summary: cutmem not wokring on old machines Project: GNU GRUB Submitted by: axet Submitted on: Sun 12 Sep 2021 09:34:02 AM UTC Category: None Severity: Major