All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3>
@ 2007-07-29 22:52 Akio Takebe
  2007-07-29 22:56 ` Akio Takebe
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Akio Takebe @ 2007-07-29 22:52 UTC (permalink / raw)
  To: xen-devel, xen-ia64-devel; +Cc: Keir Fraser, Alex Williamson

Hi, Keir, Alex and all

I updated my patches again.

Summary:
    On some ia64 NUMA machine, we cannot boot dom0.
    This issue is caused by different infomation LSAPIC and SRAT.
    Xen-ia64 modify LSAPIC IDs of dom0, but it does not modify SRAT.

    Currently, credit scheduler does not consider NUMA system.
    And Xen-ia64 pass raw ACPI SRAT, SLIT infomation to dom0.
    If xen pass NUMA infomation to dom0, dom0 cannot move properly
    because vcpus can migrate and memory mapping is virtualized.
    So we decide disabling SRAT, SLIT of dom0 as first step of NUMA work.

[Patch 1/3] Move generate_acpi_checksum() from ia64 code to common.
[Patch 2/3] Only add acpi_table_disable() into xen/drivers/acpi/tables.c
[Patch 3/3] Disable ACPI SRAT,SLIT on dom0

The previous discussions are;
http://lists.xensource.com/archives/html/xen-ia64-devel/2007-07/msg00146.html
http://lists.xensource.com/archives/html/xen-ia64-devel/2007-07/msg00220.html

Changelog:
- Move generate_acpi_checksum() from ia64 code to common
- Add dom_fw_acpi.c in libxc/ia64.
- Move add acpi_table_disable() from ia64 code to common

Best Regards,

Akio Takebe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3>
  2007-07-29 22:52 [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3> Akio Takebe
@ 2007-07-29 22:56 ` Akio Takebe
  2007-07-30 15:31   ` [Xen-ia64-devel] " Alex Williamson
  2007-07-29 22:58 ` [Xen-devel] " Akio Takebe
  2007-07-29 23:00 ` Akio Takebe
  2 siblings, 1 reply; 5+ messages in thread
From: Akio Takebe @ 2007-07-29 22:56 UTC (permalink / raw)
  To: Akio Takebe, xen-devel, xen-ia64-devel; +Cc: Keir Fraser, Alex Williamson

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 156 bytes --]

Hi,

This patch move generate_acpi_checksum() from ia64 code to common.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

Best Regards,

Akio Takebe

[-- Attachment #2: move_generate_acpi_checksum.v3.patch --]
[-- Type: application/octet-stream, Size: 3701 bytes --]

# HG changeset patch
# User root@localhost.localdomain
# Date 1185747444 -32400
# Node ID 7e81d7ec1bb9d5cb32332011d2c3eb27d70c635b
# Parent  4492a0285bae734ee18f6acbb6b3f9c80f153be7
Move generate_acpi_checksum() from ia64 code to common.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

diff -r 4492a0285bae -r 7e81d7ec1bb9 tools/libxc/ia64/Makefile
--- a/tools/libxc/ia64/Makefile	Fri Jul 27 08:15:16 2007 -0600
+++ b/tools/libxc/ia64/Makefile	Mon Jul 30 07:17:24 2007 +0900
@@ -5,7 +5,7 @@ GUEST_SRCS-y += ia64/xc_ia64_linux_resto
 GUEST_SRCS-y += ia64/xc_ia64_linux_restore.c
 
 GUEST_SRCS-y += ia64/xc_dom_ia64_util.c
-DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S
+DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S dom_fw_acpi.c
 DOMFW_SRCS := $(addprefix ia64/, $(DOMFW_SRCS_BASE))
 $(DOMFW_SRCS):
 	ln -sf ../$(XEN_ROOT)/xen/arch/ia64/xen/$(@F) $@
diff -r 4492a0285bae -r 7e81d7ec1bb9 tools/libxc/ia64/dom_fw_acpi.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/ia64/dom_fw_acpi.c	Mon Jul 30 07:17:24 2007 +0900
@@ -0,0 +1,14 @@
+#include <inttypes.h>
+#include <xen/acpi.h>
+
+uint8_t
+generate_acpi_checksum(void *tbl, unsigned long len)
+{
+	uint8_t *ptr, sum = 0;
+
+	for (ptr = tbl; len > 0 ; len--, ptr++)
+		sum += *ptr;
+
+	return 0 - sum;
+}
+
diff -r 4492a0285bae -r 7e81d7ec1bb9 xen/arch/ia64/xen/dom_fw_common.c
--- a/xen/arch/ia64/xen/dom_fw_common.c	Fri Jul 27 08:15:16 2007 -0600
+++ b/xen/arch/ia64/xen/dom_fw_common.c	Mon Jul 30 07:17:24 2007 +0900
@@ -207,17 +207,6 @@ print_md(efi_memory_desc_t *md)
 		printk("(%luKB)\n", size >> 10);
 }
 
-uint8_t
-generate_acpi_checksum(void *tbl, unsigned long len)
-{
-	uint8_t *ptr, sum = 0;
-
-	for (ptr = tbl; len > 0 ; len--, ptr++)
-		sum += *ptr;
-
-	return 0 - sum;
-}
-
 struct fake_acpi_tables {
 	struct acpi20_table_rsdp rsdp;
 	struct xsdt_descriptor_rev2 xsdt;
diff -r 4492a0285bae -r 7e81d7ec1bb9 xen/drivers/acpi/tables.c
--- a/xen/drivers/acpi/tables.c	Fri Jul 27 08:15:16 2007 -0600
+++ b/xen/drivers/acpi/tables.c	Mon Jul 30 07:17:24 2007 +0900
@@ -227,6 +227,17 @@ void acpi_table_print_madt_entry(acpi_ta
 	}
 }
 
+uint8_t
+generate_acpi_checksum(void *tbl, unsigned long len)
+{
+	uint8_t *ptr, sum = 0;
+
+	for (ptr = tbl; len > 0 ; len--, ptr++)
+		sum += *ptr;
+
+	return 0 - sum;
+}
+
 static int
 acpi_table_compute_checksum(void *table_pointer, unsigned long length)
 {
diff -r 4492a0285bae -r 7e81d7ec1bb9 xen/include/asm-ia64/dom_fw_common.h
--- a/xen/include/asm-ia64/dom_fw_common.h	Fri Jul 27 08:15:16 2007 -0600
+++ b/xen/include/asm-ia64/dom_fw_common.h	Mon Jul 30 07:17:24 2007 +0900
@@ -85,7 +85,6 @@ xen_ia64_efi_make_md(efi_memory_desc_t *
 xen_ia64_efi_make_md(efi_memory_desc_t *md,
                      uint32_t type, uint64_t attr, 
                      uint64_t start, uint64_t end);
-uint8_t generate_acpi_checksum(void *tbl, unsigned long len);
 struct fake_acpi_tables;
 void dom_fw_fake_acpi(domain_t *d, struct fake_acpi_tables *tables);
 int efi_mdt_cmp(const void *a, const void *b); 
diff -r 4492a0285bae -r 7e81d7ec1bb9 xen/include/xen/acpi.h
--- a/xen/include/xen/acpi.h	Fri Jul 27 08:15:16 2007 -0600
+++ b/xen/include/xen/acpi.h	Mon Jul 30 07:17:24 2007 +0900
@@ -390,6 +390,7 @@ void acpi_table_print (struct acpi_table
 void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
 void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
 void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
+uint8_t generate_acpi_checksum(void *tbl, unsigned long len);
 
 /* the following four functions are architecture-dependent */
 void acpi_numa_slit_init (struct acpi_table_slit *slit);

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3>
  2007-07-29 22:52 [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3> Akio Takebe
  2007-07-29 22:56 ` Akio Takebe
@ 2007-07-29 22:58 ` Akio Takebe
  2007-07-29 23:00 ` Akio Takebe
  2 siblings, 0 replies; 5+ messages in thread
From: Akio Takebe @ 2007-07-29 22:58 UTC (permalink / raw)
  To: Akio Takebe, xen-devel, xen-ia64-devel; +Cc: Keir Fraser, Alex Williamson

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 215 bytes --]

Hi,

Add acpi_table_disable() into xen/drivers/acpi/tables.c
This function can disable a ACPI table by updating the table header.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

Best Regards,

Akio Takebe

[-- Attachment #2: add_acpi_table_disable.v3.patch --]
[-- Type: application/octet-stream, Size: 13319 bytes --]

# HG changeset patch
# User root@localhost.localdomain
# Date 1185747642 -32400
# Node ID e9def100a760f032c78c635f4d792a8432db1a97
# Parent  7e81d7ec1bb9d5cb32332011d2c3eb27d70c635b
Add acpi_table_disable() into xen/drivers/acpi/tables.c
This function can disable a ACPI table by updating the table header.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

diff -r 7e81d7ec1bb9 -r e9def100a760 xen/drivers/acpi/tables.c
--- a/xen/drivers/acpi/tables.c	Mon Jul 30 07:17:24 2007 +0900
+++ b/xen/drivers/acpi/tables.c	Mon Jul 30 07:20:42 2007 +0900
@@ -73,6 +73,7 @@ struct acpi_table_sdt {
 
 static unsigned long sdt_pa;	/* Physical Address */
 static unsigned long sdt_count;	/* Table count */
+static struct acpi_table_rsdp *rsdp;
 unsigned char acpi_rsdp_rev;
 
 static struct acpi_table_sdt sdt_entry[ACPI_MAX_TABLES] __initdata;
@@ -389,34 +390,11 @@ acpi_table_parse_madt(enum acpi_madt_ent
 					    handler, max_entries);
 }
 
-int __init acpi_table_parse(enum acpi_table_id id, acpi_table_handler handler)
-{
-	int count = 0;
-	unsigned int i = 0;
-
-	if (!handler)
-		return -EINVAL;
-
-	for (i = 0; i < sdt_count; i++) {
-		if (sdt_entry[i].id != id)
-			continue;
-		count++;
-		if (count == 1)
-			handler(sdt_entry[i].pa, sdt_entry[i].size);
-
-		else
-			printk(KERN_WARNING PREFIX
-			       "%d duplicate %s table ignored.\n", count,
-			       acpi_table_signatures[id]);
-	}
-
-	return count;
-}
-
-static int __init acpi_table_get_sdt(struct acpi_table_rsdp *rsdp)
+
+static int __init
+__acpi_table_disable(struct acpi_table_rsdp *rsdp, int table_id, char *table_name)
 {
 	struct acpi_table_header *header = NULL;
-	unsigned int i, id = 0;
 
 	if (!rsdp)
 		return -EINVAL;
@@ -460,17 +438,15 @@ static int __init acpi_table_get_sdt(str
 			return -ENODEV;
 		}
 
-		sdt_count =
-		    (header->length - sizeof(struct acpi_table_header)) >> 3;
-		if (sdt_count > ACPI_MAX_TABLES) {
-			printk(KERN_WARNING PREFIX
-			       "Truncated %lu XSDT entries\n",
-			       (sdt_count - ACPI_MAX_TABLES));
-			sdt_count = ACPI_MAX_TABLES;
-		}
-
-		for (i = 0; i < sdt_count; i++)
-			sdt_entry[i].pa = (unsigned long)mapped_xsdt->entry[i];
+		if (table_id < sdt_count){
+			header = (struct acpi_table_header *)
+			   __acpi_map_table(mapped_xsdt->entry[table_id], sizeof(struct acpi_table_header));
+		} else {
+			printk(KERN_WARNING PREFIX
+			       "Unable to disable entry %d\n",
+			       table_id);
+			return -ENODEV;
+		}
 	}
 
 	/* Then check RSDT */
@@ -509,18 +485,15 @@ static int __init acpi_table_get_sdt(str
 			printk(KERN_WARNING PREFIX "Invalid RSDT checksum\n");
 			return -ENODEV;
 		}
-
-		sdt_count =
-		    (header->length - sizeof(struct acpi_table_header)) >> 2;
-		if (sdt_count > ACPI_MAX_TABLES) {
-			printk(KERN_WARNING PREFIX
-			       "Truncated %lu RSDT entries\n",
-			       (sdt_count - ACPI_MAX_TABLES));
-			sdt_count = ACPI_MAX_TABLES;
-		}
-
-		for (i = 0; i < sdt_count; i++)
-			sdt_entry[i].pa = (unsigned long)mapped_rsdt->entry[i];
+		if (table_id < sdt_count){
+			header = (struct acpi_table_header *)
+			   __acpi_map_table(mapped_rsdt->entry[table_id], sizeof(struct acpi_table_header));
+		} else {
+			printk(KERN_WARNING PREFIX
+			       "Unable to disable entry %d\n",
+			       table_id);
+			return -ENODEV;
+		}
 	}
 
 	else {
@@ -529,88 +502,26 @@ static int __init acpi_table_get_sdt(str
 		return -ENODEV;
 	}
 
-	acpi_table_print(header, sdt_pa);
-
-	for (i = 0; i < sdt_count; i++) {
-
-		/* map in just the header */
-		header = (struct acpi_table_header *)
-		    __acpi_map_table(sdt_entry[i].pa,
-				     sizeof(struct acpi_table_header));
-		if (!header)
-			continue;
-
-		/* remap in the entire table before processing */
-		header = (struct acpi_table_header *)
-		    __acpi_map_table(sdt_entry[i].pa, header->length);
-		if (!header)
-			continue;
-
-		acpi_table_print(header, sdt_entry[i].pa);
-
-		if (acpi_table_compute_checksum(header, header->length)) {
-			printk(KERN_WARNING "  >>> ERROR: Invalid checksum\n");
-			continue;
-		}
-
-		sdt_entry[i].size = header->length;
-
-		for (id = 0; id < ACPI_TABLE_COUNT; id++) {
-			if (!strncmp((char *)&header->signature,
-				     acpi_table_signatures[id],
-				     sizeof(header->signature))) {
-				sdt_entry[i].id = id;
-			}
-		}
-	}
-
-	/* 
-	 * The DSDT is *not* in the RSDT (why not? no idea.) but we want
-	 * to print its info, because this is what people usually blacklist
-	 * against. Unfortunately, we don't know the phys_addr, so just
-	 * print 0. Maybe no one will notice.
-	 */
-	if (!acpi_get_table_header_early(ACPI_DSDT, &header))
-		acpi_table_print(header, 0);
+	memcpy(header->signature, "OEMx", 4);
+	memcpy(header->oem_id, "xxxxxx", 6);
+	memcpy(header->oem_id+1, table_name, 4);
+	memcpy(header->oem_table_id, "Xen     ", 8);
+	header->checksum = 0;
+	header->checksum = generate_acpi_checksum(header, header->length);
 
 	return 0;
 }
 
-/*
- * acpi_table_init()
- *
- * find RSDP, find and checksum SDT/XSDT.
- * checksum all tables, print SDT/XSDT
- * 
- * result: sdt_entry[] is initialized
- */
-
-int __init acpi_table_init(void)
-{
-	struct acpi_table_rsdp *rsdp = NULL;
-	unsigned long rsdp_phys = 0;
+int __init
+acpi_table_disable(enum acpi_table_id table_id)
+{
 	int result = 0;
-
-	/* Locate and map the Root System Description Table (RSDP) */
-
-	rsdp_phys = acpi_find_rsdp();
-	if (!rsdp_phys) {
-		printk(KERN_ERR PREFIX "Unable to locate RSDP\n");
-		return -ENODEV;
-	}
-
-	rsdp = (struct acpi_table_rsdp *)__acpi_map_table(rsdp_phys,
-		sizeof(struct acpi_table_rsdp));
+	int i, id = 0;
+
 	if (!rsdp) {
-		printk(KERN_WARNING PREFIX "Unable to map RSDP\n");
-		return -ENODEV;
-	}
-
-	printk(KERN_DEBUG PREFIX
-	       "RSDP (v%3.3d %6.6s                                ) @ 0x%p\n",
-	       rsdp->revision, rsdp->oem_id, (void *)rsdp_phys);
-
-	acpi_rsdp_rev = rsdp->revision;
+		printk(KERN_WARNING PREFIX "%s: Unable to map RSDP\n", __func__);
+		return -ENODEV;
+	}
 
 	if (rsdp->revision < 2)
 		result =
@@ -623,6 +534,262 @@ int __init acpi_table_init(void)
 						 rsdp)->length);
 
 	if (result) {
+		printk(KERN_WARNING "%s: ERROR: Invalid RSDP checksum\n", __func__);
+		return -ENODEV;
+	}
+
+
+	/* search entry id of table_id */
+	for (i = 0; i < sdt_count; i++) {
+		if (sdt_entry[i].id == table_id)
+			id = i;		
+	}
+
+	if (!id){
+		printk(KERN_WARNING PREFIX 
+		       "%s: Unable to find the table(%s)\n",
+		       __func__, acpi_table_signatures[table_id]);
+		return -ENOENT;
+	}
+
+	return __acpi_table_disable(rsdp, id, acpi_table_signatures[table_id]);
+}
+
+ 
+int __init acpi_table_parse(enum acpi_table_id id, acpi_table_handler handler)
+{
+	int count = 0;
+	unsigned int i = 0;
+
+	if (!handler)
+		return -EINVAL;
+
+	for (i = 0; i < sdt_count; i++) {
+		if (sdt_entry[i].id != id)
+			continue;
+		count++;
+		if (count == 1)
+			handler(sdt_entry[i].pa, sdt_entry[i].size);
+
+		else
+			printk(KERN_WARNING PREFIX
+			       "%d duplicate %s table ignored.\n", count,
+			       acpi_table_signatures[id]);
+	}
+
+	return count;
+}
+
+static int __init acpi_table_get_sdt(struct acpi_table_rsdp *rsdp)
+{
+	struct acpi_table_header *header = NULL;
+	unsigned int i, id = 0;
+
+	if (!rsdp)
+		return -EINVAL;
+
+	/* First check XSDT (but only on ACPI 2.0-compatible systems) */
+
+	if ((rsdp->revision >= 2) &&
+	    (((struct acpi20_table_rsdp *)rsdp)->xsdt_address)) {
+
+		struct acpi_table_xsdt *mapped_xsdt = NULL;
+
+		sdt_pa = ((struct acpi20_table_rsdp *)rsdp)->xsdt_address;
+
+		/* map in just the header */
+		header = (struct acpi_table_header *)
+		    __acpi_map_table(sdt_pa, sizeof(struct acpi_table_header));
+
+		if (!header) {
+			printk(KERN_WARNING PREFIX
+			       "Unable to map XSDT header\n");
+			return -ENODEV;
+		}
+
+		/* remap in the entire table before processing */
+		mapped_xsdt = (struct acpi_table_xsdt *)
+		    __acpi_map_table(sdt_pa, header->length);
+		if (!mapped_xsdt) {
+			printk(KERN_WARNING PREFIX "Unable to map XSDT\n");
+			return -ENODEV;
+		}
+		header = &mapped_xsdt->header;
+
+		if (strncmp(header->signature, "XSDT", 4)) {
+			printk(KERN_WARNING PREFIX
+			       "XSDT signature incorrect\n");
+			return -ENODEV;
+		}
+
+		if (acpi_table_compute_checksum(header, header->length)) {
+			printk(KERN_WARNING PREFIX "Invalid XSDT checksum\n");
+			return -ENODEV;
+		}
+
+		sdt_count =
+		    (header->length - sizeof(struct acpi_table_header)) >> 3;
+		if (sdt_count > ACPI_MAX_TABLES) {
+			printk(KERN_WARNING PREFIX
+			       "Truncated %lu XSDT entries\n",
+			       (sdt_count - ACPI_MAX_TABLES));
+			sdt_count = ACPI_MAX_TABLES;
+		}
+
+		for (i = 0; i < sdt_count; i++)
+			sdt_entry[i].pa = (unsigned long)mapped_xsdt->entry[i];
+	}
+
+	/* Then check RSDT */
+
+	else if (rsdp->rsdt_address) {
+
+		struct acpi_table_rsdt *mapped_rsdt = NULL;
+
+		sdt_pa = rsdp->rsdt_address;
+
+		/* map in just the header */
+		header = (struct acpi_table_header *)
+		    __acpi_map_table(sdt_pa, sizeof(struct acpi_table_header));
+		if (!header) {
+			printk(KERN_WARNING PREFIX
+			       "Unable to map RSDT header\n");
+			return -ENODEV;
+		}
+
+		/* remap in the entire table before processing */
+		mapped_rsdt = (struct acpi_table_rsdt *)
+		    __acpi_map_table(sdt_pa, header->length);
+		if (!mapped_rsdt) {
+			printk(KERN_WARNING PREFIX "Unable to map RSDT\n");
+			return -ENODEV;
+		}
+		header = &mapped_rsdt->header;
+
+		if (strncmp(header->signature, "RSDT", 4)) {
+			printk(KERN_WARNING PREFIX
+			       "RSDT signature incorrect\n");
+			return -ENODEV;
+		}
+
+		if (acpi_table_compute_checksum(header, header->length)) {
+			printk(KERN_WARNING PREFIX "Invalid RSDT checksum\n");
+			return -ENODEV;
+		}
+
+		sdt_count =
+		    (header->length - sizeof(struct acpi_table_header)) >> 2;
+		if (sdt_count > ACPI_MAX_TABLES) {
+			printk(KERN_WARNING PREFIX
+			       "Truncated %lu RSDT entries\n",
+			       (sdt_count - ACPI_MAX_TABLES));
+			sdt_count = ACPI_MAX_TABLES;
+		}
+
+		for (i = 0; i < sdt_count; i++)
+			sdt_entry[i].pa = (unsigned long)mapped_rsdt->entry[i];
+	}
+
+	else {
+		printk(KERN_WARNING PREFIX
+		       "No System Description Table (RSDT/XSDT) specified in RSDP\n");
+		return -ENODEV;
+	}
+
+	acpi_table_print(header, sdt_pa);
+
+	for (i = 0; i < sdt_count; i++) {
+
+		/* map in just the header */
+		header = (struct acpi_table_header *)
+		    __acpi_map_table(sdt_entry[i].pa,
+				     sizeof(struct acpi_table_header));
+		if (!header)
+			continue;
+
+		/* remap in the entire table before processing */
+		header = (struct acpi_table_header *)
+		    __acpi_map_table(sdt_entry[i].pa, header->length);
+		if (!header)
+			continue;
+
+		acpi_table_print(header, sdt_entry[i].pa);
+
+		if (acpi_table_compute_checksum(header, header->length)) {
+			printk(KERN_WARNING "  >>> ERROR: Invalid checksum\n");
+			continue;
+		}
+
+		sdt_entry[i].size = header->length;
+
+		for (id = 0; id < ACPI_TABLE_COUNT; id++) {
+			if (!strncmp((char *)&header->signature,
+				     acpi_table_signatures[id],
+				     sizeof(header->signature))) {
+				sdt_entry[i].id = id;
+			}
+		}
+	}
+
+	/* 
+	 * The DSDT is *not* in the RSDT (why not? no idea.) but we want
+	 * to print its info, because this is what people usually blacklist
+	 * against. Unfortunately, we don't know the phys_addr, so just
+	 * print 0. Maybe no one will notice.
+	 */
+	if (!acpi_get_table_header_early(ACPI_DSDT, &header))
+		acpi_table_print(header, 0);
+
+	return 0;
+}
+
+/*
+ * acpi_table_init()
+ *
+ * find RSDP, find and checksum SDT/XSDT.
+ * checksum all tables, print SDT/XSDT
+ * 
+ * result: sdt_entry[] is initialized
+ */
+
+int __init acpi_table_init(void)
+{
+	unsigned long rsdp_phys = 0;
+	int result = 0;
+	rsdp = NULL;
+
+	/* Locate and map the Root System Description Table (RSDP) */
+
+	rsdp_phys = acpi_find_rsdp();
+	if (!rsdp_phys) {
+		printk(KERN_ERR PREFIX "Unable to locate RSDP\n");
+		return -ENODEV;
+	}
+
+	rsdp = (struct acpi_table_rsdp *)__acpi_map_table(rsdp_phys,
+		sizeof(struct acpi_table_rsdp));
+	if (!rsdp) {
+		printk(KERN_WARNING PREFIX "Unable to map RSDP\n");
+		return -ENODEV;
+	}
+
+	printk(KERN_DEBUG PREFIX
+	       "RSDP (v%3.3d %6.6s                                ) @ 0x%p\n",
+	       rsdp->revision, rsdp->oem_id, (void *)rsdp_phys);
+
+	acpi_rsdp_rev = rsdp->revision;
+
+	if (rsdp->revision < 2)
+		result =
+		    acpi_table_compute_checksum(rsdp,
+						sizeof(struct acpi_table_rsdp));
+	else
+		result =
+		    acpi_table_compute_checksum(rsdp,
+						((struct acpi20_table_rsdp *)
+						 rsdp)->length);
+
+	if (result) {
 		printk(KERN_WARNING "  >>> ERROR: Invalid checksum\n");
 		return -ENODEV;
 	}
diff -r 7e81d7ec1bb9 -r e9def100a760 xen/include/xen/acpi.h
--- a/xen/include/xen/acpi.h	Mon Jul 30 07:17:24 2007 +0900
+++ b/xen/include/xen/acpi.h	Mon Jul 30 07:20:42 2007 +0900
@@ -383,6 +383,7 @@ int acpi_numa_init (void);
 int acpi_numa_init (void);
 
 int acpi_table_init (void);
+int acpi_table_disable(enum acpi_table_id table_id);
 int acpi_table_parse (enum acpi_table_id id, acpi_table_handler handler);
 int acpi_get_table_header_early (enum acpi_table_id id, struct acpi_table_header **header);
 int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3>
  2007-07-29 22:52 [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3> Akio Takebe
  2007-07-29 22:56 ` Akio Takebe
  2007-07-29 22:58 ` [Xen-devel] " Akio Takebe
@ 2007-07-29 23:00 ` Akio Takebe
  2 siblings, 0 replies; 5+ messages in thread
From: Akio Takebe @ 2007-07-29 23:00 UTC (permalink / raw)
  To: Akio Takebe, xen-devel, xen-ia64-devel; +Cc: Alex Williamson

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 367 bytes --]

Hi,

This patch is for ia64.

  On some ia64 NUMA machine, we cannot boot dom0.
  This issue is caused by different infomation LSAPIC and SRAT.
  Xen-ia64 modify LSAPIC IDs of dom0, but it does not modify SRAT.
  So we decide disabling SRAT, SLIT of dom0 as first step of NUMA work.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

Best Regards,

Akio Takebe

[-- Attachment #2: dom0_disable_srat_slit.v3.patch --]
[-- Type: application/octet-stream, Size: 1639 bytes --]

# HG changeset patch
# User root@localhost.localdomain
# Date 1185747688 -32400
# Node ID 78c2fc4d6a836e11d4e947e29583b066cf2a9ee2
# Parent  e9def100a760f032c78c635f4d792a8432db1a97
Disable ACPI SRAT,SLIT table of dom0.

  On some ia64 NUMA machine, we cannot boot dom0.
  This issue is caused by different infomation LSAPIC and SRAT.
  Xen-ia64 modify LSAPIC IDs of dom0, but it does not modify SRAT.
  So we decide disabling SRAT, SLIT of dom0 as first step of NUMA work.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>

diff -r e9def100a760 -r 78c2fc4d6a83 xen/arch/ia64/xen/dom_fw_dom0.c
--- a/xen/arch/ia64/xen/dom_fw_dom0.c	Mon Jul 30 07:20:42 2007 +0900
+++ b/xen/arch/ia64/xen/dom_fw_dom0.c	Mon Jul 30 07:21:28 2007 +0900
@@ -103,6 +103,7 @@ acpi_update_madt_checksum(unsigned long 
 /* base is physical address of acpi table */
 static void __init touch_acpi_table(void)
 {
+	int result;
 	lsapic_nbr = 0;
 
 	if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_update_lsapic, 0) < 0)
@@ -110,6 +111,18 @@ static void __init touch_acpi_table(void
 	if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC,
 				  acpi_patch_plat_int_src, 0) < 0)
 		printk("Error parsing MADT - no PLAT_INT_SRC entries\n");
+
+	result = acpi_table_disable(ACPI_SRAT);
+	if ( result == 0 )
+		printk("Success Disabling SRAT\n");
+	else if ( result != -ENOENT )
+		printk("ERROR: Failed Disabling SRAT\n");
+
+	result = acpi_table_disable(ACPI_SLIT);
+	if ( result == 0 )
+		printk("Success Disabling SLIT\n");
+	else if ( result != -ENOENT )
+		printk("ERROR: Failed Disabling SLIT\n");
 
 	acpi_table_parse(ACPI_APIC, acpi_update_madt_checksum);
 

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-ia64-devel] [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3>
  2007-07-29 22:56 ` Akio Takebe
@ 2007-07-30 15:31   ` Alex Williamson
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Williamson @ 2007-07-30 15:31 UTC (permalink / raw)
  To: Akio Takebe; +Cc: xen-devel, xen-ia64-devel

On Mon, 2007-07-30 at 07:56 +0900, Akio Takebe wrote:
> 
> diff -r 4492a0285bae -r 7e81d7ec1bb9 tools/libxc/ia64/Makefile
> --- a/tools/libxc/ia64/Makefile Fri Jul 27 08:15:16 2007 -0600
> +++ b/tools/libxc/ia64/Makefile Mon Jul 30 07:17:24 2007 +0900
> @@ -5,7 +5,7 @@ GUEST_SRCS-y += ia64/xc_ia64_linux_resto
>  GUEST_SRCS-y += ia64/xc_ia64_linux_restore.c
>  
>  GUEST_SRCS-y += ia64/xc_dom_ia64_util.c
> -DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S
> +DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S
> dom_fw_acpi.c
>  DOMFW_SRCS := $(addprefix ia64/, $(DOMFW_SRCS_BASE))
>  $(DOMFW_SRCS):
>         ln -sf ../$(XEN_ROOT)/xen/arch/ia64/xen/$(@F) $@ 

   This doesn't build.  DOMFW_SRCS_BASE is used as the list of base file
names that get linked from the xen tree.  This file needs to be built
from the local copy.  Adding the the GUEST_SRCS-y list is the way to
make that happen.  Keir, please apply the patch below to fix the ia64
build in staging.  Thanks,

	Alex

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

diff -r 9cd309378326 tools/libxc/ia64/Makefile
--- a/tools/libxc/ia64/Makefile	Mon Jul 30 11:28:16 2007 +0100
+++ b/tools/libxc/ia64/Makefile	Mon Jul 30 09:07:14 2007 -0600
@@ -5,7 +5,9 @@ GUEST_SRCS-y += ia64/xc_ia64_linux_resto
 GUEST_SRCS-y += ia64/xc_ia64_linux_restore.c
 
 GUEST_SRCS-y += ia64/xc_dom_ia64_util.c
-DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S dom_fw_acpi.c
+GUEST_SRCS-y += ia64/dom_fw_acpi.c
+
+DOMFW_SRCS_BASE := dom_fw_common.c dom_fw_domu.c dom_fw_asm.S
 DOMFW_SRCS := $(addprefix ia64/, $(DOMFW_SRCS_BASE))
 $(DOMFW_SRCS):
 	ln -sf ../$(XEN_ROOT)/xen/arch/ia64/xen/$(@F) $@

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-30 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-29 22:52 [Patch 0/3] Disable ACPI SRAT, SLIT on dom0 <take 3> Akio Takebe
2007-07-29 22:56 ` Akio Takebe
2007-07-30 15:31   ` [Xen-ia64-devel] " Alex Williamson
2007-07-29 22:58 ` [Xen-devel] " Akio Takebe
2007-07-29 23:00 ` Akio Takebe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.