summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEggz2023-11-02 09:16:19 +0000
committerEggz2023-11-02 09:16:19 +0000
commitcc6936155368e8cc72e2b5368d2b850d06b1f731 (patch)
tree14c2704786e9fdb0d3e795871cd2c74691358459
parentb8e56f28af42944bd143ac32e2454583b91d83a5 (diff)
downloadaur-cc6936155368e8cc72e2b5368d2b850d06b1f731.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 41199ae51e61..bb4efb1ae342 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = linux-amd-znver3
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-znver3
source = linux-amd-znver3.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 = 56b05fd15515acca3c6235cff780bc8907888a58384c13dbda4c05e6eb5a70ae
sha256sums = 26828ab61a69fca7ecdbba4179311f7cc3c59e1f8c070bcc626c68065187222b
sha256sums = d590e751ab4cf424b78fd0d57e53d187f07401a68c8b468d17a5f39a337dacf0
sha256sums = 81ad663925a0aa5b5332a69bae7227393664bb81ee2e57a283e7f16e9ff75efe
+ sha256sums = 0878a970035793ca761c6f7499fb37cf04e6d9892758ca3fb9b99f846febfaf0
pkgname = linux-amd-znver3
pkgdesc = Linux kernel aimed at the znver3 AMD Ryzen CPU based hardware
diff --git a/PKGBUILD b/PKGBUILD
index 31c03ea715ac..dfe5220a9650 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);