Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-28 Thread Akio Takebe
Hi, Horms

Hi Takebe-san,

thanks a lot for all your help with this problem.
With a bit of luck we now have a solution.

I found that by porting kexec_disable_iosapic() to xen (which involved
cut and paste only) and calling it from the right places, the serial port
on the rx2620 works just fine in the second kernel.

The patch below applies on top of the latest xen-ia64-kexec release
that I made. Let me know if you need a new release that incoporates this
patch.
Wow, congratulations!
Does kexeing from xen to xen work fine on both HP machine and Tiger?

Best Regards,

Akio Takebe


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


Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-28 Thread Horms
On Mon, May 28, 2007 at 03:37:06PM +0900, Akio Takebe wrote:
 Hi, Horms
 
 Hi Takebe-san,
 
 thanks a lot for all your help with this problem.
 With a bit of luck we now have a solution.
 
 I found that by porting kexec_disable_iosapic() to xen (which involved
 cut and paste only) and calling it from the right places, the serial port
 on the rx2620 works just fine in the second kernel.
 
 The patch below applies on top of the latest xen-ia64-kexec release
 that I made. Let me know if you need a new release that incoporates this
 patch.
 Wow, congratulations!
 Does kexeing from xen to xen work fine on both HP machine and Tiger?

Yes, both seem to now work fine for UP or SMP+maxcpus=1

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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


Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-27 Thread Horms
On Mon, May 28, 2007 at 01:12:28PM +0900, Horms wrote:
 On Fri, May 25, 2007 at 03:09:32PM +0900, Akio Takebe wrote:
  Hi, Horms
  
  I did find one thing which is interesting, which is that if
  I boot into the first kernel with xencons_poll, and the second
  kernel without it, then the console in both kernels works.
  I wonder if perhaps the first kernel needs to unhook something
  irq related.
  
  For completeness I tested all the combinations of booting with
  and without xencons_poll
  
  First Kernel Second Kernel
   --  No input on serial console
   -   xencons_pollSuccess
  xencons_poll  -  Success
  xencons_poll xencons_pollSuccess
  I think RTE information don't be cleared.
  Or first kernel may have to write EOI to ioapic (please see 
  kexec_disable_iosapic() in linux code).
  
  How about calling iosapic_unregister_intr() for serial console
  before booting second kernel?
 
 Calling iosapic_unregister_intr() as you suggest seems to work :-)
 I'll play around a bit more and get a patch together.

Hi Takebe-san,

thanks a lot for all your help with this problem.
With a bit of luck we now have a solution.

I found that by porting kexec_disable_iosapic() to xen (which involved
cut and paste only) and calling it from the right places, the serial port
on the rx2620 works just fine in the second kernel.

The patch below applies on top of the latest xen-ia64-kexec release
that I made. Let me know if you need a new release that incoporates this
patch.

http://www.vergenet.net/linux/kexec/ia64-xen/20070417/

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/

From: Simon Horman [EMAIL PROTECTED]
Subject: [ia64,kexec] Add kexec_disable_iosapic

Ported from Linux, this shuts down iosapic before preforming kexec.
This resolves a problem whereby the serial port on an HP RX2620
(which uses IOSAPIC) was not able to accept input. It probably
resolves a bunch of other as yet unseen problems too.

Thanks to Takebe-san for working out the solution to this puzzle.

Cc: Akio Takebe [EMAIL PROTECTED]
Signed-off-by: Simon Horman [EMAIL PROTECTED]

Index: xen-ia64-unstable.hg/xen/arch/ia64/linux-xen/iosapic.c
===
--- xen-ia64-unstable.hg.orig/xen/arch/ia64/linux-xen/iosapic.c 2007-05-28 
14:19:45.0 +0900
+++ xen-ia64-unstable.hg/xen/arch/ia64/linux-xen/iosapic.c  2007-05-28 
14:19:51.0 +0900
@@ -268,6 +268,24 @@ nop (unsigned int vector)
/* do nothing... */
 }
 
+void
+kexec_disable_iosapic(void)
+{
+struct iosapic_intr_info *info;
+struct iosapic_rte_info *rte;
+u8 vec = 0;
+for (info = iosapic_intr_info; info 
+iosapic_intr_info + IA64_NUM_VECTORS; ++info, ++vec) {
+list_for_each_entry(rte, info-rtes,
+rte_list) {
+iosapic_write(rte-addr,
+IOSAPIC_RTE_LOW(rte-rte_index),
+IOSAPIC_MASK|vec);
+iosapic_eoi(rte-addr, vec);
+}
+}
+}
+
 static void
 mask_irq (unsigned int irq)
 {
Index: xen-ia64-unstable.hg/xen/arch/ia64/xen/crash.c
===
--- xen-ia64-unstable.hg.orig/xen/arch/ia64/xen/crash.c 2007-05-28 
14:19:51.0 +0900
+++ xen-ia64-unstable.hg/xen/arch/ia64/xen/crash.c  2007-05-28 
14:19:51.0 +0900
@@ -30,6 +30,7 @@ void machine_crash_shutdown(void)
 dom0_mm_pgd_mfn = __pa(dom0-arch.mm.pgd)  PAGE_SHIFT;
 memcpy((char *)info + offsetof(crash_xen_info_t, dom0_mm_pgd_mfn),
   dom0_mm_pgd_mfn, sizeof(dom0_mm_pgd_mfn));
+kexec_disable_iosapic();
 #ifdef CONFIG_SMP
 smp_send_stop();
 #endif
Index: xen-ia64-unstable.hg/xen/include/xen/kexec.h
===
--- xen-ia64-unstable.hg.orig/xen/include/xen/kexec.h   2007-05-28 
14:19:45.0 +0900
+++ xen-ia64-unstable.hg/xen/include/xen/kexec.h2007-05-28 
14:19:51.0 +0900
@@ -27,6 +27,7 @@ void machine_kexec_reserved(xen_kexec_re
 void machine_reboot_kexec(xen_kexec_image_t *image);
 void machine_kexec(xen_kexec_image_t *image);
 void kexec_crash(void);
+void kexec_disable_iosapic(void);
 void kexec_crash_save_cpu(void);
 crash_xen_info_t *kexec_crash_save_info(void);
 void machine_crash_shutdown(void);
Index: xen-ia64-unstable.hg/xen/arch/ia64/xen/machine_kexec.c
===
--- xen-ia64-unstable.hg.orig/xen/arch/ia64/xen/machine_kexec.c 2007-05-28 
14:19:51.0 +0900
+++ xen-ia64-unstable.hg/xen/arch/ia64/xen/machine_kexec.c  2007-05-28 
14:19:51.0 +0900
@@ -89,6 +89,7 @@ static void ia64_machine_kexec(struct un
 
 void machine_kexec(xen_kexec_image_t *image)
 {
+   

Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-25 Thread Horms
On Fri, May 25, 2007 at 03:09:32PM +0900, Akio Takebe wrote:
 Hi, Horms
 
 I did find one thing which is interesting, which is that if
 I boot into the first kernel with xencons_poll, and the second
 kernel without it, then the console in both kernels works.
 I wonder if perhaps the first kernel needs to unhook something
 irq related.
 
 For completeness I tested all the combinations of booting with
 and without xencons_poll
 
 First Kernel Second Kernel
  --  No input on serial console
  -   xencons_pollSuccess
 xencons_poll  -  Success
 xencons_poll xencons_pollSuccess
 I think RTE information don't be cleared.
 Or first kernel may have to write EOI to ioapic (please see 
 kexec_disable_iosapic() in linux code).
 
 How about calling iosapic_unregister_intr() for serial console
 before booting second kernel?

Good idea, I will look into it.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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


Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-24 Thread Horms
On Wed, May 23, 2007 at 01:36:45PM +0900, Akio Takebe wrote:
 Hi, Horms
 
 After kexec, what kernel do you use?
 Xen or linux kernel?
 
 I think you don't call iosapic_register_intr(),
 arguments of iosapic_register_intr() are wrong.
 Can you check that efi.hcdp is passed to second kernel properly?
 
 FYI
 In the case of xen, HP machine call the following functions. 
 efi_setup_pcdp_console()
 setup_serial_console()
 setup_pcdp_irq()
 pcdp_hp_irq_fixup()
 
 And iosapic_register_intr() is called in start_kernel().

I took a look over those code paths and couldn't find
anything particularly interesting.

The fixup
code in pcdp_hp_irq_fixup() is not invoked, as the
rx2620 that I have seems to have pcdp-rev = 3.
The values sourced from inside the pcdp seem to be
the same as what the fixup would have set, so no drama there.

I did find one thing which is interesting, which is that if
I boot into the first kernel with xencons_poll, and the second
kernel without it, then the console in both kernels works.
I wonder if perhaps the first kernel needs to unhook something
irq related.

For completeness I tested all the combinations of booting with
and without xencons_poll

First Kernel Second Kernel
 --  No input on serial console
 -   xencons_pollSuccess
xencons_poll  -  Success
xencons_poll xencons_pollSuccess

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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


Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-23 Thread Simon Horman
On Wed, May 23, 2007 at 02:23:59PM +0900, Simon Horman wrote:
 On Wed, May 23, 2007 at 01:36:45PM +0900, Akio Takebe wrote:
  Hi, Horms
 
 Hi Takebe-san,
 
  After kexec, what kernel do you use?
  Xen or linux kernel?
 
 I am going from Xen to Xen
 
  I think you don't call iosapic_register_intr(),
  arguments of iosapic_register_intr() are wrong.
  Can you check that efi.hcdp is passed to second kernel properly?
 
 I will check.

I am pretty sure that iosapic_register_intr() is being called.
Here is a dump of some relevant variables in start_kernel()
The output is the same pre and post kdump.

(XEN) efi.hcdp=3fe2a000
(XEN) ns16550_com1_gsi=22
(XEN) ns16550_com1_polarity=1
(XEN) ns16550_com1_trigger=1
(XEN) opt_xencons=1

And to answer Alex's earlier question, the serial port in question
is the one on the motherboard, bot the one on the management processor -
I went into the lab and checked.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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


[Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-22 Thread Simon Horman
Hi,

I've been trying to hunt down a problem with the serial console on the
HP RX2620, whereby after kexec the console doesn't accept input,
although it does produce output quite happily. I should also note that
this problem does not manifest on the Tiger2 machine I have.

I've been puzzling over this for a while now, and it seems like
no RX interrupts are generated. Though I can't fathom why. If
I force the serial driver into polling mode (with some handy #if 0 work)
then everything is fine - well as fine as a polling driver can be.

I have tried comparing the serial setup in the xen and linux drivers,
however the implementation is quite different, making comparisons
difficult at best. I have tried seeing which of the many work
arounds contained in the linux driver are activated when it is used,
however it seems that the answer is none, or in other words,
the linux driver doesn't seem to do anything sepcial.

I'll continue looking over this, but if anyone has any ideas I
would be most grateful.

For reference, I am using the following kexec for ia64 on xen patches
(largely written by myself)

http://www.vergenet.net/linux/kexec/ia64-xen/20070417/

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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


Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-22 Thread Akio Takebe
Hi, Horms

After kexec, what kernel do you use?
Xen or linux kernel?

I think you don't call iosapic_register_intr(),
arguments of iosapic_register_intr() are wrong.
Can you check that efi.hcdp is passed to second kernel properly?

FYI
In the case of xen, HP machine call the following functions. 
efi_setup_pcdp_console()
setup_serial_console()
setup_pcdp_irq()
pcdp_hp_irq_fixup()

And iosapic_register_intr() is called in start_kernel().

Best Regards,

Akio Takebe


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


Re: [Xen-ia64-devel] Serial woes with kexec on an HP RX2620

2007-05-22 Thread Simon Horman
On Wed, May 23, 2007 at 01:36:45PM +0900, Akio Takebe wrote:
 Hi, Horms

Hi Takebe-san,

 After kexec, what kernel do you use?
 Xen or linux kernel?

I am going from Xen to Xen

 I think you don't call iosapic_register_intr(),
 arguments of iosapic_register_intr() are wrong.
 Can you check that efi.hcdp is passed to second kernel properly?

I will check.

 FYI
 In the case of xen, HP machine call the following functions. 
 efi_setup_pcdp_console()
 setup_serial_console()
 setup_pcdp_irq()
 pcdp_hp_irq_fixup()
 
 And iosapic_register_intr() is called in start_kernel().

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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