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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170905190022.1474-4-dave@stgolabs.net>
Date:   Tue,  5 Sep 2017 12:00:19 -0700
From:   Davidlohr Bueso <dave@...olabs.net>
To:     mingo@...hat.com, peterz@...radead.org, pbonzini@...hat.com
Cc:     npiggin@...il.com, paulmck@...ux.vnet.ibm.com, dave@...olabs.net,
        linux-kernel@...r.kernel.org, Davidlohr Bueso <dbueso@...e.de>
Subject: [PATCH 3/6] kvm,lapic: Justify use of swait_activate()

A comment might serve future readers.

Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
---
 arch/x86/kvm/lapic.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 589dcc117086..fb8be28c7093 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1326,6 +1326,12 @@ static void apic_timer_expired(struct kvm_lapic *apic)
 	atomic_inc(&apic->lapic_timer.pending);
 	kvm_set_pending_timer(vcpu);
 
+	/*
+	 * The above kvm_set_pending_timer implies a wmb
+	 * which pairs with the swaiter side. Either way,
+	 * the atomic_inc() is also serialized so using
+	 * swait_active() is safe.
+	 */
 	if (swait_active(q))
 		swake_up(q);
 
-- 
2.12.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ