[PATCH v3 1/5] mm/memory-failure: efi: add the LINUX_EFI_POISONED_MEMORY configuration table

Breno Leitao leitao at debian.org
Mon Sep 7 07:27:31 PDT 2026


On Fri, Aug 28, 2026 at 02:47:39PM +0100, Kiryl Shutsemau wrote:
> On Wed, Aug 26, 2026 at 05:03:52AM -0700, Breno Leitao wrote:
> > @@ -1271,6 +1274,16 @@ struct linux_efi_memreserve {
> >  #define EFI_MEMRESERVE_COUNT(size) (((size) - sizeof(struct linux_efi_memreserve)) \
> >  	/ sizeof_field(struct linux_efi_memreserve, entry[0]))
> >  
> > +/* Bit N covers unit N of physical address space, counting from address 0. */
> > +struct linux_efi_poisoned_memory {
> > +	u32		version;
> > +	u32		unit_size;	/* bytes of phys space per bitmap bit */
> > +	u64		size;		/* bitmap size in bytes */
> > +	unsigned long	bitmap[];
> > +};
> 
> struct efi_unaccepted_memory has 'phys_base'. Do we want it here too?
> 
> It can be helpful if physical memory starts very high for some reason.
> I believe it is common for risc-v.
> 
> Tenstorrent Blackhole card has 4G of RAM based at 0x400030000000.
> Counting from address 0 that is a 4M bitmap for 4G of RAM. :-/

Sure, although this won't be used much right now, it will prepare the
structure for future expansion. It also shouldn't add much complexity to
the process.

I will get the structure like this now

  /* Bit N covers the unit at @phys_base + N * @unit_size. */
  struct linux_efi_poisoned_memory {
        u32             version;
        u32             unit_size;      /* bytes of phys space per bitmap bit */
        u64             phys_base;      /* address bit 0 covers */
        u64             size;           /* bitmap size in bytes */
        unsigned long   bitmap[];
  };

and then offset the entities in the bitmap by phys_base.

Thanks for the feedback,
--breno



More information about the kexec mailing list