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-prev] [day] [month] [year] [list]
Message-ID: <tip-ba696429d290690db967e5f49463df4b2c1314a4@git.kernel.org>
Date:   Tue, 16 Apr 2019 03:31:00 -0700
From:   tip-bot for Vitaly Kuznetsov <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     longli@...rosoft.com, bp@...en8.de, kys@...rosoft.com,
        hpa@...or.com, sthemmin@...rosoft.com, peterz@...radead.org,
        mingo@...nel.org, torvalds@...ux-foundation.org,
        linux-kernel@...r.kernel.org, sixiao@...rosoft.com,
        tglx@...utronix.de, sashal@...nel.org, haiyangz@...rosoft.com,
        vkuznets@...hat.com, Michael.H.Kelley@...rosoft.com
Subject: [tip:x86/platform] x86/hyper-v: Implement EOI assist

Commit-ID:  ba696429d290690db967e5f49463df4b2c1314a4
Gitweb:     https://git.kernel.org/tip/ba696429d290690db967e5f49463df4b2c1314a4
Author:     Vitaly Kuznetsov <vkuznets@...hat.com>
AuthorDate: Wed, 3 Apr 2019 19:03:09 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 16 Apr 2019 12:28:23 +0200

x86/hyper-v: Implement EOI assist

Hyper-V TLFS suggests an optimization to avoid imminent VMExit on EOI:
"The OS performs an EOI by atomically writing zero to the EOI Assist field
of the virtual VP assist page and checking whether the "No EOI required"
field was previously zero. If it was, the OS must write to the
HV_X64_APIC_EOI MSR thereby triggering an intercept into the hypervisor."

Implement the optimization in Linux.

Tested-by: Long Li <longli@...rosoft.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: K. Y. Srinivasan <kys@...rosoft.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Michael Kelley (EOSG) <Michael.H.Kelley@...rosoft.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Sasha Levin <sashal@...nel.org>
Cc: Simon Xiao <sixiao@...rosoft.com>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-hyperv@...r.kernel.org
Link: http://lkml.kernel.org/r/20190403170309.4107-1-vkuznets@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/hyperv/hv_apic.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c
index 8eb6fbee8e13..5c056b8aebef 100644
--- a/arch/x86/hyperv/hv_apic.c
+++ b/arch/x86/hyperv/hv_apic.c
@@ -86,6 +86,11 @@ static void hv_apic_write(u32 reg, u32 val)
 
 static void hv_apic_eoi_write(u32 reg, u32 val)
 {
+	struct hv_vp_assist_page *hvp = hv_vp_assist_page[smp_processor_id()];
+
+	if (hvp && (xchg(&hvp->apic_assist, 0) & 0x1))
+		return;
+
 	wrmsr(HV_X64_MSR_EOI, val, 0);
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ