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: <86tvu9jt99.wl-marc.zyngier@arm.com>
Date:   Thu, 22 Feb 2018 08:58:10 +0000
From:   Marc Zyngier <marc.zyngier@....com>
To:     Christoffer Dall <christoffer.dall@...aro.org>
Cc:     Shanker Donthineni <shankerd@...eaurora.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        kvmarm <kvmarm@...ts.cs.columbia.edu>,
        Vikram Sethi <vikrams@...eaurora.org>
Subject: Re: [PATCH] KVM: arm/arm64: No need to zero CNTVOFF in kvm_timer_vcpu_put() for VHE

On Thu, 22 Feb 2018 08:42:31 +0000,
Christoffer Dall wrote:
> 
> Hi Shanker,
> 
> On Mon, Feb 19, 2018 at 09:38:07AM -0600, Shanker Donthineni wrote:
> > In AArch64/AArch32, the virtual counter uses a fixed virtual offset
> > of zero in the following situations as per ARMv8 specifications:
> > 
> > 1) HCR_EL2.E2H is 1, and CNTVCT_EL0/CNTVCT are read from EL2.
> > 2) HCR_EL2.{E2H, TGE} is {1, 1}, and either:
> >    ― CNTVCT_EL0 is read from Non-secure EL0 or EL2.
> >    ― CNTVCT is read from Non-secure EL0.
> > 
> > So, no need to zero CNTVOFF_EL2/CNTVOFF for VHE case.
> > 
> > Signed-off-by: Shanker Donthineni <shankerd@...eaurora.org>
> > ---
> >  virt/kvm/arm/arch_timer.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> > index 70268c0..86eca324 100644
> > --- a/virt/kvm/arm/arch_timer.c
> > +++ b/virt/kvm/arm/arch_timer.c
> > @@ -541,9 +541,11 @@ void kvm_timer_vcpu_put(struct kvm_vcpu *vcpu)
> >  	 * The kernel may decide to run userspace after calling vcpu_put, so
> >  	 * we reset cntvoff to 0 to ensure a consistent read between user
> >  	 * accesses to the virtual counter and kernel access to the physical
> > -	 * counter.
> > +	 * counter of non-VHE case. For VHE, the virtual counter uses a fixed
> > +	 * virtual offset of zero, so no need to zero CNTVOFF_EL2 register.
> >  	 */
> > -	set_cntvoff(0);
> > +	if (!has_vhe())
> > +		set_cntvoff(0);
> >  }
> >  
> >  /*
> 
> I'm okay with this change.  I don't think there's a huge gain here
> though.
> 
> Marc, any thoughts or concerns?

None. I don't think this brings any visible performance gain, but hey,
why not.

Acked-by: Marc Zyngier <marc.zyngier@....com>

	M.

-- 
Jazz is not dead, it just smell funny.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ