summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEggz2023-11-02 09:10:59 +0000
committerEggz2023-11-02 09:10:59 +0000
commit311a16335e0c418228dcf9b2c1fdfde2d8a1b341 (patch)
tree09bec9961f2cae5a5760d88c5013121dbfeedd2b
parentb3ab3f7db9932c29e9ae874d1dbdc3d718800725 (diff)
downloadaur-311a16335e0c418228dcf9b2c1fdfde2d8a1b341.tar.gz
svm fix
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD6
-rw-r--r--flushbyasid.patch45
3 files changed, 53 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 03ec63b2c722..c4cb4fa23c25 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = linux-amd-znver2
pkgver = 6.6.v.0
- pkgrel = 1
+ pkgrel = 2
url = https://www.kernel.org/
arch = x86_64
license = GPL2
@@ -19,11 +19,13 @@ pkgbase = linux-amd-znver2
source = linux-amd-znver2.preset
source = linux.install
source = https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/20230105/more-uarches-for-kernel-5.17+.patch
+ source = flushbyasid.patch
sha256sums = SKIP
sha256sums = cc2126f4fb2a9158657b1fd690a8f3d86ec837c9f4ca45539fa8b789e5102b41
sha256sums = a7dda487e8277bfdf0dd0a6f578b219ae97de84b00df1822330e808c378df907
sha256sums = d590e751ab4cf424b78fd0d57e53d187f07401a68c8b468d17a5f39a337dacf0
sha256sums = 81ad663925a0aa5b5332a69bae7227393664bb81ee2e57a283e7f16e9ff75efe
+ sha256sums = 0878a970035793ca761c6f7499fb37cf04e6d9892758ca3fb9b99f846febfaf0
pkgname = linux-amd-znver2
pkgdesc = Linux kernel aimed at the znver2 AMD Ryzen CPU based hardware
diff --git a/PKGBUILD b/PKGBUILD
index eb500d9b59d1..341ee9ca79fd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@ gitver=v6.6
patchver=20230105
patchname=more-uarches-for-kernel-5.17+.patch
pkgver=6.6.v.0
-pkgrel=1
+pkgrel=2
arch=('x86_64')
url="https://www.kernel.org/"
license=('GPL2')
@@ -22,6 +22,8 @@ source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#ta
'linux.install'
# patch from our graysky archlinux colleague
"https://raw.githubusercontent.com/graysky2/kernel_compiler_patch/$patchver/$patchname"
+ # nested KVM svm patch
+ "flushbyasid.patch"
)
sha256sums=('SKIP'
#config.x86_64
@@ -32,6 +34,8 @@ sha256sums=('SKIP'
'd590e751ab4cf424b78fd0d57e53d187f07401a68c8b468d17a5f39a337dacf0'
#grayskypatch
'81ad663925a0aa5b5332a69bae7227393664bb81ee2e57a283e7f16e9ff75efe'
+ #flushbyasid.patch
+ '0878a970035793ca761c6f7499fb37cf04e6d9892758ca3fb9b99f846febfaf0'
)
_kernelname=${pkgbase#linux}
diff --git a/flushbyasid.patch b/flushbyasid.patch
new file mode 100644
index 000000000000..9926cc5e4218
--- /dev/null
+++ b/flushbyasid.patch
@@ -0,0 +1,45 @@
+diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
+index 3fea8c47679e..60891b9ce25f 100644
+--- a/arch/x86/kvm/svm/nested.c
++++ b/arch/x86/kvm/svm/nested.c
+@@ -247,18 +247,6 @@ static bool nested_svm_check_bitmap_pa(struct kvm_vcpu *vcpu, u64 pa, u32 size)
+ kvm_vcpu_is_legal_gpa(vcpu, addr + size - 1);
+ }
+
+-static bool nested_svm_check_tlb_ctl(struct kvm_vcpu *vcpu, u8 tlb_ctl)
+-{
+- /* Nested FLUSHBYASID is not supported yet. */
+- switch(tlb_ctl) {
+- case TLB_CONTROL_DO_NOTHING:
+- case TLB_CONTROL_FLUSH_ALL_ASID:
+- return true;
+- default:
+- return false;
+- }
+-}
+-
+ static bool __nested_vmcb_check_controls(struct kvm_vcpu *vcpu,
+ struct vmcb_ctrl_area_cached *control)
+ {
+@@ -278,9 +266,6 @@ static bool __nested_vmcb_check_controls(struct kvm_vcpu *vcpu,
+ IOPM_SIZE)))
+ return false;
+
+- if (CC(!nested_svm_check_tlb_ctl(vcpu, control->tlb_ctl)))
+- return false;
+-
+ if (CC((control->int_ctl & V_NMI_ENABLE_MASK) &&
+ !vmcb12_is_intercept(control, INTERCEPT_NMI))) {
+ return false;
+diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
+index 1785de7dc98b..9cf7eef161ff 100644
+--- a/arch/x86/kvm/svm/svm.c
++++ b/arch/x86/kvm/svm/svm.c
+@@ -5083,6 +5083,7 @@ static __init void svm_set_cpu_caps(void)
+ if (nested) {
+ kvm_cpu_cap_set(X86_FEATURE_SVM);
+ kvm_cpu_cap_set(X86_FEATURE_VMCBCLEAN);
++ kvm_cpu_cap_set(X86_FEATURE_FLUSHBYASID);
+
+ if (nrips)
+ kvm_cpu_cap_set(X86_FEATURE_NRIPS);