rpms/kernel/F-10 kvm-Fix-PDPTR-reloading-on-CR4-writes.patch, NONE, 1.1 kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch, NONE, 1.1 linux-2.6-xen-fix_warning_when_deleting_gendisk.patch, NONE, 1.1 linux-2.6-xen-xenbus_state_transition_when_not_connected.patch, NONE, 1.1 linux-2.6.29-xen-disable-gbpages.patch, NONE, 1.1 kernel.spec, 1.1373, 1.1374

Chuck Ebbert cebbert at fedoraproject.org
Mon May 25 18:59:08 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13583

Modified Files:
	kernel.spec 
Added Files:
	kvm-Fix-PDPTR-reloading-on-CR4-writes.patch 
	kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch 
	linux-2.6-xen-fix_warning_when_deleting_gendisk.patch 
	linux-2.6-xen-xenbus_state_transition_when_not_connected.patch 
	linux-2.6.29-xen-disable-gbpages.patch 
Log Message:
Copy Xen / KVM updates from Fedora 11 kernel:
    kvm-Fix-PDPTR-reloading-on-CR4-writes.patch
    kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch
    linux-2.6-xen-fix_warning_when_deleting_gendisk.patch
    linux-2.6-xen-xenbus_state_transition_when_not_connected.patch
    linux-2.6.29-xen-disable-gbpages.patch

kvm-Fix-PDPTR-reloading-on-CR4-writes.patch:

--- NEW FILE kvm-Fix-PDPTR-reloading-on-CR4-writes.patch ---
>From 89fab5a4a4e30049f71976fc7c01829db842080a Mon Sep 17 00:00:00 2001
From: Avi Kivity <avi at redhat.com>
Date: Sun, 24 May 2009 22:19:00 +0300
Subject: KVM: Fix PDPTR reloading on CR4 writes

The processor is documented to reload the PDPTRs while in PAE mode if any
of the CR4 bits PSE, PGE, or PAE change.  Linux relies on this
behaviour when zapping the low mappings of PAE kernels during boot.

The code already handled changes to CR4.PAE; augment it to also notice changes
to PSE and PGE.

This triggered while booting an F11 PAE kernel; the futex initialization code
runs before any CR3 reloads and writes to a NULL pointer; the futex subsystem
ended up uninitialized, killing PI futexes and pulseaudio which uses them.

Cc: stable at kernel.org
Signed-off-by: Avi Kivity <avi at redhat.com>
(cherry picked from commit a2edf57f510cce6a389cc14e58c6ad0a4296d6f9)
---
 arch/x86/kvm/x86.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 425423e..96de927 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -334,6 +334,9 @@ EXPORT_SYMBOL_GPL(kvm_lmsw);
 
 void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
 {
+	unsigned long old_cr4 = vcpu->arch.cr4;
+	unsigned long pdptr_bits = X86_CR4_PGE | X86_CR4_PSE | X86_CR4_PAE;
+
 	if (cr4 & CR4_RESERVED_BITS) {
 		printk(KERN_DEBUG "set_cr4: #GP, reserved bits\n");
 		kvm_inject_gp(vcpu, 0);
@@ -347,7 +350,8 @@ void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
 			kvm_inject_gp(vcpu, 0);
 			return;
 		}
-	} else if (is_paging(vcpu) && !is_pae(vcpu) && (cr4 & X86_CR4_PAE)
+	} else if (is_paging(vcpu) && (cr4 & X86_CR4_PAE)
+		   && ((cr4 ^ old_cr4) & pdptr_bits)
 		   && !load_pdptrs(vcpu, vcpu->arch.cr3)) {
 		printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n");
 		kvm_inject_gp(vcpu, 0);
-- 
1.6.2.2


kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch:

--- NEW FILE kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch ---
>From b1c2a57cdda4ddaa8751c558345296742c18cf7b Mon Sep 17 00:00:00 2001
From: Avi Kivity <avi at redhat.com>
Date: Sun, 24 May 2009 22:15:25 +0300
Subject: KVM: Make paravirt tlb flush also reload the PAE PDPTRs

The paravirt tlb flush may be used not only to flush TLBs, but also
to reload the four page-directory-pointer-table entries, as it is used
as a replacement for reloading CR3.  Change the code to do the entire
CR3 reloading dance instead of simply flushing the TLB.

Cc: stable at kernel.org
Signed-off-by: Avi Kivity <avi at redhat.com>
(cherry picked from commit a8cd0244e9cebcf9b358d24c7e7410062f3665cb)
---
 arch/x86/kvm/mmu.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 8005da2..2d2affd 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2906,8 +2906,7 @@ static int kvm_pv_mmu_write(struct kvm_vcpu *vcpu,
 
 static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu)
 {
-	kvm_x86_ops->tlb_flush(vcpu);
-	set_bit(KVM_REQ_MMU_SYNC, &vcpu->requests);
+	kvm_set_cr3(vcpu, vcpu->arch.cr3);
 	return 1;
 }
 
-- 
1.6.2.2


linux-2.6-xen-fix_warning_when_deleting_gendisk.patch:

--- NEW FILE linux-2.6-xen-fix_warning_when_deleting_gendisk.patch ---
Currently blkfront gives a warning when hot unplugging due to calling
del_gendisk() with interrupts disabled (due to blkif_io_lock).

WARNING: at kernel/softirq.c:124 local_bh_enable+0x36/0x84()
Modules linked in: xenfs xen_netfront ext3 jbd mbcache xen_blkfront
Pid: 13, comm: xenwatch Not tainted 2.6.29-xs5.5.0.13 #3
Call Trace:
 [<c012611c>] warn_slowpath+0x80/0xb6
 [<c0104cf1>] xen_sched_clock+0x16/0x63
 [<c0104710>] xen_force_evtchn_callback+0xc/0x10
 [<c0104e32>] check_events+0x8/0xe
 [<c0104d9b>] xen_restore_fl_direct_end+0x0/0x1
 [<c0103749>] xen_mc_flush+0x10a/0x13f
 [<c0105bd2>] __switch_to+0x114/0x14e
 [<c011d92b>] dequeue_task+0x62/0x70
 [<c0123b6f>] finish_task_switch+0x2b/0x84
 [<c0299877>] schedule+0x66d/0x6e7
 [<c0104710>] xen_force_evtchn_callback+0xc/0x10
 [<c0104710>] xen_force_evtchn_callback+0xc/0x10
 [<c012a642>] local_bh_enable+0x36/0x84
 [<c022f9a7>] sk_filter+0x57/0x5c
 [<c0233dae>] netlink_broadcast+0x1d5/0x315
 [<c01c6371>] kobject_uevent_env+0x28d/0x331
 [<c01e7ead>] device_del+0x10f/0x120
 [<c01e7ec6>] device_unregister+0x8/0x10
 [<c015f86d>] bdi_unregister+0x2d/0x39
 [<c01bf6f4>] unlink_gendisk+0x23/0x3e
 [<c01ac946>] del_gendisk+0x7b/0xe7
 [<d0828c19>] blkfront_closing+0x28/0x6e [xen_blkfront]
 [<d082900c>] backend_changed+0x3ad/0x41d [xen_blkfront]

We can fix this by calling del_gendisk() later in blkfront_closing, after
releasing blkif_io_lock. Since the queue is stopped during the interrupts
disabled phase I don't think there is any danger of an event occuring between
releasing the blkif_io_lock and deleting the disk.

Signed-off-by: Ian Campbell <ian.campbell at citrix.com>
Cc: Jeremy Fitzhardinge <jeremy at goop.org>
---
 drivers/block/xen-blkfront.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 8f90508..aa0c94b 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -934,8 +934,6 @@ static void blkfront_closing(struct xenbus_device *dev)
 
 	spin_lock_irqsave(&blkif_io_lock, flags);
 
-	del_gendisk(info->gd);
-
 	/* No more blkif_request(). */
 	blk_stop_queue(info->rq);
 
@@ -949,6 +947,8 @@ static void blkfront_closing(struct xenbus_device *dev)
 	blk_cleanup_queue(info->rq);
 	info->rq = NULL;
 
+	del_gendisk(info->gd);
+
  out:
 	xenbus_frontend_closed(dev);
 }
-- 
1.5.6.5


linux-2.6-xen-xenbus_state_transition_when_not_connected.patch:

--- NEW FILE linux-2.6-xen-xenbus_state_transition_when_not_connected.patch ---
This situation can occur when attempting to attach a block device whose backend
is an empty physical CD-ROM driver. The backend in this case will go directly
from the Initialising state to Closing->Closed. Previously this would result in
a NULL pointer deref on info->gd (xenbus_dev_fatal does not return as a1a15ac5
seems to expect)

Signed-off-by: Ian Campbell <ian.campbell at citrix.com>
Cc: Jeremy Fitzhardinge <jeremy at goop.org>
---
 drivers/block/xen-blkfront.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index aa0c94b..a6cbf7b 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -977,8 +977,10 @@ static void backend_changed(struct xenbus_device *dev,
 		break;
 
 	case XenbusStateClosing:
-		if (info->gd == NULL)
-			xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
+		if (info->gd == NULL) {
+			xenbus_frontend_closed(dev);
+			break;
+		}
 		bd = bdget_disk(info->gd, 0);
 		if (bd == NULL)
 			xenbus_dev_fatal(dev, -ENODEV, "bdget failed");
-- 
1.5.6.5


linux-2.6.29-xen-disable-gbpages.patch:

--- NEW FILE linux-2.6.29-xen-disable-gbpages.patch ---
diff -up linux-2.6.29.noarch/arch/x86/xen/enlighten.c.orig linux-2.6.29.noarch/arch/x86/xen/enlighten.c
--- linux-2.6.29.noarch/arch/x86/xen/enlighten.c.orig	2009-05-18 14:27:53.000000000 +0200
+++ linux-2.6.29.noarch/arch/x86/xen/enlighten.c	2009-05-18 14:32:07.000000000 +0200
@@ -218,6 +218,8 @@ static void xen_cpuid(unsigned int *ax, 
 			    (1 << X86_FEATURE_MCE)  |  /* disable MCE */
 			    (1 << X86_FEATURE_MCA)  |  /* disable MCA */
 			    (1 << X86_FEATURE_ACC));   /* thermal monitoring */
+	else if (*ax == 0x80000001)
+		maskedx = ~((1 << (X86_FEATURE_GBPAGES&31))); /* disable GB pages */
 
 	asm(XEN_EMULATE_PREFIX "cpuid"
 		: "=a" (*ax),


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1373
retrieving revision 1.1374
diff -u -p -r1.1373 -r1.1374
--- kernel.spec	25 May 2009 18:51:14 -0000	1.1373
+++ kernel.spec	25 May 2009 18:58:37 -0000	1.1374
@@ -731,6 +731,11 @@ Patch9011: linux-2.6-dropwatch-protocol.
 # kvm fixes
 Patch9303: linux-2.6-kvm-skip-pit-check.patch
 Patch9304: linux-2.6-xen-check-for-nx-support.patch
+Patch9305: linux-2.6-xen-fix_warning_when_deleting_gendisk.patch
+Patch9306: linux-2.6-xen-xenbus_state_transition_when_not_connected.patch
+Patch9307: linux-2.6.29-xen-disable-gbpages.patch
+Patch9308: kvm-Fix-PDPTR-reloading-on-CR4-writes.patch
+Patch9309: kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch
 
 Patch9400: linux-2.6-crypto-aes-padlock-fix-autoload.patch
 Patch9401: linux-2.6-crypto-aes-padlock-fix-autoload-2.patch
@@ -1377,6 +1382,11 @@ ApplyPatch linux-2.6-dropwatch-protocol.
 # kvm fixes
 ApplyPatch linux-2.6-kvm-skip-pit-check.patch
 ApplyPatch linux-2.6-xen-check-for-nx-support.patch
+ApplyPatch linux-2.6-xen-fix_warning_when_deleting_gendisk.patch
+ApplyPatch linux-2.6-xen-xenbus_state_transition_when_not_connected.patch
+ApplyPatch linux-2.6.29-xen-disable-gbpages.patch
+ApplyPatch kvm-Fix-PDPTR-reloading-on-CR4-writes.patch
+ApplyPatch kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch
 
 # make padlock autoload again
 ApplyPatch linux-2.6-crypto-aes-padlock-fix-autoload.patch
@@ -1968,6 +1978,14 @@ fi
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Mon May 25 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.4-74
+- Copy Xen / KVM updates from Fedora 11 kernel:
+    kvm-Fix-PDPTR-reloading-on-CR4-writes.patch
+    kvm-Make-paravirt-tlb-flush-also-reload-the-PAE-PDP.patch
+    linux-2.6-xen-fix_warning_when_deleting_gendisk.patch
+    linux-2.6-xen-xenbus_state_transition_when_not_connected.patch
+    linux-2.6.29-xen-disable-gbpages.patch
+
 * Mon May 25 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.4-73
 - Enable PCI Message Signaled Interrupts (MSI) by default.
 




More information about the scm-commits mailing list