lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211020120726.4022086-1-pizhenwei@bytedance.com>
Date:   Wed, 20 Oct 2021 20:07:26 +0800
From:   zhenwei pi <pizhenwei@...edance.com>
To:     pbonzini@...hat.com, corbet@....net
Cc:     wanpengli@...cent.com, seanjc@...gle.com,
        linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
        zhenwei pi <pizhenwei@...edance.com>
Subject: [PATCH] x86/kvm: Introduce boot parameter no-kvm-pvipi

Although host side exposes KVM PV SEND IPI feature to guest side,
guest should still have a chance to disable it.

A typicall case of this parameter:
If the host AMD server enables AVIC feature, the flat mode of APIC
get better performance in the guest.

Signed-off-by: zhenwei pi <pizhenwei@...edance.com>
---
 Documentation/admin-guide/kernel-parameters.txt |  2 ++
 arch/x86/kernel/kvm.c                           | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 43dc35fe5bc0..73b8712b94b0 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3495,6 +3495,8 @@
 	no-kvmapf	[X86,KVM] Disable paravirtualized asynchronous page
 			fault handling.
 
+	no-kvm-pvipi	[X86,KVM] Disable paravirtualized KVM send IPI.
+
 	no-vmw-sched-clock
 			[X86,PV_OPS] Disable paravirtualized VMware scheduler
 			clock and use the default one.
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index b656456c3a94..911f1cd2bec5 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -62,6 +62,17 @@ static int __init parse_no_stealacc(char *arg)
 
 early_param("no-steal-acc", parse_no_stealacc);
 
+static int kvm_pvipi = 1;
+
+static int __init parse_no_kvm_pvipi(char *arg)
+{
+	kvm_pvipi = 0;
+
+	return 0;
+}
+
+early_param("no-kvm-pvipi", parse_no_kvm_pvipi);
+
 static DEFINE_PER_CPU_DECRYPTED(struct kvm_vcpu_pv_apf_data, apf_reason) __aligned(64);
 DEFINE_PER_CPU_DECRYPTED(struct kvm_steal_time, steal_time) __aligned(64) __visible;
 static int has_steal_clock = 0;
@@ -795,7 +806,7 @@ static uint32_t __init kvm_detect(void)
 static void __init kvm_apic_init(void)
 {
 #ifdef CONFIG_SMP
-	if (pv_ipi_supported())
+	if (pv_ipi_supported() && kvm_pvipi)
 		kvm_setup_pv_ipi();
 #endif
 }
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ