[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 C

[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 Vladimir Serbinenko
Follow-up Comment #21, bug #64471 (project grub): [(Erreur - Introuvable)] [comment #20 commentaire #20 :] > 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

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

2023-07-27 Thread Vladimir Serbinenko
Follow-up Comment #19, bug #64471 (project grub): [(Erreur - Introuvable)] [comment #18 commentaire #18 :] > > [comment #17 comment #17:] > > > > [comment #16 commentaire #16 :] > > > > > > [comment #15 comment #15:] > > > > Where do you check the page table? > > > > > > I do not understand.

[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 Vladimir Serbinenko
Follow-up Comment #17, bug #64471 (project grub): [(Erreur - Introuvable)] [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 check that memory above

[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 che

[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 Vladimir Serbinenko
Follow-up Comment #15, bug #64471 (project grub): [(Erreur - Introuvable)] Where do you check the page table? ___ Reply to this item at: ___ Message pos

[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))}' 0x1-0x8

[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 ([0-9a-z]+)-([0-9a-z]+)/,aa){s=strtonum(aa[1]);e=strtonum(aa[2]);if(e-s>1.5*1024*1024

[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 f

[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, av

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

2023-07-26 Thread Vladimir Serbinenko
Follow-up Comment #7, bug #64471 (project grub): [(Erreur - Introuvable)] Can you post complete map from desktop as well? ___ 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 #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 Vladimir Serbinenko
Follow-up Comment #3, bug #64471 (project grub): [(Erreur - Introuvable)] It's not that simple. Some firmwares fail to map memory above 4GiB and attempt to use it will lead to a bad crash. We need to parse mapping table to be sure that those are safe to use. Can you attach your EFI memory map? Doe

[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: dme

[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
URL: Summary: grub efi memory allocation (efi/mm) does not work on every machine Group: GNU GRUB Submitter: axet Submitted: Tue 25 Jul 2023 06:04:05 PM UTC Category: Booting