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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 13 May 2012 19:03:36 +0300
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	Gleb Natapov <gleb@...hat.com>
Cc:	kvm@...r.kernel.org, Rob Landley <rob@...dley.net>,
	Glauber Costa <glommer@...hat.com>,
	Rik van Riel <riel@...hat.com>, Avi Kivity <avi@...hat.com>,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm: eoi msi documentation

On Sun, May 13, 2012 at 06:56:23PM +0300, Gleb Natapov wrote:
> > +	However, hypervisor can set and clear this memory bit at any time:
> > +	therefore to make sure hypervisor does not interrupt the
> > +	guest and clear the least significant bit in the memory area
> > +	in the window between guest testing it to detect
> > +	whether it can skip EOI apic write and between guest
> > +	clearing it to signal EOI to the hypervisor,
> > +	guest must both read the least sgnificant bit in the memory area and
> > +	clear it using a single CPU instruction, such as test and clear, or
> > +	compare and exchange.
> > +
> Looks good, but everything below this is here by mistake.

Ugh. Right. Good catch,

> Are You still
> going to resend host side patch to address my other comment?

Yes, like this.
I'll give more people a chance to review first though.


diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 77e0244..c7e6ffb 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1490,6 +1490,7 @@ int kvm_pv_enable_apic_eoi(struct kvm_vcpu *vcpu, u64 data)
 	if (eoi_enabled(vcpu))
 		eoi_clr_pending(vcpu);
 	vcpu->arch.eoi.msr_val = data;
-	kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.eoi.data, addr);
-	return 0;
+	if (!eoi_enabled(vcpu))
+		return 0;
+	return kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.eoi.data, addr);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ