Re: [PATCH part4 2/4] x86, acpica, acpi: Try to find if SRAT isoverrided earlier.

From: Yinghai Lu
Date: Thu Aug 08 2013 - 12:29:17 EST


Trimmed CC list a bit.

On Thu, Aug 8, 2013 at 2:41 AM, Tang Chen <tangchen@xxxxxxxxxxxxxx> wrote:

> Linux cannot migrate pages used by the kernel due to the direct mapping
> (va = pa + PAGE_OFFSET), any memory used by the kernel cannot be hot-removed.
> So when using memory hotplug, we have to prevent the kernel from using
> hotpluggable memory.
>
> The ACPI table SRAT (System Resource Affinity Table) contains info to specify
> which memory is hotpluggble. After SRAT is parsed, we are aware of which
> memory is hotpluggable.
>
> At the early time when system is booting, SRAT has not been parsed. The boot
> memory allocator memblock will allocate any memory to the kernel. So we need
> SRAT parsed before memblock starts to work.
>
> In this patch, we are going to parse SRAT earlier, right after memblock is ready.
>
> Generally speaking, tables such as SRAT are provided by firmware. But
> ACPI_INITRD_TABLE_OVERRIDE functionality allows users to customize their own
> tables in initrd, and override the ones from firmware. So if we want to parse
> SRAT earlier, we also need to do SRAT override earlier.
>
> First, we introduce early_acpi_override_srat() to check if SRAT will be overridden
> from initrd.
>
> Second, we introduce find_hotpluggable_memory() to reserve hotpluggable memory,
> which will firstly call early_acpi_override_srat() to find out which memory is
> hotpluggable in the override SRAT.

acpi_override_srat handling is pretty ugly.

Please check if you can reuse first half of my patchset, so find and copy
override table earlier. the copied acpi tables could be near kernel code range.

Move finding in head64.c stage could help xen/dom0 a bit.
as Konrad is working on patchset with acpi override in xen hypervisor.
We can avoid override acpi table two times. Esp xen like to change
DMAR to XMAR.

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/