mirror of
https://aur.archlinux.org/linux-vfio.git
synced 2024-12-27 05:34:10 +00:00
Patch from 4.4 that may fix booting kvm with OVMF.
This commit is contained in:
parent
55ab733a13
commit
c75e6681d6
2
.SRCINFO
2
.SRCINFO
@ -19,6 +19,7 @@ pkgbase = linux-vfio
|
|||||||
source = change-default-console-loglevel.patch
|
source = change-default-console-loglevel.patch
|
||||||
source = override_for_missing_acs_capabilities.patch
|
source = override_for_missing_acs_capabilities.patch
|
||||||
source = i915_317.patch
|
source = i915_317.patch
|
||||||
|
source = kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch
|
||||||
sha256sums = 4a622cc84b8a3c38d39bc17195b0c064d2b46945dfde0dae18f77b120bc9f3ae
|
sha256sums = 4a622cc84b8a3c38d39bc17195b0c064d2b46945dfde0dae18f77b120bc9f3ae
|
||||||
sha256sums = SKIP
|
sha256sums = SKIP
|
||||||
sha256sums = 596958c9c4b632fdf5e0cdc677859dccac4304ad07a217c9bcb0e4fa58dbea16
|
sha256sums = 596958c9c4b632fdf5e0cdc677859dccac4304ad07a217c9bcb0e4fa58dbea16
|
||||||
@ -27,6 +28,7 @@ pkgbase = linux-vfio
|
|||||||
sha256sums = 1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99
|
sha256sums = 1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99
|
||||||
sha256sums = 975f79348119bfba8dd972a9fbfe6b38484c45bfd228f2f6d48a0c02426ba149
|
sha256sums = 975f79348119bfba8dd972a9fbfe6b38484c45bfd228f2f6d48a0c02426ba149
|
||||||
sha256sums = ff2bb84f054633c6088ad31b450b7b96b5f4ee18667dd56772dff1d8c1687854
|
sha256sums = ff2bb84f054633c6088ad31b450b7b96b5f4ee18667dd56772dff1d8c1687854
|
||||||
|
sha256sums = 2d8bf50218cff86db6723f3623823a47b1c8299a2eb0589458b0a19887799f4e
|
||||||
|
|
||||||
pkgname = linux-vfio
|
pkgname = linux-vfio
|
||||||
pkgdesc = The Linux kernel and modules with patches to enable GPU passthrough with KVM
|
pkgdesc = The Linux kernel and modules with patches to enable GPU passthrough with KVM
|
||||||
|
8
PKGBUILD
8
PKGBUILD
@ -20,6 +20,7 @@ source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz"
|
|||||||
'change-default-console-loglevel.patch'
|
'change-default-console-loglevel.patch'
|
||||||
'override_for_missing_acs_capabilities.patch'
|
'override_for_missing_acs_capabilities.patch'
|
||||||
'i915_317.patch'
|
'i915_317.patch'
|
||||||
|
'kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch'
|
||||||
)
|
)
|
||||||
sha256sums=('4a622cc84b8a3c38d39bc17195b0c064d2b46945dfde0dae18f77b120bc9f3ae'
|
sha256sums=('4a622cc84b8a3c38d39bc17195b0c064d2b46945dfde0dae18f77b120bc9f3ae'
|
||||||
'SKIP'
|
'SKIP'
|
||||||
@ -28,7 +29,8 @@ sha256sums=('4a622cc84b8a3c38d39bc17195b0c064d2b46945dfde0dae18f77b120bc9f3ae'
|
|||||||
'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c'
|
'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c'
|
||||||
'1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99'
|
'1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99'
|
||||||
'975f79348119bfba8dd972a9fbfe6b38484c45bfd228f2f6d48a0c02426ba149'
|
'975f79348119bfba8dd972a9fbfe6b38484c45bfd228f2f6d48a0c02426ba149'
|
||||||
'ff2bb84f054633c6088ad31b450b7b96b5f4ee18667dd56772dff1d8c1687854')
|
'ff2bb84f054633c6088ad31b450b7b96b5f4ee18667dd56772dff1d8c1687854'
|
||||||
|
'2d8bf50218cff86db6723f3623823a47b1c8299a2eb0589458b0a19887799f4e')
|
||||||
validpgpkeys=(
|
validpgpkeys=(
|
||||||
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
|
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
|
||||||
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
|
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
|
||||||
@ -64,6 +66,10 @@ prepare() {
|
|||||||
echo '==> Applying ACS override patch'
|
echo '==> Applying ACS override patch'
|
||||||
patch -p1 -i "${srcdir}/override_for_missing_acs_capabilities.patch"
|
patch -p1 -i "${srcdir}/override_for_missing_acs_capabilities.patch"
|
||||||
|
|
||||||
|
# Backport of 879ae1880449 from 4.4 to fix booting with OVMF
|
||||||
|
echo '==> Applying OVMF kvm boot patch'
|
||||||
|
patch -p1 -i "${srcdir}/kvm-x86-obey-KVM_X86_QUIRK_CD_NW_CLEARED-in-kvm_set_cr0.patch"
|
||||||
|
|
||||||
if [ "${_kernelname}" != "" ]; then
|
if [ "${_kernelname}" != "" ]; then
|
||||||
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
|
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
|
||||||
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
|
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
From 879ae1880449c88db11c1ebdaedc2da79b2fe73f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Laszlo Ersek <lersek@redhat.com>
|
||||||
|
Date: Wed, 4 Nov 2015 12:54:41 +0100
|
||||||
|
Subject: KVM: x86: obey KVM_X86_QUIRK_CD_NW_CLEARED in kvm_set_cr0()
|
||||||
|
|
||||||
|
Commit b18d5431acc7 ("KVM: x86: fix CR0.CD virtualization") was
|
||||||
|
technically correct, but it broke OVMF guests by slowing down various
|
||||||
|
parts of the firmware.
|
||||||
|
|
||||||
|
Commit fb279950ba02 ("KVM: vmx: obey KVM_QUIRK_CD_NW_CLEARED") quirked the
|
||||||
|
first function modified by b18d5431acc7, vmx_get_mt_mask(), for OVMF's
|
||||||
|
sake. This restored the speed of the OVMF code that runs before
|
||||||
|
PlatformPei (including the memory intensive LZMA decompression in SEC).
|
||||||
|
|
||||||
|
This patch extends the quirk to the second function modified by
|
||||||
|
b18d5431acc7, kvm_set_cr0(). It eliminates the intrusive slowdown that
|
||||||
|
hits the EFI_MP_SERVICES_PROTOCOL implementation of edk2's
|
||||||
|
UefiCpuPkg/CpuDxe -- which is built into OVMF --, when CpuDxe starts up
|
||||||
|
all APs at once for initialization, in order to count them.
|
||||||
|
|
||||||
|
We also carry over the kvm_arch_has_noncoherent_dma() sub-condition from
|
||||||
|
the other half of the original commit b18d5431acc7.
|
||||||
|
|
||||||
|
Fixes: b18d5431acc7a2fd22767925f3a6f597aa4bd29e
|
||||||
|
Cc: stable@vger.kernel.org
|
||||||
|
Cc: Jordan Justen <jordan.l.justen@intel.com>
|
||||||
|
Cc: Alex Williamson <alex.williamson@redhat.com>
|
||||||
|
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
|
||||||
|
Tested-by: Janusz Mocek <januszmk6@gmail.com>
|
||||||
|
Signed-off-by: Laszlo Ersek <lersek@redhat.com>#
|
||||||
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||||
|
---
|
||||||
|
arch/x86/kvm/x86.c | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
|
||||||
|
index a24bae0..30723a4 100644
|
||||||
|
--- a/arch/x86/kvm/x86.c
|
||||||
|
+++ b/arch/x86/kvm/x86.c
|
||||||
|
@@ -625,7 +625,9 @@ int kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
|
||||||
|
if ((cr0 ^ old_cr0) & update_bits)
|
||||||
|
kvm_mmu_reset_context(vcpu);
|
||||||
|
|
||||||
|
- if ((cr0 ^ old_cr0) & X86_CR0_CD)
|
||||||
|
+ if (((cr0 ^ old_cr0) & X86_CR0_CD) &&
|
||||||
|
+ kvm_arch_has_noncoherent_dma(vcpu->kvm) &&
|
||||||
|
+ !kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED))
|
||||||
|
kvm_zap_gfn_range(vcpu->kvm, 0, ~0ULL);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
--
|
||||||
|
cgit v0.11.2
|
||||||
|
|
Loading…
Reference in New Issue
Block a user