Bug 515238 - Add Qemu disable pci devices patch to support Xen Windows GPLPV drivers
Summary: Add Qemu disable pci devices patch to support Xen Windows GPLPV drivers
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen
Version: 5.5
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: 5.6
Assignee: Don Dutile (Red Hat)
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 514500
TreeView+ depends on / blocked
 
Reported: 2009-08-03 13:16 UTC by Pasi Karkkainen
Modified: 2011-01-13 22:18 UTC (History)
7 users (show)

Fixed In Version: xen-3.0.3-117.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-13 22:18:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
upstream patch given by the reporter (19.00 KB, patch)
2010-05-17 11:11 UTC, Paolo Bonzini
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0031 0 normal SHIPPED_LIVE xen bug fix and enhancement update 2011-01-12 15:59:24 UTC

Description Pasi Karkkainen 2009-08-03 13:16:54 UTC
Upstream Xen 3.4.0 and later versions provide a clean and safe way for Windows PV drivers to disable Qemu (IDE) devices. The patch prevents possible disk/ntfs corruption, which could happen if both the qemu emulated IDE device and the PV disk were active/visible at the same time. 

Patch against Xen 3.3.1 (from GPLPV driver author):
http://www.meadowcourt.org/downloads/old/qemu_disable_patches.zip

Some discussion about merging the patch on xen-devel:
http://lists.xensource.com/archives/html/xen-devel/2009-01/msg00705.html

This patch can also be found From xen-3.3.1-11 rpm in Fedora 11 (it was merged to xen-3.3.1-6).

Comment 2 Paolo Bonzini 2010-05-17 11:09:36 UTC
Something like this is likely to be added anyway for RHEL6 HVM guests, but I cannot really say when (and I'm not 100% sure).

That said, RHEL5 provides its own Windows PV drivers, which do not require the ability to "unplug" devices like this because they hide the devices on their own, without requiring QEMU support.

The relevant code is under the GPLv2 (unfortunately not all of the RHEL5 PV drivers are, but this part is), and it is more or less separate from the rest of the drivers code, so it should even be possible to integrate it in the GPLPV drivers if the author is interested.  I can provide the code on request.

Comment 3 Paolo Bonzini 2010-05-17 11:11:10 UTC
Created attachment 414521 [details]
upstream patch given by the reporter

patch extracted from the URL given by the reporter for simplicity of access

Comment 4 Pasi Karkkainen 2010-05-17 11:31:00 UTC
Thanks!

I sent an email to the GPLPV author (James Harper), let's see what he thinks about this.

Comment 5 Don Dutile (Red Hat) 2010-05-17 17:52:00 UTC
According to Stefano, you also need this patch:
commit e5d14857cd67490bf956d97c8888c0be95ed3f78
Author: Ian Jackson <ian.jackson.com>
Date:   Thu Feb 18 15:36:29 2010 +0000

    When xen_platform_pci=0 also disable fixed Xen platform ioports
    
    disable_pf should affect the platform's fixed ioport (used for device
    hot unplug etc.)
    
    Contributed-by: Stefano Stabellini <stefano.stabellini.com>
    Signed-off-by: Ian Jackson <ian.jackson.com>

diff --git a/hw/pc.c b/hw/pc.c
index 129e9d9..9375951 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1047,9 +1047,10 @@ vga_bios_error:
 #endif /* !CONFIG_DM */
     if (pci_enabled) {
         disable_pf = xenstore_parse_disable_pf_config();
-        if (disable_pf != 1)
+        if (disable_pf != 1) {
             pci_xen_platform_init(pci_bus);
-        platform_fixed_ioport_init();
+            platform_fixed_ioport_init();
+        }
     }
 
     for(i = 0; i < MAX_SERIAL_PORTS; i++) {

Comment 6 Pasi Karkkainen 2010-05-18 07:42:25 UTC
Paolo: James Harper would like to see the code you have in rhel5.

Comment 7 Pasi Karkkainen 2010-05-18 07:53:03 UTC
.. the code you have in rhel5 xen windows pv drivers.

Comment 10 Miroslav Rezanina 2010-10-01 07:09:32 UTC
Fix built into  xen-3.0.3-117.el5

Comment 11 Pasi Karkkainen 2010-10-01 07:52:39 UTC
Oh nice. Is that version of xen available for testing?

Comment 12 Miroslav Rezanina 2010-10-01 10:42:17 UTC
Hi Pasi,
package can be downloaded from people.redhat.com/mrezanin/bz515238

Comment 14 Don Dutile (Red Hat) 2010-10-01 14:34:39 UTC
(In reply to comment #11)
> Oh nice. Is that version of xen available for testing?

Tested on rhel6 HVM guest (with another set of needed updates to be posted to 6.1).  Works great!  Pls post test your test results in this bz (especially successes! ;-) ).

Comment 16 Lei Wang 2010-10-12 05:12:30 UTC
Test with:
host: i386 and x86_64
xen-3.0.3-117.el5
kernel-xen-2.6.18-226.el5

guest: i386 and x86_64
kernel-2.6.32-74.el6.bz632021
Use rhel6 kernel with patch attached to BZ 632021, download from https://brewweb.devel.redhat.com/taskinfo?taskID=2814051

Testing:
(1) Booted RHEL6 HVM guest with and without the following parameters:
    xen_emul_unplug=all xen_pv_hvm=enable

 (i) without any cmdline parameters, the RHEL6 HVM guest boots
     with ide(sd*) disks and rtl8139 network.
 (ii) with the cmdline parameters, the RHEL6 HVM guest boots
     with xvd* disks and a xen-netfront network interface.

Addtional info:
with xen-3.0.3-116 on host, even if we add the parameters to cmdline,
the result is same with step(i), and for xen-3.0.3-117 it works as expected.

According to the above result, move to VERIFIED.

Comment 18 errata-xmlrpc 2011-01-13 22:18:26 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0031.html


Note You need to log in before you can comment on or make changes to this bug.