diff --git a/qemu-fix-cpuid-trimming.patch b/qemu-fix-cpuid-trimming.patch
new file mode 100644
index 0000000..a52ea53
--- /dev/null
+++ b/qemu-fix-cpuid-trimming.patch
@@ -0,0 +1,29 @@
+From: Mark McLoughlin <markmc@redhat.com>
+Subject: [PATCH] Work around supported cpuid ioctl() brokenness
+
+KVM_GET_SUPPORTED_CPUID has been known to fail to return -E2BIG
+when it runs out of entries. Detect this by always trying again
+with a bigger table if the ioctl() fills the table.
+
+Signed-off-by: Mark McLoughlin <markmc@redhat.com>
+Signed-off-by: Avi Kivity <avi@redhat.com>
+---
+ kvm/libkvm/libkvm-x86.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/kvm/libkvm/libkvm-x86.c b/kvm/libkvm/libkvm-x86.c
+index a2f6320..4f9539a 100644
+--- a/kvm/libkvm/libkvm-x86.c
++++ b/kvm/libkvm/libkvm-x86.c
+@@ -575,6 +575,8 @@ static struct kvm_cpuid2 *try_get_cpuid(kvm_context_t kvm, int max)
+ 	r = ioctl(kvm->fd, KVM_GET_SUPPORTED_CPUID, cpuid);
+ 	if (r == -1)
+ 		r = -errno;
++	else if (r == 0 && cpuid->nent >= max)
++		r = -E2BIG;
+ 	if (r < 0) {
+ 		if (r == -E2BIG) {
+ 			free(cpuid);
+-- 
+1.6.0.6
+
diff --git a/qemu.spec b/qemu.spec
index 06cf135..84744c7 100644
--- a/qemu.spec
+++ b/qemu.spec
@@ -5,7 +5,7 @@
 Summary: QEMU is a FAST! processor emulator
 Name: qemu
 Version: 0.10.50
-Release: 5.%{kvmvertag}%{?dist}
+Release: 6.%{kvmvertag}%{?dist}
 # Epoch because we pushed a qemu-1.0 package
 Epoch: 2
 License: GPLv2+ and LGPLv2+ and BSD
@@ -34,11 +34,15 @@ Patch05: qemu-prevent-cdrom-media-eject-while-device-is-locked.patch
 # Avoid harmless "unhandled wrmsr" warnings (#499712)
 Patch06: qemu-avoid-harmless-msr-warnings.patch
 
+# Fix from upstream for "kernel requires an x86-64 CPU" error
+Patch07: qemu-fix-cpuid-trimming.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel zlib-devel which texi2html gnutls-devel cyrus-sasl-devel
 BuildRequires: rsync dev86 iasl
 BuildRequires: pciutils-devel
 BuildRequires: pulseaudio-libs-devel
+BuildRequires: ncurses-devel
 Requires: %{name}-user = %{epoch}:%{version}-%{release}
 Requires: %{name}-system-x86 = %{epoch}:%{version}-%{release}
 Requires: %{name}-system-sparc = %{epoch}:%{version}-%{release}
@@ -219,6 +223,7 @@ such as kvmtrace and kvm_stat.
 %patch04 -p1 -b .disable-preadv
 %patch05 -p1 -b .prevent-cdrom-eject
 %patch06 -p1 -b .wrmsr-warnings
+%patch07 -p1 -b .cpuid-trimming
 
 %build
 # systems like rhel build system does not have a recent enough linker so
@@ -462,6 +467,10 @@ fi
 %{_mandir}/man1/qemu-img.1*
 
 %changelog
+* Fri Jun  5 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.10.50-6.kvm86
+- Fix 'kernel requires an x86-64 CPU' error
+- BuildRequires ncurses-devel to enable '-curses' option (#504226)
+
 * Wed Jun  3 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.10.50-5.kvm86
 - Prevent locked cdrom eject - fixes hang at end of anaconda installs (#501412)
 - Avoid harmless 'unhandled wrmsr' warnings (#499712)