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]
Date: Mon, 13 May 2024 13:51:32 -0700
From: Isaku Yamahata <isaku.yamahata@...el.com>
To: Binbin Wu <binbin.wu@...ux.intel.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
	kvm@...r.kernel.org, seanjc@...gle.com, michael.roth@....com,
	isaku.yamahata@...el.com, thomas.lendacky@....com,
	isaku.yamahata@...ux.intel.com
Subject: Re: [PATCH 02/21] KVM: Allow page-sized MMU caches to be initialized
 with custom 64-bit values

On Mon, May 13, 2024 at 01:38:39PM -0700,
Isaku Yamahata <isaku.yamahata@...el.com> wrote:

> > > > index 9c99c9373a3e..c9828feb7a1c 100644
> > > > --- a/virt/kvm/kvm_main.c
> > > > +++ b/virt/kvm/kvm_main.c
> > > > @@ -401,12 +401,17 @@ static void kvm_flush_shadow_all(struct kvm *kvm)
> > > >   static inline void *mmu_memory_cache_alloc_obj(struct
> > > > kvm_mmu_memory_cache *mc,
> > > >                              gfp_t gfp_flags)
> > > >   {
> > > > +    void *page;
> > > > +
> > > >       gfp_flags |= mc->gfp_zero;
> > > >         if (mc->kmem_cache)
> > > >           return kmem_cache_alloc(mc->kmem_cache, gfp_flags);
> > > > -    else
> > > > -        return (void *)__get_free_page(gfp_flags);
> > > > +
> > > > +    page = (void *)__get_free_page(gfp_flags);
> > > > +    if (page && mc->init_value)
> > > > +        memset64(page, mc->init_value, PAGE_SIZE /
> > > > sizeof(mc->init_value));
> > 
> > Do we need a static_assert() to make sure mc->init_value is 64bit?
> 
> That's overkill because EPT entry is defined as 64bit and KVM uses u64 for it
> uniformly.

Oops, I picked the wrong mail to reply. Sorry for noise.
-- 
Isaku Yamahata <isaku.yamahata@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ