Bug 491625

Summary: Unable to run RHEL-5 Xen within KVM guest
Product: [Fedora] Fedora Reporter: Daniel Berrange <berrange>
Component: qemuAssignee: Marcelo Tosatti <mtosatti>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dwmw2, gcosta, markmc, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 491843 (view as bug list) Environment:
Last Closed: 2009-04-15 22:56:02 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 480594    
Attachments:
Description Flags
HV serial console log
none
libvir guest config
none
QEMU stdout log/command line
none
stap script to disable pit irq ack logic none

Description Daniel Berrange 2009-03-23 08:10:47 EDT
Created attachment 336275 [details]
HV serial console log

Description of problem:
I have a guest running RHEL-5 Xen Hypervisor. On Fedora 9 KVM it worked fine (PV guest only of course). After upgrading to Fedora 11 rawhide, it no longer boots. Xen complains:


(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) ..MP-BIOS bug: 8254 timer not connected to IO-APIC
(XEN) 
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) IO-APIC + timer doesn't work!  Boot with apic=debug and send a report.  Then try booting with the 'noapic' option****************************************
(XEN) 
(XEN) Reboot in five seconds...



Version-Release number of selected component (if applicable):
On host:

  2.6.29-0.258.rc8.git2.fc11.x86_64
  qemu-0.10-0.9.kvm20090310git.fc11.x86_64

In guest

  kernel-xen-2.6.18-128.el5.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL5 in a guest
2. Switch guest to use  kernel-xen kerenl
3.
  
Actual results:
Hypervisor fails to boot

Expected results:
HV boots and can run PV guests

Additional info:
Comment 1 Daniel Berrange 2009-03-23 08:14:47 EDT
NB, booting the RHEL5 Xen Guest Hypervisor with 'noapic' works, but obviously that's undesirable as a real solution
Comment 2 Daniel Berrange 2009-03-23 08:18:48 EDT
Created attachment 336276 [details]
libvir guest config
Comment 3 Daniel Berrange 2009-03-23 08:19:45 EDT
Created attachment 336277 [details]
QEMU stdout log/command line
Comment 4 Daniel Berrange 2009-03-23 08:27:06 EDT
FYI, adding  -no-kvm-irqchip  also makes it boot correctly, but this isn't really a supportable solution either.
Comment 5 Mark McLoughlin 2009-03-25 06:00:00 EDT
Marcelo: an ideas?
Comment 6 Marcelo Tosatti 2009-03-26 14:07:13 EDT
Does it boot with -no-kvm-pit?
Comment 7 Daniel Berrange 2009-03-27 07:26:04 EDT
Yes, it also works with -no-kvm-pit.
Comment 8 Marcelo Tosatti 2009-04-04 13:59:15 EDT
I think this bug is caused by:

http://lists.xensource.com/archives/html/xen-changelog/2006-03/msg00102.html

Which effectively disables the PIC initialization for the paravirt kernel's 
PIT-through-IO_APIC boot check.

Recently KVM was changed to reinject timer interrupts only when the previous
one has been acked, which is not the case with the above changes in Xen.

It will probably be necessary to add an option to control such behavior.

Dan, can you please confirm the theory by executing the attached systemtap script with:

# stap -g xen-pit-fc11.stp

And then start the Xen guest?

Thanks
Comment 9 Marcelo Tosatti 2009-04-04 14:00:50 EDT
Created attachment 338173 [details]
stap script to disable pit irq ack logic

stap script to disable pit irq ack logic
Comment 10 Daniel Berrange 2009-04-06 06:02:06 EDT
Yes that stap script makes it boot successfully.
Comment 11 Marcelo Tosatti 2009-04-06 09:45:04 EDT
Hum, I think this has been fixed by

commit f1c45dd4a6efcf22119e0cadd3471b86e0ddc767
Author: Avi Kivity <avi@redhat.com>
Date:   Sun Jan 4 18:06:06 2009 +0200

    KVM: Reset PIT irq injection logic when the PIT IRQ is unmasked

Which is not part of 2.6.29.
Comment 12 Mark McLoughlin 2009-04-09 11:20:45 EDT
Marcelo has posted some patches to fedora-kernel-list:

  http://www.redhat.com/archives/fedora-kernel-list/2009-April/msg00005.html
Comment 13 Marcelo Tosatti 2009-04-09 18:46:54 EDT
Daniel,

Can you please give a try at the following kernel RPM:

http://koji.fedoraproject.org/koji/taskinfo?taskID=1288099

Thanks
Comment 14 Daniel Berrange 2009-04-14 11:26:20 EDT
Yes, this kernel build works for my tests
Comment 15 Marcelo Tosatti 2009-04-14 13:19:57 EDT
Thanks Daniel.

The patches have been committed to Fedora CVS.
Comment 16 Mark McLoughlin 2009-04-19 10:57:30 EDT
Fixed for F11 by:

* Thu Apr 14 2009 Marcelo Tosatti <mtosatti@redhat.com>
- kvm fixes for bz#491625