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: <28a9c51f-4d72-9e33-d184-6c7c830260fc@amd.com>
Date:   Thu, 30 Jul 2020 11:34:40 -0500
From:   Babu Moger <babu.moger@....com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        "vkuznets@...hat.com" <vkuznets@...hat.com>,
        "wanpengli@...cent.com" <wanpengli@...cent.com>,
        "sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
        "jmattson@...gle.com" <jmattson@...gle.com>
Cc:     "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "joro@...tes.org" <joro@...tes.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>, "hpa@...or.com" <hpa@...or.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>
Subject: RE: [PATCH v3 01/11] KVM: SVM: Introduce __set_intercept,
 __clr_intercept and __is_intercept



> -----Original Message-----
> From: kvm-owner@...r.kernel.org <kvm-owner@...r.kernel.org> On Behalf
> Of Paolo Bonzini
> Sent: Wednesday, July 29, 2020 6:09 PM
> To: Moger, Babu <Babu.Moger@....com>; vkuznets@...hat.com;
> wanpengli@...cent.com; sean.j.christopherson@...el.com;
> jmattson@...gle.com
> Cc: kvm@...r.kernel.org; joro@...tes.org; x86@...nel.org; linux-
> kernel@...r.kernel.org; mingo@...hat.com; bp@...en8.de; hpa@...or.com;
> tglx@...utronix.de
> Subject: Re: [PATCH v3 01/11] KVM: SVM: Introduce __set_intercept,
> __clr_intercept and __is_intercept
> 
> On 29/07/20 01:37, Babu Moger wrote:
> > This is in preparation for the future intercept vector additions.
> >
> > Add new functions __set_intercept, __clr_intercept and __is_intercept
> > using kernel APIs __set_bit, __clear_bit and test_bit espectively.
> >
> > Signed-off-by: Babu Moger <babu.moger@....com>
> > ---
> >  arch/x86/kvm/svm/svm.h |   15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index
> > 6ac4c00a5d82..3b669718190a 100644
> > --- a/arch/x86/kvm/svm/svm.h
> > +++ b/arch/x86/kvm/svm/svm.h
> > @@ -217,6 +217,21 @@ static inline struct vmcb *get_host_vmcb(struct
> vcpu_svm *svm)
> >  		return svm->vmcb;
> >  }
> >
> > +static inline void __set_intercept(void *addr, int bit) {
> > +	__set_bit(bit, (unsigned long *)addr); }
> > +
> > +static inline void __clr_intercept(void *addr, int bit) {
> > +	__clear_bit(bit, (unsigned long *)addr); }
> > +
> > +static inline bool __is_intercept(void *addr, int bit) {
> > +	return test_bit(bit, (unsigned long *)addr); }
> > +
> 
> Probably worth adding a range check?

Paolo,
Not sure. It is only called with intercept bits like __set_intercept(addr,
INTERCEPT_ xx). All these intercept bits are already accounted for.
Thanks


> 
> >  static inline void set_cr_intercept(struct vcpu_svm *svm, int bit)  {
> >  	struct vmcb *vmcb = get_host_vmcb(svm);
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ