[Xen-ia64-devel] [PATCH] fix domain_flush_vtlb_all()

2006-07-04 Thread Isaku Yamahata

fix domain_flush_vtlb_all(). it should purge software tlb entry of 
specified vcpu, not current.

-- 
yamahata
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 6e0a9a5a6a17ed7572cf62a0b77ad5560b7d9501
# Parent  a55e5195e5f7fc6a55a147ff3e8d1b94d4667c70
fix domain_flush_vtlb_all(). it should purge software tlb entry of 
specified vcpu, not current.
PATCHNAME: fix_domain_flush_vtlb_all

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

diff -r a55e5195e5f7 -r 6e0a9a5a6a17 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Tue Jul 04 15:17:26 2006 +0900
+++ b/xen/arch/ia64/xen/vcpu.c  Tue Jul 04 15:19:37 2006 +0900
@@ -2065,7 +2065,7 @@ IA64FAULT vcpu_ptc_e(VCPU *vcpu, UINT64 
// architected loop to purge the entire TLB, should use
//  base = stride1 = stride2 = 0, count0 = count 1 = 1
 
-   vcpu_flush_vtlb_all ();
+   vcpu_flush_vtlb_all(current);
 
return IA64_NO_FAULT;
 }
diff -r a55e5195e5f7 -r 6e0a9a5a6a17 xen/arch/ia64/xen/vhpt.c
--- a/xen/arch/ia64/xen/vhpt.c  Tue Jul 04 15:17:26 2006 +0900
+++ b/xen/arch/ia64/xen/vhpt.c  Tue Jul 04 15:19:37 2006 +0900
@@ -129,10 +129,8 @@ void vhpt_init(void)
 }
 
 
-void vcpu_flush_vtlb_all (void)
-{
-   struct vcpu *v = current;
-
+void vcpu_flush_vtlb_all(struct vcpu *v)
+{
/* First VCPU tlb.  */
vcpu_purge_tr_entry(PSCBX(v,dtlb));
vcpu_purge_tr_entry(PSCBX(v,itlb));
@@ -148,6 +146,11 @@ void vcpu_flush_vtlb_all (void)
   check this.  */
 }
 
+static void __vcpu_flush_vtlb_all(void *vcpu)
+{
+   vcpu_flush_vtlb_all((struct vcpu*)vcpu);
+}
+
 void domain_flush_vtlb_all (void)
 {
int cpu = smp_processor_id ();
@@ -158,12 +161,11 @@ void domain_flush_vtlb_all (void)
continue;
 
if (v-processor == cpu)
-   vcpu_flush_vtlb_all ();
+   vcpu_flush_vtlb_all(v);
else
-   smp_call_function_single
-   (v-processor,
-(void(*)(void *))vcpu_flush_vtlb_all,
-NULL,1,1);
+   smp_call_function_single(v-processor,
+__vcpu_flush_vtlb_all,
+v, 1, 1);
}
 }
 
diff -r a55e5195e5f7 -r 6e0a9a5a6a17 xen/include/asm-ia64/tlbflush.h
--- a/xen/include/asm-ia64/tlbflush.h   Tue Jul 04 15:17:26 2006 +0900
+++ b/xen/include/asm-ia64/tlbflush.h   Tue Jul 04 15:19:37 2006 +0900
@@ -11,7 +11,7 @@
 */
 
 /* Local all flush of vTLB.  */
-void vcpu_flush_vtlb_all (void);
+void vcpu_flush_vtlb_all(struct vcpu *v);
 
 /* Local range flush of machine TLB only (not full VCPU virtual TLB!!!)  */
 void vcpu_flush_tlb_vhpt_range (u64 vadr, u64 log_range);
___
Xen-ia64-devel mailing list
Xen-ia64-devel@lists.xensource.com
http://lists.xensource.com/xen-ia64-devel

[Xen-ia64-devel] [patch] [0/11] Support INIT handler of xen (Take3)

2006-07-04 Thread Akio Takebe
Hi,

I updated my init handler patches.
These patches are base on 2.6.13.
I reflected commets.

[1/11]  add IA64_MCA_CPU_INIT_STACK_OFFSET
[2/11]  Fix GATE_ADDR for ia64_do_show_stack()
[3/11]  Fix GET_THIS_PADDR
[4/11]  Fix LOAD_PHYSCAL macro. (This fix is workaround)
[5/11]  add unw_init_from_interruption()
[6/11]  Fix MINSTATE_START/END_SAVE_MIN_PHYS for INIT handler
[7/11]  Fix MINSTATE_GET_CURRENT
[8/11]  Add mca_asm.S for supporting ia64_monarch_init_handler()
[9/11]  Add mca.c for supporting init_handler
[10/11] Add mca_asm, mca into Makefile
[11/11] INIT hadler for support coredumping feature

Best Regards,

Akio Takebe


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


[Xen-ia64-devel] [patch][1/11] add IA64_MCA_CPU_INIT_STACK_OFFSET

2006-07-04 Thread Akio Takebe
add IA64_MCA_CPU_INIT_STACK_OFFSET which is used in 
MINSTATE_START_SAVE_MIN_PHYS

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

 asm-offsets.c |4 
 1 files changed, 4 insertions(+)


add_init_stack_offset.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] [patch][2/11] Fix GATE_ADDR for ia64_do_show_stack()

2006-07-04 Thread Akio Takebe
I fix GATE_ADDR  and define it in include/asm-ia64/xensystem.h.

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

 linux-xen/asm/system.h |2 +-
 xensystem.h|1 +
 2 files changed, 2 insertions(+), 1 deletion(-)


fix_gate_addr.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] [patch][4/11] Fix LOAD_PHYSCAL macro. (This fix is workaround)

2006-07-04 Thread Akio Takebe

This fix is workaround. Now LOAD_PHYSCAL is used only 
by MCA/INIT handler. I'll try to make dinamic patch function. 
I'll remove this fix if I make it.
So please apply for supporting INIT handler.

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

 a/xen/include/asm-ia64/linux/asm/asmmacro.h  |  111 -
 b/xen/include/asm-ia64/linux-xen/asm/asmmacro.h  |  119 +++
 xen/include/asm-ia64/linux-xen/asm/README.origin |1 
 xen/include/asm-ia64/linux/asm/README.origin |1 
 4 files changed, 120 insertions(+), 112 deletions(-)


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


[Xen-ia64-devel] [patch][5/11] add unw_init_from_interruption()

2006-07-04 Thread Akio Takebe
add unw_init_from_interruption() into unwind.c

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

 unwind.c |   23 +++
 1 files changed, 23 insertions(+)



add_unw_init_from_interruption.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] [patch][6/11] Fix MINSTATE_START/END_SAVE_MIN_PHYS for INIT handler

2006-07-04 Thread Akio Takebe
I modified linux code to make this fix.
difference between linux and my fix
- THIS_CPU(ia64_mca_data)  have physcal address of each cpu's ia64_mca_cpu.
  I computed address of init_stack by using it.
- from dep r12=-1,r12,61,3; to dep r12=-1,r12,60,4;
  to computed xen virtual address.

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

 minstate.h |   29 +++--
 1 files changed, 27 insertions(+), 2 deletions(-)

fix_minstate_save_min_phys.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] [patch][7/11] Fix MINSTATE_GET_CURRENT

2006-07-04 Thread Akio Takebe

To get virtual cuurent address in both physcal mode and virtual mode, 
I add MINSTATE_GET_CURRENT_VIRT.

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

 minstate.h |   29 +++--
 1 files changed, 27 insertions(+), 2 deletions(-)


fix_minstate_get_current.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] [patch][8/11] Add mca_asm.S for supporting ia64_monarch_init_handler()

2006-07-04 Thread Akio Takebe
I remove unused code from original linux code.
Now ia64_os_mca_dispatch is infinity loop for debug.

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

 b/xen/arch/ia64/linux-xen/mca_asm.S   |  159 ++
 xen/arch/ia64/linux-xen/README.origin |1 
 2 files changed, 160 insertions(+)


add_mca_asm_S.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] [patch][9/11] Add mca.c for supporting init_handler

2006-07-04 Thread Akio Takebe

In ia64_mca_cpu_init(), 
I use alloc_xenheap_pages() for allocation of ia64_mca_cpu.
In linux, alloc_bootmem is used.

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

 mca.c |  442 ++
 1 files changed, 442 insertions(+)

add_mca_init.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] [patch][10/11] Add mca_asm, mca into Makefile

2006-07-04 Thread Akio Takebe

This patch turn on new init handler.

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

 linux-xen/Makefile |1 +
 xen/Makefile   |1 +
 xen/xenmisc.c  |2 --
 3 files changed, 2 insertions(+), 2 deletions(-)

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

Re: PATCH: was Re: [Xen-ia64-devel] Re: PATCH: implements DOM0_DOMAIN_SETUP

2006-07-04 Thread Tristan Gingold
Hi Alex,

have you any problems to integrate this patch ?  Did you miss it ?
I'd like to finish the save  restore work.

Tristan.

Le Mercredi 28 Juin 2006 10:18, Tristan Gingold a écrit :
 Le Mercredi 28 Juin 2006 00:33, Alex Williamson a écrit :
  On Mon, 2006-06-26 at 16:01 +0200, Tristan Gingold wrote:
   Hi,
  
   because DOM0_DOMAIN_SETUP has been added in common code, I repost my
   patch (slightly updated).
   This patch doesn't add features for user: s/he just have to recompile
   the tools, the hypervisor and the kernel :-)
  
   The main change is cleanups wrt domain creation.  This is also a first
   step for save  restore.
 
  Tristan,
 
 Tools won't build for me with this patch:
 
  gcc  -O2 -fomit-frame-pointer -DNDEBUG -Wall -Wstrict-prototypes
  -Wdeclaration-after-statement  -D__XEN_TOOLS__ -Werror
  -fno-strict-aliasing -I. -Wp,-MD,.xc_linux_build.o.d -c -o
  xc_linux_build.o xc_linux_build.c In file included from
  /usr/include/asm/pal.h:84,
   from /usr/include/asm/system.h:19,
   from xc_linux_build.c:19:
  /usr/include/asm/fpu.h:57: error: redefinition of `struct ia64_fpreg'
  In file included from /usr/include/asm/system.h:19,
   from xc_linux_build.c:19:
  /usr/include/asm/pal.h:92: error: syntax error before pal_status_t
  /usr/include/asm/pal.h:105: error: syntax error before
  pal_cache_level_t /usr/include/asm/pal.h:113: error: syntax error
  before pal_cache_type_t /usr/include/asm/pal.h:126: error: syntax error
  before
  pal_cache_line_state_t /usr/include/asm/pal.h:133: error: syntax error
  before u64
  ...
 
  It's making me a little uncomfortable to include asm/system.h in that
  file given that there are no other asm includes.  Thanks,

 I have redefined struct ia64_boot_param as struct xen_ia64_boot_param in
 arch-ia64.h.  This solves this issue.

 Tristan.

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


[Xen-ia64-devel][PATCH] rewrite rfi emulation

2006-07-04 Thread Xu, Anthony
This approach of emulating rfi is straightforward

Signed-off-by: Anthony Xu  [EMAIL PROTECTED] 

Thanks,
Anthony


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

Re: PATCH: was Re: [Xen-ia64-devel] Re: PATCH: implements DOM0_DOMAIN_SETUP

2006-07-04 Thread Tristan Gingold
Le Mardi 04 Juillet 2006 09:22, Tristan Gingold a écrit :
 Hi Alex,

 have you any problems to integrate this patch ?  Did you miss it ?
 I'd like to finish the save  restore work.

 Tristan.
Here is the updated version of the patch (it applies cleanly to tip).
Tested by booting domU and domVti.

Tristan.
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 2adba71da949d68e0ffa71fc2cfb03f274200329
# Parent  f7132169c2bf453db85f40b4041380f387b74082
Implement and use DOM0_DOMAIN_STEUP.
DOM0_GETMEMLIST now reads ptes and use gpfn.
Domain builder reworked: calls DOMAIN_SETUP, setup start_info page.
SAL data are now in domain memory.
is_vti field added in domain.arch.
Many cleanups (indentation, static, warnings).

Signed-off-by: Tristan Gingold [EMAIL PROTECTED]

diff -r f7132169c2bf -r 2adba71da949 linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Mon Jul 03 09:11:49 2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Tue Jul 04 13:01:17 2006 +0200
@@ -523,15 +523,14 @@ setup_arch (char **cmdline_p)
 		shared_info_t *s = HYPERVISOR_shared_info;
 
 		xen_start_info = __va(s-arch.start_info_pfn  PAGE_SHIFT);
-		xen_start_info-flags = s-arch.flags;
 
 		printk(Running on Xen! start_info_pfn=0x%lx nr_pages=%ld 
 		   flags=0x%x\n, s-arch.start_info_pfn,
 		   xen_start_info-nr_pages, xen_start_info-flags);
 
 		/* xen_start_info isn't setup yet, get the flags manually */
-		if (s-arch.flags  SIF_INITDOMAIN) {
-			if (!(s-arch.flags  SIF_PRIVILEGED))
+		if (xen_start_info-flags  SIF_INITDOMAIN) {
+			if (!(xen_start_info-flags  SIF_PRIVILEGED))
 panic(Xen granted us console access 
   but not privileged status);
 		} else {
diff -r f7132169c2bf -r 2adba71da949 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Mon Jul 03 09:11:49 2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Tue Jul 04 13:01:17 2006 +0200
@@ -547,8 +547,10 @@ xen_ia64_privcmd_entry_mmap(struct vm_ar
 	unsigned long gpfn;
 	unsigned long flags;
 
-	BUG_ON((addr  ~PAGE_MASK) != 0);
-	BUG_ON(mfn == INVALID_MFN);
+	if ((addr  ~PAGE_MASK) != 0 || mfn == INVALID_MFN) {
+		error = -EINVAL;
+		goto out;
+	}
 
 	if (entry-gpfn != INVALID_GPFN) {
 		error = -EBUSY;
diff -r f7132169c2bf -r 2adba71da949 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c	Mon Jul 03 09:11:49 2006 -0600
+++ b/tools/ioemu/vl.c	Tue Jul 04 13:01:17 2006 +0200
@@ -3198,6 +3198,9 @@ int main(int argc, char **argv)
PROT_READ|PROT_WRITE,
page_array[nr_pages - 1]);
 
+fprintf(logfile, shared page at pfn:%lx, mfn: %PRIx64\n, (nr_pages-1),
+   (uint64_t)(page_array[nr_pages - 1]));
+
 #elif defined(__ia64__)
 if ( xc_ia64_get_pfn_list(xc_handle, domid, page_array, 0, nr_pages)
  != nr_pages)
@@ -3217,7 +3220,7 @@ int main(int argc, char **argv)
 
 if ( xc_ia64_get_pfn_list(xc_handle, domid,
   page_array,
-  nr_pages + (GFW_SIZE  PAGE_SHIFT), 1) != 1 )
+  IO_PAGE_START  PAGE_SHIFT, 1) != 1 )
 {
 fprintf(logfile, xc_ia64_get_pfn_list returned error %d\n, errno);
 exit(-1);
@@ -3226,10 +3229,10 @@ int main(int argc, char **argv)
 shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
PROT_READ|PROT_WRITE,
page_array[0]);
-#endif
-
-fprintf(logfile, shared page at pfn:%lx, mfn: %PRIx64\n, (nr_pages-1),
-   (uint64_t)(page_array[nr_pages - 1]));
+
+fprintf(logfile, shared page at pfn:%lx, mfn: %l016x\n,
+	IO_PAGE_START  PAGE_SHIFT, page_array[0]);
+#endif
 
 /* we always create the cdrom drive, even if no disk is there */
 bdrv_init();
diff -r f7132169c2bf -r 2adba71da949 tools/libxc/xc_ia64_stubs.c
--- a/tools/libxc/xc_ia64_stubs.c	Mon Jul 03 09:11:49 2006 -0600
+++ b/tools/libxc/xc_ia64_stubs.c	Tue Jul 04 13:01:17 2006 +0200
@@ -141,15 +141,6 @@ error_out:
 #define HOB_SIGNATURE 0x3436474953424f48// HOBSIG64
 #define GFW_HOB_START ((4UL30)-(14UL20))// 4G - 14M
 #define GFW_HOB_SIZE  (1UL20) // 1M
-#define RAW_GFW_START_NR(s)   ((s)  PAGE_SHIFT)
-#define RAW_GFW_HOB_START_NR(s)\
-(RAW_GFW_START_NR(s) + ((GFW_HOB_START - GFW_START)  PAGE_SHIFT))
-#define RAW_GFW_IMAGE_START_NR(s,i)\
-(RAW_GFW_START_NR(s) + (((GFW_SIZE - (i)))  PAGE_SHIFT))
-#define RAW_IO_PAGE_START_NR(s)\
-(RAW_GFW_START_NR(s) + (GFW_SIZE  PAGE_SHIFT))
-#define RAW_STORE_PAGE_START_NR(s) \
-(RAW_IO_PAGE_START_NR(s) + (IO_PAGE_SIZE  PAGE_SHFIT))
 
 typedef struct {
 unsigned long signature;
@@ -371,7 +362,7 @@ load_hob(int xc_handle, uint32_t dom, vo
 nr_pages = (hob_size + PAGE_SIZE -1)  PAGE_SHIFT;
 
 return 

[Xen-ia64-devel] [PATCH] emulate PAL_HALT_LIGHT on domU

2006-07-04 Thread Atsushi SAKAI
Hi, All

This patch emulates Guest PAL_HALT_LIGHT on domU by using do_block and timer.
It also adds the function of the timer event sending to domU at the vcpu woke 
up.

Signed-off-by: Atsushi SAKAI [EMAIL PROTECTED]


About the timer event sending to domU

The function xen_timer_interrupt on ParaVM/IA64 only sends 
the timer signal to current vcpu.
When the idle domain is running, no domUx receives timer signal.
If some domain cannot receive the timer signal during 10 secs,
a message BUG: soft lockup detected appeared comes from domUx.
To avoid this, I add a timer check routine at the vcpu woke up.

I tested a few days.

Thanks,
Atsushi SAKAI





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

Re: [Xen-ia64-devel] [PATCH] emulate PAL_HALT_LIGHT on domU

2006-07-04 Thread Isaku Yamahata

Hi Sakai.

xenLinux/x86 paravirtualizes idle loop to get timer interrupt
while cpu halting.
More exactly safe_halt() is paravirtualized using
HYPERVISOR_set_timer_op().
Xen/IA64 doesn't support HYPERVISOR_set_timer_op(), but it
would be quite easy to add its support.

I'm not sure about which is better, your approach or paravirtualizing
idle loop.
Could you explain the reason why you added vcpu-arch.hlt_timer
instead of supporting set_timer_op hypercall with vcpu-timer?

Thanks.

On Wed, Jul 05, 2006 at 12:46:35PM +0900, Atsushi SAKAI wrote:
 Hi, All
 
 This patch emulates Guest PAL_HALT_LIGHT on domU by using do_block and timer.
 It also adds the function of the timer event sending to domU at the vcpu woke 
 up.
 
 Signed-off-by: Atsushi SAKAI [EMAIL PROTECTED]
 
 
 About the timer event sending to domU
 
 The function xen_timer_interrupt on ParaVM/IA64 only sends 
 the timer signal to current vcpu.
 When the idle domain is running, no domUx receives timer signal.
 If some domain cannot receive the timer signal during 10 secs,
 a message BUG: soft lockup detected appeared comes from domUx.
 To avoid this, I add a timer check routine at the vcpu woke up.
 
 I tested a few days.
 
 Thanks,
 Atsushi SAKAI
 
 
 


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

-- 
yamahata

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