[Xen-ia64-devel] [Patch] fix serial console setting of PRIMEQUEST

2007-04-06 Thread Akio Takebe
Hi, Alex

I mistake the previous patch to use serial console.
I thought ns16550_com1.irq was irq number,
but this is gsi number.
So I fix it and use ns16550_com1_gsi to call iosapic_register_intr().

When I made the previous patch, I used sync_console option,
so I don't notice the issue.
We can use serial console without sync_console otpion on PRIMEQUEST.

Please apply this patch.

Signed-off-by: Akio Takebe [EMAIL PROTECTED]

Best Regards,

Akio Takebe

fix_pq_serial_cofig.patch
Description: Binary data
___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

[Xen-ia64-devel] [IA64] Weekly benchmark results [ww14]

2007-04-06 Thread KUWAMURA Shin'ya
Hi,

I report a benchmark result of this week on IPF using
xen-ia64-unstable.

In LTP, test cases related with direct IO still failed.
# dio02 dio03 dio06 dio08 dio09 dio12 dio14 dio15 dio17 dio18 dio19
# dio21 dio22 dio23 dio25 dio26 dio27 dio28

TEST ENVIRONMENT
Machine  : Tiger4
Kernel   : 2.6.18-xen
Changeset: 14708:f378c424e0ce
Dom0 OS  : RHEL4 U2 (2P)
DomU OS  : RHEL4 U2 (8P, using tap:aio)
DomVTi OS: RHEL4 U2 (8P, with PV-on-HVM drivers)
Scheduler: credit

TEST RESULT
  DomU:
unixbench4.1.0: Pass
bonnie++-1.03 : Pass
ltp-full-20061121 : 18/831 FAIL (see attachment)
iozone3_191   : Pass
lmbench-3.0-a5: Pass
  DomVTi:
unixbench4.1.0: Pass
bonnie++-1.03 : Pass
ltp-full-20061121 : Pass (except for LTP's bug)
iozone3_191   : Pass
lmbench-3.0-a5: Pass

Best regards,
KUWAMURA and Fujitsu members

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


Re: [Xen-ia64-devel] [IA64] Weekly benchmark results [ww14]

2007-04-06 Thread KUWAMURA Shin'ya
Hi,

On [EMAIL PROTECTED],
 KUWAMURA Shin'ya wrote:
 
 ltp-full-20061121 : 18/831 FAIL (see attachment)

Sorry, I forgot an attachment file.

Thanks,
-- 
  KUWAMURA Shin'ya
Thu Apr  5 16:48:09 JST 2007
Test Start Time: Thu Apr  5 16:48:09 2007
-
Testcase   Result Exit Value
   -- --
abort01PASS   0
accept01   PASS   0
access01   PASS   0
access02   PASS   0
access03   PASS   0
access04   PASS   0
access05   PASS   0
acct01 PASS   0
acct02 PASS   0
adjtimex01 PASS   0
adjtimex02 PASS   0
alarm01PASS   0
alarm02PASS   0
alarm03PASS   0
alarm04PASS   0
alarm05PASS   0
alarm06PASS   0
alarm07PASS   0
asyncio02  PASS   0
bind01 PASS   0
bind02 PASS   0
brk01  PASS   0
capget01   PASS   0
capget02   PASS   0
capset01   PASS   0
capset02   PASS   0
chdir01PASS   0
chdir01A   PASS   0
chdir02PASS   0
chdir03PASS   0
chdir04PASS   0
chmod01PASS   0
chmod01A   PASS   0
chmod02PASS   0
chmod03PASS   0
chmod04PASS   0
chmod05PASS   0
chmod06PASS   0
chmod07PASS   0
chown01PASS   0
chown02PASS   0
chown03PASS   0
chown04PASS   0
chown05PASS   0
chroot01   PASS   0
chroot02   PASS   0
chroot03   PASS   0
chroot04   PASS   0
clone01PASS   0
clone02PASS   0
clone03PASS   0
clone04PASS   0
clone05PASS   0
clone06PASS   0
clone07PASS   0
close01PASS   0
close02PASS   0
close08PASS   0
confstr01  PASS   0
connect01  PASS   0
creat01PASS   0
creat03PASS   0
creat04PASS   0
creat05PASS   0
creat06PASS   0
creat07PASS   0
creat08PASS   0
creat09PASS   0
dup01  PASS   0
dup02  PASS   0
dup03  PASS   0
dup04  PASS   0
dup05  PASS   0
dup06  PASS   0
dup07  PASS   0
dup201 PASS   0
dup202 PASS   0
dup203 PASS   0
dup204 PASS   0
dup205 PASS   0
execl01PASS   0
execle01   PASS   0
execlp01   PASS   0
execv01PASS   0
execve01   PASS   0
execve02   PASS   0
execve03   PASS   0
execve04   PASS   0
execve05   PASS   0
execve06   PASS   0
execvp01   PASS   0
exit01 PASS   0
exit02 PASS   0
faccessat01PASS   0
fchdir01   PASS   0
fchdir02   PASS   

[Xen-ia64-devel] [RFC][PATCH 0/10] memmap: embed memory map in domain pseudo physical address space

2007-04-06 Thread Isaku Yamahata
Hi all.

Xen/IA64 XEN_DOMCTL_arch_setup hypercall needs flexibility
to address the following issues.
- xm dump-core/save/restore.
  Such utilities need to know the area where memory is populated.
  Currently domU populates memory dense, but this wouldn't be
  true in future.
  Especially VTi domain builder populate memory sparsely so that
  xm dump-core/save/restore doesn't work for domVTi without the predefined 
  knowledge of memory layout.
- sparse populated domU for driver domain or other purpose(e.g. NUMA)
  The domain builder needs flexibility to populate memory sparsely.

I send out the experimental patch before and Tristan pointed out
that domain firmware builder should be in libxc.

Although This patch isn't finished yet (fpswa isn't supported yet.),
the patches become much larger than I expected.
So I want to hear ideas before completing it.


- creates memory map as efi runtime data in domain pseudo
  physical space,
- adds new member, memmap_info_num_pages, memmap_info_pfn, to
  struct arch_shared_info
- set memmap_info_pfn to point memory map
- modifies XEN_DOMCTL_arch_setup so that it create EFI memory descriptor
  following the specified memory map.
  It abuses xen_ia64_boot_param to pass memory map.
- move domain builder functionalities from xen to libxc.

thanks.

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


[Xen-ia64-devel] [RFC][PATCH 1/10] memmap: embed memory map in domain pseudo physical address space

2007-04-06 Thread Isaku Yamahata

 1 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175846287 -32400
# Node ID 67a4d792fad3ecfdca0ec5ac7134ad208f660b29
# Parent  5d9ab2d06709823714682be14a6b8719bffdcd18
introduce memmap_info_t
PATCHNAME: introduce_memmap_info_t

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 5d9ab2d06709 -r 67a4d792fad3 tools/libxc/xc_dom_ia64.c
--- a/tools/libxc/xc_dom_ia64.c	Thu Apr 05 09:30:26 2007 -0600
+++ b/tools/libxc/xc_dom_ia64.c	Fri Apr 06 16:58:07 2007 +0900
@@ -77,6 +77,8 @@ static int shared_info_ia64(struct xc_do
 for (i = 0; i  MAX_VIRT_CPUS; i++)
 shared_info-vcpu_info[i].evtchn_upcall_mask = 1;
 shared_info-arch.start_info_pfn = dom-start_info_pfn;
+shared_info-arch.memmap_info_num_pages = 1;
+shared_info-arch.memmap_info_pfn = dom-start_info_pfn - 1;
 return 0;
 }
 
@@ -129,6 +131,8 @@ static void __init register_arch_hooks(v
 xc_dom_register_arch_hooks(xc_dom_arch_ia64be);
 }
 
+#include xc_efi.h
+
 int arch_setup_meminit(struct xc_dom_image *dom)
 {
 xen_pfn_t pfn;
@@ -146,12 +150,69 @@ int arch_setup_meminit(struct xc_dom_ima
 return rc;
 }
 
+static int ia64_setup_memmap(struct xc_dom_image *dom)
+{
+unsigned int page_size = XC_DOM_PAGE_SIZE(dom);
+unsigned long memmap_info_pfn;
+xen_ia64_memmap_info_t* memmap_info;
+unsigned int num_mds;
+efi_memory_desc_t *md;
+
+char* start_info;
+struct xen_ia64_boot_param* bp;
+
+/* setup memmap page */
+memmap_info_pfn = dom-start_info_pfn - 1;
+xc_dom_printf(%s: memmap: mfn 0x% PRIpfn \n,
+		  __FUNCTION__, memmap_info_pfn);
+memmap_info = xc_map_foreign_range(dom-guest_xc, dom-guest_domid,
+   page_size,
+   PROT_READ | PROT_WRITE,
+   memmap_info_pfn);
+if (NULL == memmap_info)
+return -1;
+/* [0, total_pages) */
+memmap_info-efi_memdesc_size = sizeof(md[0]);
+memmap_info-efi_memdesc_version = EFI_MEMORY_DESCRIPTOR_VERSION;
+num_mds = 0;
+md = (efi_memory_desc_t*)memmap_info-memdesc;
+md[num_mds].type = EFI_CONVENTIONAL_MEMORY;
+md[num_mds].pad = 0;
+md[num_mds].phys_addr = 0;
+md[num_mds].virt_addr = 0;
+md[num_mds].num_pages = dom-total_pages  (PAGE_SHIFT - EFI_PAGE_SHIFT);
+md[num_mds].attribute = EFI_MEMORY_WB;
+num_mds++;
+memmap_info-efi_memmap_size = num_mds * sizeof(md[0]);
+munmap(memmap_info, page_size);
+
+/* kludge: we need to pass memmap_info page's pfn somehow.
+ * we use xen_ia64_boot_param::efi_memmap for this purpose */
+start_info = xc_map_foreign_range(dom-guest_xc, dom-guest_domid,
+  page_size,
+  PROT_READ | PROT_WRITE,
+  dom-start_info_pfn);
+if (NULL == start_info)
+return -1;
+bp = (struct xen_ia64_boot_param*)(start_info + sizeof(start_info_t));
+memset(bp, 0, sizeof(*bp));
+bp-efi_memmap = memmap_info_pfn;
+/* 4 = memmap info page, start info page, xenstore page and console page */
+bp-efi_memmap_size = 4 * PAGE_SIZE;
+munmap(start_info, page_size);
+return 0;
+}
+
 int arch_setup_bootearly(struct xc_dom_image *dom)
 {
 DECLARE_DOMCTL;
 int rc;
 
 xc_dom_printf(%s: setup firmware\n, __FUNCTION__);
+
+rc = ia64_setup_memmap(dom);
+if (rc)
+return rc;
 
 memset(domctl, 0, sizeof(domctl));
 domctl.cmd = XEN_DOMCTL_arch_setup;
@@ -160,8 +221,7 @@ int arch_setup_bootearly(struct xc_dom_i
 
 domctl.u.arch_setup.bp = (dom-start_info_pfn  PAGE_SHIFT)
 + sizeof(start_info_t);
-/* 3 = start info page, xenstore page and console page */
-domctl.u.arch_setup.maxmem = (dom-total_pages - 3)  PAGE_SHIFT;
+domctl.u.arch_setup.maxmem = dom-total_pages  PAGE_SHIFT;
 rc = do_domctl(dom-guest_xc, domctl);
 return rc;
 }
diff -r 5d9ab2d06709 -r 67a4d792fad3 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c	Thu Apr 05 09:30:26 2007 -0600
+++ b/xen/arch/ia64/xen/dom_fw.c	Fri Apr 06 16:58:07 2007 +0900
@@ -508,6 +508,63 @@ struct fw_tables {
 #define FW_FIELD_MPA(field) \
FW_TABLES_BASE_PADDR + offsetof(struct fw_tables, field)
 
+static void
+setup_dom0_memmap_info(struct domain *d, struct fw_tables *tables,
+		   int *num_mds)
+{
+	int i;
+	efi_memory_desc_t *md;
+	efi_memory_desc_t *last_mem_md = NULL;
+	xen_ia64_memmap_info_t* memmap_info;
+	unsigned long paddr_start;
+	unsigned long paddr_end;
+
+	for (i = *num_mds - 1; i = 0; i--) {
+		md = tables-efi_memmap[i];
+		if (md-attribute == EFI_MEMORY_WB 
+		md-type == EFI_CONVENTIONAL_MEMORY 
+		md-num_pages 
+		2 * (1UL  (PAGE_SHIFT - EFI_PAGE_SHIFT))) {
+			last_mem_md = md;
+			break;
+		}
+	}
+
+	if (last_mem_md == NULL) {
+		printk(%s: warning: 
+		   no dom0 contiguous memory to hold memory map\n,
+		   __func__);
+		return;
+	}
+	paddr_end = last_mem_md-phys_addr +
+		(last_mem_md-num_pages  EFI_PAGE_SHIFT);
+	paddr_start = (paddr_end - 

[Xen-ia64-devel] [RFC][PATCH 2/10] memmap: preliminary domain builder clean up

2007-04-06 Thread Isaku Yamahata

 2 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175853863 -32400
# Node ID c1e72414eb39b01e35ccb941bbe22ec60847acfe
# Parent  67a4d792fad3ecfdca0ec5ac7134ad208f660b29
preliminary domain-builder clean up.
PATCHNAME: domain_builder_clean_up

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 67a4d792fad3 -r c1e72414eb39 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Fri Apr 06 16:58:07 2007 +0900
+++ b/xen/arch/ia64/xen/dom0_ops.c	Fri Apr 06 19:04:23 2007 +0900
@@ -101,21 +101,22 @@ long arch_do_domctl(xen_domctl_t *op, XE
 if (!vmx_enabled) {
 printk(No VMX hardware feature for vmx domain.\n);
 ret = -EINVAL;
-break;
-}
-d-arch.is_vti = 1;
-vmx_setup_platform(d);
+} else {
+d-arch.is_vti = 1;
+vmx_setup_platform(d);
+}
 }
 else {
-dom_fw_setup(d, ds-bp, ds-maxmem);
-if (ds-xsi_va)
-d-arch.shared_info_va = ds-xsi_va;
 if (ds-hypercall_imm) {
+/* dom_fw_setup() reads d-arch.breakimm */
 struct vcpu *v;
 d-arch.breakimm = ds-hypercall_imm;
 for_each_vcpu (d, v)
 v-arch.breakimm = d-arch.breakimm;
 }
+if (ds-xsi_va)
+d-arch.shared_info_va = ds-xsi_va;
+ret = dom_fw_setup(d, ds-bp, ds-maxmem);
 {
 /*
  * XXX IA64_SHARED_INFO_PADDR
diff -r 67a4d792fad3 -r c1e72414eb39 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c	Fri Apr 06 16:58:07 2007 +0900
+++ b/xen/arch/ia64/xen/dom_fw.c	Fri Apr 06 19:04:23 2007 +0900
@@ -3,7 +3,8 @@
  *  Copyright (C) 2004 Hewlett-Packard Co.
  *   Dan Magenheimer ([EMAIL PROTECTED])
  *
- * Copyright (c) 2006 Isaku Yamahata yamahata at valinux co jp
+ * Copyright (c) 2006, 2007
+ *Isaku Yamahata yamahata at valinux co jp
  *VA Linux Systems Japan K.K.
  *dom0 vp model support
  */
@@ -45,7 +46,8 @@ extern unsigned long running_on_sim;
 
 #define EFI_HYPERCALL_PATCH(tgt, call)	\
 	do {\
-		dom_efi_hypercall_patch(d, FW_HYPERCALL_##call##_PADDR,	\
+		dom_efi_hypercall_patch(brkimm,\
+	FW_HYPERCALL_##call##_PADDR,	\
 		 FW_HYPERCALL_##call, hypercalls_imva);	\
 		/* Descriptor address.  */  \
 		tables-efi_runtime.tgt =   \
@@ -146,7 +148,7 @@ build_pal_hypercall_bundles(u64 *imva, u
 
 // builds a hypercall bundle at domain physical address
 static void
-dom_fpswa_hypercall_patch(struct domain *d, unsigned long imva)
+dom_fpswa_hypercall_patch(u64 brkimm, unsigned long imva)
 {
 	unsigned long *entry_imva, *patch_imva;
 	const unsigned long entry_paddr = FW_HYPERCALL_FPSWA_ENTRY_PADDR;
@@ -161,36 +163,34 @@ dom_fpswa_hypercall_patch(struct domain 
 	*entry_imva++ = patch_paddr;
 	*entry_imva   = 0;
 
-	build_hypercall_bundle(patch_imva, d-arch.breakimm,
-	   FW_HYPERCALL_FPSWA, 1);
+	build_hypercall_bundle(patch_imva, brkimm, FW_HYPERCALL_FPSWA, 1);
 }
 
 // builds a hypercall bundle at domain physical address
 static void
-dom_efi_hypercall_patch(struct domain *d, unsigned long paddr,
+dom_efi_hypercall_patch(u64 brkimm, unsigned long paddr,
 unsigned long hypercall, unsigned long imva)
 {
 	build_hypercall_bundle((u64 *)(imva + paddr - FW_HYPERCALL_BASE_PADDR),
-	   d-arch.breakimm, hypercall, 1);
+	   brkimm, hypercall, 1);
 }
 
 // builds a hypercall bundle at domain physical address
 static void
-dom_fw_hypercall_patch(struct domain *d, unsigned long paddr,
-   unsigned long hypercall,unsigned long ret,
+dom_fw_hypercall_patch(u64 brkimm, unsigned long paddr,
+		   unsigned long hypercall,unsigned long ret,
unsigned long imva)
 {
 	build_hypercall_bundle((u64 *)(imva + paddr - FW_HYPERCALL_BASE_PADDR),
-	   d-arch.breakimm, hypercall, ret);
+	   brkimm, hypercall, ret);
 }
 
 static void
-dom_fw_pal_hypercall_patch(struct domain *d, unsigned long paddr,
-   unsigned long imva)
+dom_fw_pal_hypercall_patch(u64 brkimm, unsigned long paddr, unsigned long imva)
 {
 	build_pal_hypercall_bundles((u64*)(imva + paddr -
 	FW_HYPERCALL_BASE_PADDR),
-	d-arch.breakimm, FW_HYPERCALL_PAL_CALL);
+	brkimm, FW_HYPERCALL_PAL_CALL);
 }
 
 static inline void
@@ -241,6 +241,17 @@ acpi_update_lsapic (acpi_table_entry_hea
 	return 0;
 }
 
+static u8
+generate_acpi_checksum(void *tbl, unsigned long len)
+{
+	u8 *ptr, sum = 

[Xen-ia64-devel] [RFC][PATCH 5/10] memmap: split pal_call_stub

2007-04-06 Thread Isaku Yamahata

 5 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175854552 -32400
# Node ID b7c63ce297a325f808a331c9a67d2d9b769a67c6
# Parent  dfb094327ba5ace51001ac8a675eefdb53fbd546
move pal_call_stub from xenasm.S to dom_fw_asm.S to be shared by xen and libxc.
PATCHNAME: move_pal_call_stub

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r dfb094327ba5 -r b7c63ce297a3 xen/arch/ia64/xen/Makefile
--- a/xen/arch/ia64/xen/Makefile	Fri Apr 06 19:04:46 2007 +0900
+++ b/xen/arch/ia64/xen/Makefile	Fri Apr 06 19:15:52 2007 +0900
@@ -6,6 +6,7 @@ obj-y += dom0_ops.o
 obj-y += dom0_ops.o
 obj-y += domain.o
 obj-y += dom_fw.o
+obj-y += dom_fw_asm.o
 obj-y += fw_emul.o
 obj-y += hpsimserial.o
 obj-y += hypercall.o
diff -r dfb094327ba5 -r b7c63ce297a3 xen/arch/ia64/xen/dom_fw_asm.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +
+++ b/xen/arch/ia64/xen/dom_fw_asm.S	Fri Apr 06 19:15:52 2007 +0900
@@ -0,0 +1,41 @@
+// moved from xenasm.S to be shared by xen and libxc
+/*
+ * Assembly support routines for Xen/ia64
+ *
+ * Copyright (C) 2004 Hewlett-Packard Co
+ *  Dan Magenheimer [EMAIL PROTECTED]
+ *
+ * Copyright (c) 2007 Isaku Yamahata yamahata at valinux co jp
+ *VA Linux Systems Japan K.K.
+ */
+
+//  These instructions are copied in the domains.
+//  This is the virtual PAL, which simply does a hypercall.
+//  The size is 2 bundles (32 Bytes).  It handles both static and stacked
+//convention.
+//  If you modify this code, you have to modify dom_fw.h (for the size) and
+//   dom_fw_pal_hypercall_patch.
+
+// This file is shared with xen and libxc.
+// GLOBAL_ENTRY() end END() macro can't be used.
+
+//GLOBAL_ENTRY(xen_ia64_pal_call_stub)
+.global xen_ia64_pal_call_stub;
+.align 32;
+.proc xen_ia64_pal_call_stub;
+xen_ia64_pal_call_stub:
+	{
+	 .mii
+	addl r2=0x1000,r0	//  Hypercall number (Value is patched).
+	mov r9=256
+	;; 
+	cmp.gtu p7,p8=r9,r28		/* r32 = 255? */
+	}
+	{
+	 .mbb
+	break 0x1000		//  Hypercall vector (Value is patched).
+(p7)	br.cond.sptk.few rp
+(p8)	br.ret.sptk.few rp
+	}
+//END(xen_ia64_pal_call_stub)
+.endp xen_ia64_pal_call_stub
diff -r dfb094327ba5 -r b7c63ce297a3 xen/arch/ia64/xen/dom_fw_common.c
--- a/xen/arch/ia64/xen/dom_fw_common.c	Fri Apr 06 19:04:46 2007 +0900
+++ b/xen/arch/ia64/xen/dom_fw_common.c	Fri Apr 06 19:15:52 2007 +0900
@@ -110,17 +110,19 @@ static void
 static void
 build_pal_hypercall_bundles(uint64_t *imva, uint64_t brkimm, uint64_t hypnum)
 {
-	extern unsigned long pal_call_stub[];
+	extern unsigned long xen_ia64_pal_call_stub[];
 	IA64_BUNDLE bundle;
 	INST64_A5 slot_a5;
 	INST64_M37 slot_m37;
 
-	/* The source of the hypercall stub is the pal_call_stub function
-	   defined in xenasm.S.  */
+	/*
+	 * The source of the hypercall stub is
+	 * the xen_ia64_pal_call_stub function defined in dom_fw_asm.S. 
+	 */
 
 	/* Copy the first bundle and patch the hypercall number.  */
-	bundle.i64[0] = pal_call_stub[0];
-	bundle.i64[1] = pal_call_stub[1];
+	bundle.i64[0] = xen_ia64_pal_call_stub[0];
+	bundle.i64[1] = xen_ia64_pal_call_stub[1];
 	slot_a5.inst = bundle.slot0;
 	slot_a5.imm7b = hypnum;
 	slot_a5.imm9d = hypnum  7;
@@ -132,8 +134,8 @@ build_pal_hypercall_bundles(uint64_t *im
 	ia64_fc(imva + 1);
 	
 	/* Copy the second bundle and patch the hypercall vector.  */
-	bundle.i64[0] = pal_call_stub[2];
-	bundle.i64[1] = pal_call_stub[3];
+	bundle.i64[0] = xen_ia64_pal_call_stub[2];
+	bundle.i64[1] = xen_ia64_pal_call_stub[3];
 	slot_m37.inst = bundle.slot0;
 	slot_m37.imm20a = brkimm;
 	slot_m37.i = brkimm  20;
diff -r dfb094327ba5 -r b7c63ce297a3 xen/arch/ia64/xen/xenasm.S
--- a/xen/arch/ia64/xen/xenasm.S	Fri Apr 06 19:04:46 2007 +0900
+++ b/xen/arch/ia64/xen/xenasm.S	Fri Apr 06 19:15:52 2007 +0900
@@ -356,26 +356,3 @@ stacked:
 	br.ret.sptk.few rp
 END(pal_emulator_static)
 
-//  These instructions are copied in the domains.
-//  This is the virtual PAL, which simply does a hypercall.
-//  The size is 2 bundles (32 Bytes).  It handles both static and stacked
-//convention.
-//  If you modify this code, you have to modify dom_fw.h (for the size) and
-//   dom_fw_pal_hypercall_patch.
-GLOBAL_ENTRY(pal_call_stub)
-	{
-	 .mii
-	addl r2=0x1000,r0	//  Hypercall number (Value is patched).
-	mov r9=256
-	;; 
-	cmp.gtu p7,p8=r9,r28		/* r32 = 255? */
-	}
-	{
-	 .mbb
-	break 0x1000		//  Hypercall vector (Value is patched).
-(p7)	br.cond.sptk.few rp
-(p8)	br.ret.sptk.few rp
-	}
-END(pal_call_stub)
-
-
diff -r dfb094327ba5 -r b7c63ce297a3 xen/include/asm-ia64/dom_fw.h
--- a/xen/include/asm-ia64/dom_fw.h	Fri Apr 06 19:04:46 2007 +0900
+++ b/xen/include/asm-ia64/dom_fw.h	Fri Apr 06 19:15:52 2007 +0900
@@ -59,7 +59,8 @@
  * rp=b0 indicates the return point.
  *
  * A single hypercall is used for all PAL calls.
- * The hypercall stub is pal_call_stub (xenasm.S).  Its size is 2 bundles.
+ * The hypercall stub is xen_ia64_pal_call_stub (dom_fw_asm.S). 
+ * Its size is 2 bundles.
  */
 
 #define FW_HYPERCALL_PAL_CALL_INDEX	0x80UL

[Xen-ia64-devel] [RFC][PATCH 3/10] memmap: copy dom_fw.c to dom_fw_common.c

2007-04-06 Thread Isaku Yamahata

 3 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175853877 -32400
# Node ID effb5913144bef1973aa7ce58289c869ded2e5e6
# Parent  c1e72414eb39b01e35ccb941bbe22ec60847acfe
copy dom_fw.c to dom_fw_common.c
PATCHNAME: copy_dom_fw_c_to_dom_fw_common_c

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r c1e72414eb39 -r effb5913144b xen/arch/ia64/xen/dom_fw_common.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +
+++ b/xen/arch/ia64/xen/dom_fw_common.c	Fri Apr 06 19:04:37 2007 +0900
@@ -0,0 +1,1233 @@
+/*
+ *  Xen domain firmware emulation support
+ *  Copyright (C) 2004 Hewlett-Packard Co.
+ *   Dan Magenheimer ([EMAIL PROTECTED])
+ *
+ * Copyright (c) 2006, 2007
+ *Isaku Yamahata yamahata at valinux co jp
+ *VA Linux Systems Japan K.K.
+ *dom0 vp model support
+ */
+
+#include xen/config.h
+#include asm/system.h
+#include asm/pgalloc.h
+
+#include linux/efi.h
+#include linux/sort.h
+#include asm/io.h
+#include asm/pal.h
+#include asm/sal.h
+#include asm/meminit.h
+#include asm/fpswa.h
+#include xen/version.h
+#include xen/acpi.h
+#include xen/errno.h
+
+#include asm/dom_fw.h
+#include asm/bundle.h
+
+#define ONE_MB (1UL  20)
+
+extern unsigned long running_on_sim;
+
+#define FW_VENDOR X\0e\0n\0/\0i\0a\0\066\0\064\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
+
+#define MAKE_MD(typ, attr, start, end) 	\
+	do {\
+		md = tables-efi_memmap + i++;\
+		md-type = typ;		\
+		md-pad = 0;		\
+		md-phys_addr = start;	\
+		md-virt_addr = 0;	\
+		md-num_pages = (end - start)  EFI_PAGE_SHIFT;	\
+		md-attribute = attr;	\
+	} while (0)
+
+#define EFI_HYPERCALL_PATCH(tgt, call)	\
+	do {\
+		dom_efi_hypercall_patch(brkimm,\
+	FW_HYPERCALL_##call##_PADDR,	\
+		 FW_HYPERCALL_##call, hypercalls_imva);	\
+		/* Descriptor address.  */  \
+		tables-efi_runtime.tgt =   \
+		FW_FIELD_MPA(func_ptrs) + 8 * pfn;  \
+		/* Descriptor.  */  \
+		tables-func_ptrs[pfn++] = FW_HYPERCALL_##call##_PADDR;	\
+		tables-func_ptrs[pfn++] = 0; 	\
+	} while (0)
+
+/* allocate a page for fw
+ * guest_setup() @ libxc/xc_linux_build.c does for domU
+ */
+static inline void
+assign_new_domain_page_if_dom0(struct domain *d, unsigned long mpaddr)
+{
+if (d == dom0)
+assign_new_domain0_page(d, mpaddr);
+}
+
+/**
+Hypercall bundle creation
+**/
+
+static void
+build_hypercall_bundle(u64 *imva, u64 brkimm, u64 hypnum, u64 ret)
+{
+	INST64_A5 slot0;
+	INST64_I19 slot1;
+	INST64_B4 slot2;
+	IA64_BUNDLE bundle;
+
+	// slot1: mov r2 = hypnum (low 20 bits)
+	slot0.inst = 0;
+	slot0.qp = 0; slot0.r1 = 2; slot0.r3 = 0; slot0.major = 0x9;
+	slot0.imm7b = hypnum; slot0.imm9d = hypnum  7;
+	slot0.imm5c = hypnum  16; slot0.s = 0;
+	// slot1: break brkimm
+	slot1.inst = 0;
+	slot1.qp = 0; slot1.x6 = 0; slot1.x3 = 0; slot1.major = 0x0;
+	slot1.imm20 = brkimm; slot1.i = brkimm  20;
+	// if ret slot2:  br.ret.sptk.many rp
+	// else   slot2:  br.cond.sptk.many rp
+	slot2.inst = 0; slot2.qp = 0; slot2.p = 1; slot2.b2 = 0;
+	slot2.wh = 0; slot2.d = 0; slot2.major = 0x0;
+	if (ret) {
+		slot2.btype = 4; slot2.x6 = 0x21;
+	}
+	else {
+		slot2.btype = 0; slot2.x6 = 0x20;
+	}
+	
+	bundle.i64[0] = 0; bundle.i64[1] = 0;
+	bundle.template = 0x11;
+	bundle.slot0 = slot0.inst; bundle.slot2 = slot2.inst;
+	bundle.slot1a = slot1.inst; bundle.slot1b = slot1.inst  18;
+	
+	imva[0] = bundle.i64[0]; imva[1] = bundle.i64[1];
+	ia64_fc(imva);
+	ia64_fc(imva + 1);
+}
+
+static void
+build_pal_hypercall_bundles(u64 *imva, u64 brkimm, u64 hypnum)
+{
+	extern unsigned long pal_call_stub[];
+	IA64_BUNDLE bundle;
+	INST64_A5 slot_a5;
+	INST64_M37 slot_m37;
+
+	/* The source of the hypercall stub is the pal_call_stub function
+	   defined in xenasm.S.  */
+
+	/* Copy the first bundle and patch the hypercall number.  */
+	bundle.i64[0] = pal_call_stub[0];
+	bundle.i64[1] = pal_call_stub[1];
+	slot_a5.inst = bundle.slot0;
+	slot_a5.imm7b = hypnum;
+	slot_a5.imm9d = hypnum  7;
+	slot_a5.imm5c = hypnum  16;
+	bundle.slot0 = slot_a5.inst;
+	imva[0] = bundle.i64[0];
+	imva[1] = bundle.i64[1];
+	ia64_fc(imva);
+	ia64_fc(imva + 1);
+	
+	/* Copy the second bundle and patch the hypercall vector.  */
+	bundle.i64[0] = pal_call_stub[2];
+	bundle.i64[1] = pal_call_stub[3];
+	slot_m37.inst = bundle.slot0;
+	slot_m37.imm20a = brkimm;
+	slot_m37.i = brkimm  20;
+	bundle.slot0 = slot_m37.inst;
+	imva[2] = bundle.i64[0];
+	imva[3] = bundle.i64[1];
+	ia64_fc(imva + 2);
+	ia64_fc(imva + 3);
+}
+
+// builds a hypercall bundle at domain physical address
+static void
+dom_fpswa_hypercall_patch(u64 brkimm, unsigned long imva)
+{
+	unsigned long *entry_imva, *patch_imva;
+	const unsigned long 

[Xen-ia64-devel] [RFC][PATCH 6/10] memmap: update Makefile

2007-04-06 Thread Isaku Yamahata

 6 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175838478 -32400
# Node ID abe296c50e6b838f27eed8b1149445e9e2e14da8
# Parent  b7c63ce297a325f808a331c9a67d2d9b769a67c6
update Makefile
PATCHNAME: update_xen_makefile

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r b7c63ce297a3 -r abe296c50e6b xen/arch/ia64/xen/Makefile
--- a/xen/arch/ia64/xen/Makefile	Fri Apr 06 19:15:52 2007 +0900
+++ b/xen/arch/ia64/xen/Makefile	Fri Apr 06 14:47:58 2007 +0900
@@ -5,8 +5,11 @@ obj-y += acpi.o
 obj-y += acpi.o
 obj-y += dom0_ops.o
 obj-y += domain.o
-obj-y += dom_fw.o
 obj-y += dom_fw_asm.o
+obj-y += dom_fw_common.o
+obj-y += dom_fw_dom0.o
+obj-y += dom_fw_domu.o
+obj-y += dom_fw_utils.o
 obj-y += fw_emul.o
 obj-y += hpsimserial.o
 obj-y += hypercall.o
___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

[Xen-ia64-devel] [RFC][PATCH 8/10] memmap: add necessary definitions

2007-04-06 Thread Isaku Yamahata

 8 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175854614 -32400
# Node ID 452aa57562d9985a6726750b2ed370c935bee3d7
# Parent  965bcd3e6c9740a8f14293088c56da0e7d107535
add necessary definitions
PATCHNAME: add_necessary_definitions

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 965bcd3e6c97 -r 452aa57562d9 tools/libxc/ia64/aclinux.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +
+++ b/tools/libxc/ia64/aclinux.h	Fri Apr 06 19:16:54 2007 +0900
@@ -0,0 +1,111 @@
+/**
+ *
+ * Name: aclinux.h - OS specific defines, etc.
+ *
+ */
+
+/*
+ * Copyright (C) 2000 - 2005, R. Byron Moore
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions, and the following disclaimer,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *substantially similar to the NO WARRANTY disclaimer below
+ *(Disclaimer) and any redistribution must be conditioned upon
+ *including a substantially similar Disclaimer requirement for further
+ *binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *of any contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License (GPL) version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACLINUX_H__
+#define __ACLINUX_H__
+
+#define ACPI_USE_SYSTEM_CLIBRARY
+#define ACPI_USE_DO_WHILE_0
+
+#if 0 /* def __KERNEL__ */
+
+#include xen/config.h
+#include xen/string.h
+#include xen/kernel.h
+#include xen/ctype.h
+#include asm/system.h
+#include asm/atomic.h
+#include asm/div64.h
+#include asm/acpi.h
+
+#define strtoul simple_strtoul
+
+#define ACPI_MACHINE_WIDTH  BITS_PER_LONG
+
+#else /* !__KERNEL__ */
+
+#include stdarg.h
+#include string.h
+//#include stdlib.h
+#include ctype.h
+#include unistd.h
+
+#if defined(__ia64__) || defined(__x86_64__)
+#define ACPI_MACHINE_WIDTH  64
+#define COMPILER_DEPENDENT_INT64long
+#define COMPILER_DEPENDENT_UINT64   unsigned long
+#else
+#define ACPI_MACHINE_WIDTH  32
+#define COMPILER_DEPENDENT_INT64long long
+#define COMPILER_DEPENDENT_UINT64   unsigned long long
+#define ACPI_USE_NATIVE_DIVIDE
+#endif
+
+typedef int8_t		s8;
+typedef uint8_t		u8;
+typedef int16_t		s16;
+typedef uint16_t	u16;
+typedef int32_t		s32;
+typedef uint32_t	u32;
+typedef int64_t		s64;
+typedef uint64_t	u64;
+#define __iomem
+#ifdef __ia64__
+#ifdef __cplusplus
+#define CPP_ASMLINKAGE extern C
+#else
+#define CPP_ASMLINKAGE
+#endif
+#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage))
+#endif
+#define CONFIG_ACPI_BOOT	1
+
+#define __cdecl
+#define ACPI_FLUSH_CPU_CACHE()
+#endif /* __KERNEL__ */
+
+/* Linux uses GCC */
+
+#include acgcc.h
+
+#endif /* __ACLINUX_H__ */
diff -r 965bcd3e6c97 -r 452aa57562d9 tools/libxc/ia64/sal.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +
+++ b/tools/libxc/ia64/sal.h	Fri Apr 06 19:16:54 2007 +0900
@@ -0,0 +1,71 @@
+#ifndef XC_IA64_SAL_H
+#define XC_IA64_SAL_H
+
+/*
+ * definitions from
+ * xen/include/asm-ia64/linux/asm/sal.h
+ */
+
+/*
+ * The SAL system table is followed by a variable number of variable
+ * length descriptors.  The structure of these descriptors follows
+ * below.
+ * The defininition follows SAL specs from July 2000
+ */
+struct ia64_sal_systab {
+	uint8_t signature[4];	/* should be SST_ */
+	uint32_t size;		/* size of this table in bytes */
+	uint8_t sal_rev_minor;
+	uint8_t sal_rev_major;
+	uint16_t entry_count;	/* # of entries in variable portion */
+	uint8_t checksum;
+	uint8_t reserved1[7];
+	uint8_t sal_a_rev_minor;
+	uint8_t sal_a_rev_major;
+	uint8_t sal_b_rev_minor;
+	uint8_t sal_b_rev_major;
+	/* oem_id  

[Xen-ia64-devel] [RFC][PATCH 9/10] memmap: move domain fw builder from xen to libxc

2007-04-06 Thread Isaku Yamahata

 9 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175855567 -32400
# Node ID 0a28a364fd1689b5d7a278932aa9f773fb068724
# Parent  452aa57562d9985a6726750b2ed370c935bee3d7
make libxc domain builder set up firmware instead of xen hyperviser.
PATCHNAME: make_libxc_domain_builder_set_up_firmware

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 452aa57562d9 -r 0a28a364fd16 tools/libxc/ia64/Makefile
--- a/tools/libxc/ia64/Makefile	Fri Apr 06 19:16:54 2007 +0900
+++ b/tools/libxc/ia64/Makefile	Fri Apr 06 19:32:47 2007 +0900
@@ -3,3 +3,46 @@ GUEST_SRCS-y += ia64/xc_ia64_hvm_build.c
 GUEST_SRCS-y += ia64/xc_ia64_hvm_build.c
 GUEST_SRCS-y += ia64/xc_ia64_linux_save.c
 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 := $(addprefix ia64/, $(DOMFW_SRCS_BASE))
+$(DOMFW_SRCS):
+	ln -sf ../$(XEN_ROOT)/xen/arch/ia64/xen/$(@F) $@
+
+# XXX kludge: libxc/Makefile doesn't understand .S.
+GUEST_SRCS-y += $(patsubst %.S, %.c, $(DOMFW_SRCS))
+%.o: %.S
+	$(CC) $(CFLAGS) -c $ -o $@
+%.opic: %.S
+	$(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $
+
+
+CFLAGS	+= -Iia64
+
+DOMFW_ASM_HDRS_BASE := bundle.h dom_fw.h dom_fw_common.h dom_fw_domu.h
+DOMFW_ASM_HDRS := $(addprefix ia64/asm/, $(DOMFW_ASM_HDRS_BASE))
+$(DOMFW_ASM_HDRS): ia64/asm
+	ln -sf ../../$(XEN_ROOT)/xen/include/asm-ia64/$(@F) $@
+build: $(DOMFW_ASM_HDR)
+
+.PHONY: mk-symlinks-acpi ia64-clean
+
+IA64_HDR_DIRS := ia64/asm ia64/xen ia64/acpi ia64/acpi/platform
+$(IA64_HDR_DIRS):
+	mkdir -p $@
+
+IA64_EMPTY_FILES := ia64/asm/acpi.h ia64/xen/list.h 
+$(IA64_EMPTY_FILES): $(IA64_HDR_DIRS)
+	echo /* automatically created dummy empty header file. */  $@
+
+mk-symlinks-acpi: $(IA64_HDR_DIRS) $(IA64_EMPTY_FILES) $(DOMFW_ASM_HDRS)
+	( cd ia64/acpi  ln -sf ../../$(XEN_ROOT)/xen/include/acpi/*.h .)
+	( cd ia64/acpi/platform  ln -sf ../../../$(XEN_ROOT)/xen/include/acpi/platform/*.h .)
+	( cd ia64/acpi/platform/  ln -sf ../../aclinux.h .)
+	( cd ia64/xen  ln -sf ../../$(XEN_ROOT)/xen/include/xen/acpi.h .)
+build: mk-symlinks-acpi
+
+clean: ia64-clean
+ia64-clean:
+	rm -rf $(DOMFW_SRCS) $(DOMFW_ASM_HDRS) $(IA64_EMPTY_FILES) $(IA64_HDR_DIRS)
diff -r 452aa57562d9 -r 0a28a364fd16 tools/libxc/ia64/xc_dom_ia64_util.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +
+++ b/tools/libxc/ia64/xc_dom_ia64_util.c	Fri Apr 06 19:32:47 2007 +0900
@@ -0,0 +1,175 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright (c) 2007 Isaku Yamahata yamahata at valinux co jp
+ *VA Linux Systems Japan K.K.
+ *
+ */
+
+#include xg_private.h
+#include xc_dom.h
+#include asm/dom_fw.h
+#include asm/dom_fw_common.h
+#include ia64/xc_dom_ia64_util.h
+
+uint32_t
+xen_ia64_version(struct xc_dom_image *dom)
+{
+return xc_version(dom-guest_xc, XENVER_version, NULL);   
+}
+
+int
+xen_ia64_fpswa_revision(struct xc_dom_image *dom, unsigned int *revision)
+{
+int ret = -1;
+DECLARE_HYPERCALL;
+hypercall.op = __HYPERVISOR_ia64_dom0vp_op;
+//hypercall.arg[0] = IA64_DOM0VP_get_fpswa_revision;//XXX
+hypercall.arg[1] = (unsigned long)revision;
+
+if (lock_pages(revision, sizeof(*revision)) != 0) {
+PERROR(Could not lock memory for xen fpswa hypercall);
+goto out;
+}
+
+//ret = do_xen_hypercall(dom-guest_xc, hypercall);//XXX
+ret = -ENOSYS;
+
+unlock_pages(revision, sizeof(*revision));
+out:
+return ret;
+}
+
+int xen_ia64_is_running_on_sim(struct xc_dom_image *dom)
+{
+/*
+ * This is only used by dom_fw_init() as
+ * !xen_ia64_is_dom0() || xen_ia64_is_running_on_sim().
+ * So this doesn't affect the result.
+ */
+return 0;
+}
+
+int
+xen_ia64_is_dom0(struct xc_dom_image *unused)
+{
+/* libxc is for non-dom0 domain builder */
+return 0;
+}
+
+void*
+xen_ia64_dom_fw_map(struct xc_dom_image *dom, unsigned long mpaddr)
+{
+unsigned long page_size = XC_DOM_PAGE_SIZE(dom);
+void* ret;
+
+ret = xc_map_foreign_range(dom-guest_xc, dom-guest_domid,
+   page_size, PROT_READ | PROT_WRITE,
+   mpaddr / page_size);
+if (ret != NULL)
+ret = (void*)((unsigned long)ret | (mpaddr  (page_size - 1)));
+return ret;
+}
+
+void

[Xen-ia64-devel] [RFC][PATCH 7/10] memmap: preliminary header file clean up

2007-04-06 Thread Isaku Yamahata

 7 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175854592 -32400
# Node ID 965bcd3e6c9740a8f14293088c56da0e7d107535
# Parent  abe296c50e6b838f27eed8b1149445e9e2e14da8
preliminary header file clean up
PATCHNAME: preliminary_header_file_clean_up

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r abe296c50e6b -r 965bcd3e6c97 xen/include/asm-ia64/bundle.h
--- a/xen/include/asm-ia64/bundle.h	Fri Apr 06 14:47:58 2007 +0900
+++ b/xen/include/asm-ia64/bundle.h	Fri Apr 06 19:16:32 2007 +0900
@@ -223,8 +223,10 @@ typedef union U_INST64 {
 INST64_M47 M47;	// purge translation entry
 } INST64;
 
+#ifdef __XEN__
 extern unsigned long __vmx_get_domain_bundle(unsigned long iip, IA64_BUNDLE *pbundle);
 extern IA64_BUNDLE __get_domain_bundle(unsigned long iip);
+#endif
 
 #define MASK_41 ((unsigned long)0x1ff)
 
diff -r abe296c50e6b -r 965bcd3e6c97 xen/include/asm-ia64/dom_fw.h
--- a/xen/include/asm-ia64/dom_fw.h	Fri Apr 06 14:47:58 2007 +0900
+++ b/xen/include/asm-ia64/dom_fw.h	Fri Apr 06 19:16:32 2007 +0900
@@ -4,8 +4,6 @@
  * Copyright (C) 2004 Hewlett-Packard Co
  *	Dan Magenheimer ([EMAIL PROTECTED])
  */
-
-#include linux/efi.h
 
 /* Portion of guest physical memory space reserved for PAL/SAL/EFI/ACPI
data and code.  */
@@ -184,9 +182,12 @@
 /* Additionnal OEM SAL.  */
 #define SAL_XEN_SAL_RETURN	0x0200
 
+#ifdef __XEN__
+#include linux/efi.h
 extern struct ia64_pal_retval xen_pal_emulator(u64, u64, u64, u64);
 extern struct sal_ret_values sal_emulator (long index, unsigned long in1, unsigned long in2, unsigned long in3, unsigned long in4, unsigned long in5, unsigned long in6, unsigned long in7);
 extern struct ia64_pal_retval pal_emulator_static (unsigned long);
 extern efi_status_t efi_emulator (struct pt_regs *regs, unsigned long *fault);
 
 extern int dom_fw_setup (struct domain *, unsigned long bp_mpa, unsigned long maxmem);
+#endif
diff -r abe296c50e6b -r 965bcd3e6c97 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h	Fri Apr 06 14:47:58 2007 +0900
+++ b/xen/include/asm-ia64/domain.h	Fri Apr 06 19:16:32 2007 +0900
@@ -208,10 +208,6 @@ struct arch_vcpu {
 #include asm/uaccess.h /* for KERNEL_DS */
 #include asm/pgtable.h
 
-/* Guest physical address of IO ports space.  */
-#define IO_PORTS_PADDR  0x0c00UL
-#define IO_PORTS_SIZE   0x0400UL
-
 int
 do_perfmon_op(unsigned long cmd,
   XEN_GUEST_HANDLE(void) arg1, unsigned long arg2);
diff -r abe296c50e6b -r 965bcd3e6c97 xen/include/public/arch-ia64.h
--- a/xen/include/public/arch-ia64.h	Fri Apr 06 14:47:58 2007 +0900
+++ b/xen/include/public/arch-ia64.h	Fri Apr 06 19:16:32 2007 +0900
@@ -77,6 +77,10 @@ typedef unsigned long xen_ulong_t;
 
 #define MEM_G   (1UL  30)
 #define MEM_M   (1UL  20)
+
+/* Guest physical address of IO ports space.  */
+#define IO_PORTS_PADDR  0x0c00UL
+#define IO_PORTS_SIZE   0x0400UL
 
 #define MMIO_START   (3 * MEM_G)
 #define MMIO_SIZE(512 * MEM_M)
___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

[Xen-ia64-devel] [RFC][PATCH 10/10] memmap: remove unnecesary dom_fw.c

2007-04-06 Thread Isaku Yamahata

 10 / 10 
# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1175854696 -32400
# Node ID 0c2ee356e4c33c90e51d7e9fd28940721d42b167
# Parent  0a28a364fd1689b5d7a278932aa9f773fb068724
remove the unused file, xen/arch/ia64/xen/dom_fw.c.
PATCHNAME: remove_xen_arch_ia64_xen_dom_fw_c

Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]

diff -r 0a28a364fd16 -r 0c2ee356e4c3 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c	Fri Apr 06 19:32:47 2007 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +
@@ -1,1233 +0,0 @@
-/*
- *  Xen domain firmware emulation support
- *  Copyright (C) 2004 Hewlett-Packard Co.
- *   Dan Magenheimer ([EMAIL PROTECTED])
- *
- * Copyright (c) 2006, 2007
- *Isaku Yamahata yamahata at valinux co jp
- *VA Linux Systems Japan K.K.
- *dom0 vp model support
- */
-
-#include xen/config.h
-#include asm/system.h
-#include asm/pgalloc.h
-
-#include linux/efi.h
-#include linux/sort.h
-#include asm/io.h
-#include asm/pal.h
-#include asm/sal.h
-#include asm/meminit.h
-#include asm/fpswa.h
-#include xen/version.h
-#include xen/acpi.h
-#include xen/errno.h
-
-#include asm/dom_fw.h
-#include asm/bundle.h
-
-#define ONE_MB (1UL  20)
-
-extern unsigned long running_on_sim;
-
-#define FW_VENDOR X\0e\0n\0/\0i\0a\0\066\0\064\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
-
-#define MAKE_MD(typ, attr, start, end) 	\
-	do {\
-		md = tables-efi_memmap + i++;\
-		md-type = typ;		\
-		md-pad = 0;		\
-		md-phys_addr = start;	\
-		md-virt_addr = 0;	\
-		md-num_pages = (end - start)  EFI_PAGE_SHIFT;	\
-		md-attribute = attr;	\
-	} while (0)
-
-#define EFI_HYPERCALL_PATCH(tgt, call)	\
-	do {\
-		dom_efi_hypercall_patch(brkimm,\
-	FW_HYPERCALL_##call##_PADDR,	\
-		 FW_HYPERCALL_##call, hypercalls_imva);	\
-		/* Descriptor address.  */  \
-		tables-efi_runtime.tgt =   \
-		FW_FIELD_MPA(func_ptrs) + 8 * pfn;  \
-		/* Descriptor.  */  \
-		tables-func_ptrs[pfn++] = FW_HYPERCALL_##call##_PADDR;	\
-		tables-func_ptrs[pfn++] = 0; 	\
-	} while (0)
-
-/* allocate a page for fw
- * guest_setup() @ libxc/xc_linux_build.c does for domU
- */
-static inline void
-assign_new_domain_page_if_dom0(struct domain *d, unsigned long mpaddr)
-{
-if (d == dom0)
-assign_new_domain0_page(d, mpaddr);
-}
-
-/**
-Hypercall bundle creation
-**/
-
-static void
-build_hypercall_bundle(u64 *imva, u64 brkimm, u64 hypnum, u64 ret)
-{
-	INST64_A5 slot0;
-	INST64_I19 slot1;
-	INST64_B4 slot2;
-	IA64_BUNDLE bundle;
-
-	// slot1: mov r2 = hypnum (low 20 bits)
-	slot0.inst = 0;
-	slot0.qp = 0; slot0.r1 = 2; slot0.r3 = 0; slot0.major = 0x9;
-	slot0.imm7b = hypnum; slot0.imm9d = hypnum  7;
-	slot0.imm5c = hypnum  16; slot0.s = 0;
-	// slot1: break brkimm
-	slot1.inst = 0;
-	slot1.qp = 0; slot1.x6 = 0; slot1.x3 = 0; slot1.major = 0x0;
-	slot1.imm20 = brkimm; slot1.i = brkimm  20;
-	// if ret slot2:  br.ret.sptk.many rp
-	// else   slot2:  br.cond.sptk.many rp
-	slot2.inst = 0; slot2.qp = 0; slot2.p = 1; slot2.b2 = 0;
-	slot2.wh = 0; slot2.d = 0; slot2.major = 0x0;
-	if (ret) {
-		slot2.btype = 4; slot2.x6 = 0x21;
-	}
-	else {
-		slot2.btype = 0; slot2.x6 = 0x20;
-	}
-	
-	bundle.i64[0] = 0; bundle.i64[1] = 0;
-	bundle.template = 0x11;
-	bundle.slot0 = slot0.inst; bundle.slot2 = slot2.inst;
-	bundle.slot1a = slot1.inst; bundle.slot1b = slot1.inst  18;
-	
-	imva[0] = bundle.i64[0]; imva[1] = bundle.i64[1];
-	ia64_fc(imva);
-	ia64_fc(imva + 1);
-}
-
-static void
-build_pal_hypercall_bundles(u64 *imva, u64 brkimm, u64 hypnum)
-{
-	extern unsigned long pal_call_stub[];
-	IA64_BUNDLE bundle;
-	INST64_A5 slot_a5;
-	INST64_M37 slot_m37;
-
-	/* The source of the hypercall stub is the pal_call_stub function
-	   defined in xenasm.S.  */
-
-	/* Copy the first bundle and patch the hypercall number.  */
-	bundle.i64[0] = pal_call_stub[0];
-	bundle.i64[1] = pal_call_stub[1];
-	slot_a5.inst = bundle.slot0;
-	slot_a5.imm7b = hypnum;
-	slot_a5.imm9d = hypnum  7;
-	slot_a5.imm5c = hypnum  16;
-	bundle.slot0 = slot_a5.inst;
-	imva[0] = bundle.i64[0];
-	imva[1] = bundle.i64[1];
-	ia64_fc(imva);
-	ia64_fc(imva + 1);
-	
-	/* Copy the second bundle and patch the hypercall vector.  */
-	bundle.i64[0] = pal_call_stub[2];
-	bundle.i64[1] = pal_call_stub[3];
-	slot_m37.inst = bundle.slot0;
-	slot_m37.imm20a = brkimm;
-	slot_m37.i = brkimm  20;
-	bundle.slot0 = slot_m37.inst;
-	imva[2] = bundle.i64[0];
-	imva[3] = bundle.i64[1];
-	ia64_fc(imva + 2);
-	ia64_fc(imva + 3);
-}
-
-// builds a hypercall bundle at domain physical address
-static void
-dom_fpswa_hypercall_patch(u64 brkimm, unsigned long imva)
-{
-	unsigned long *entry_imva, *patch_imva;
-	const unsigned long 

Re: [Xen-ia64-devel] [Patch] fix serial console setting of PRIMEQUEST

2007-04-06 Thread Alex Williamson
On Fri, 2007-04-06 at 15:09 +0900, Akio Takebe wrote:
 Hi, Alex
 
 I mistake the previous patch to use serial console.
 I thought ns16550_com1.irq was irq number,
 but this is gsi number.
 So I fix it and use ns16550_com1_gsi to call iosapic_register_intr().
 
 When I made the previous patch, I used sync_console option,
 so I don't notice the issue.
 We can use serial console without sync_console otpion on PRIMEQUEST.
 
 Please apply this patch.

   Applied.  Thanks,

Alex

-- 
Alex Williamson HP Open Source  Linux Org.


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


Re: [Xen-ia64-devel] [RFC][PATCH 0/10] memmap: embed memory map in domain pseudo physical address space

2007-04-06 Thread Tristan Gingold
On Fri, Apr 06, 2007 at 08:15:59PM +0900, Isaku Yamahata wrote:
 Hi all.
Hi,

pretty large work!

 Xen/IA64 XEN_DOMCTL_arch_setup hypercall needs flexibility
 to address the following issues.
 - xm dump-core/save/restore.
   Such utilities need to know the area where memory is populated.
   Currently domU populates memory dense, but this wouldn't be
   true in future.
   Especially VTi domain builder populate memory sparsely so that
   xm dump-core/save/restore doesn't work for domVTi without the predefined 
   knowledge of memory layout.
The patch doesn't address VTi yet, does it?
I am interested in seeing how you will manage VTi :-)

Tristan.

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