[PATCH 2/3]: x86-64: Handle SRAT v1 and v2 consistently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

x86-64 was rather inconsistent prior to this patch; it used 8 bits 
for the pxm field in cpu_affinity, but 32 bits in mem_affinity.
This patch makes it consistent: Either use 8 bits consistently (SRAT
rev 1 or lower) or 32 bits (SRAT rev 2 or higher).

This is patch 2/3.
-- 
Kurt Garloff <kurt@xxxxxxxxxx>  [Koeln/Greven]

From: Kurt Garloff <kurt@xxxxxxxxxx>
Subject: Use SRAT table rev to use 8bit or 32bit PXM fields (x86/x86-64)
References: bnc#503038

In SRAT v1, we had 8bit proximity domain (PXM) fields; SRAT v2 provides
32bits for these. The new fields were reserved before.
According to the ACPI spec, the OS must disregrard reserved fields.

x86/x86-64 was rather inconsistent prior to this patch; it used 8 bits 
for the pxm field in cpu_affinity, but 32 bits in mem_affinity.
This patch makes it consistent: Either use 8 bits consistently (SRAT
rev 1 or lower) or 32 bits (SRAT rev 2 or higher).

This is patch 2/3.

Signed-off-by: Kurt Garloff <kurt@xxxxxxxxxx>

---
 arch/x86/mm/srat.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6.git/arch/x86/mm/srat.c
===================================================================
--- linux-2.6.git.orig/arch/x86/mm/srat.c
+++ linux-2.6.git/arch/x86/mm/srat.c
@@ -108,8 +108,10 @@ acpi_numa_processor_affinity_init(struct
 	}
 	if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
 		return;
 	pxm = pa->proximity_domain_lo;
+	if (acpi_srat_revision >= 2)
+		pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8;
 	node = setup_node(pxm);
 	if (node < 0) {
 		printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
 		bad_srat();
@@ -159,8 +161,10 @@ acpi_numa_memory_affinity_init(struct ac
 		return;
 	start = ma->base_address;
 	end = start + ma->length;
 	pxm = ma->proximity_domain;
+	if (acpi_srat_revision <= 1)
+		pxm &= 0xff;
 	node = setup_node(pxm);
 	if (node < 0) {
 		printk(KERN_ERR "SRAT: Too many proximity domains.\n");
 		bad_srat();

Attachment: pgpJGQTkpPMIv.pgp
Description: PGP signature


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux