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, 12 Jul 2021 18:40:47 +0000
From:   Wei Liu <wei.liu@...nel.org>
To:     Michael Kelley <mikelley@...rosoft.com>
Cc:     sthemmin@...rosoft.com, kys@...rosoft.com, wei.liu@...nel.org,
        decui@...rosoft.com, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, x86@...nel.org, hpa@...or.com, arnd@...db.de,
        linux-kernel@...r.kernel.org, linux-hyperv@...r.kernel.org,
        linux-arch@...r.kernel.org
Subject: Re: [PATCH 1/3] Drivers: hv: Make portions of Hyper-V init code be
 arch neutral

On Mon, Jul 12, 2021 at 06:24:00PM +0000, Wei Liu wrote:
> On Sun, Jul 11, 2021 at 08:25:14PM -0700, Michael Kelley wrote:
> [...]
> > +int hv_common_cpu_init(unsigned int cpu)
> > +{
> > +	void **inputarg, **outputarg;
> > +	u64 msr_vp_index;
> > +	gfp_t flags;
> > +	int pgcount = hv_root_partition ? 2 : 1;
> > +
> > +	/* hv_cpu_init() can be called with IRQs disabled from hv_resume() */
> > +	flags = irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL;
> > +
> > +	inputarg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg);
> > +	*inputarg = kmalloc(pgcount * HV_HYP_PAGE_SIZE, flags);
> 
> This is changed from alloc_pages to kmalloc. Does it ensure the
> alignment is still correct? 

kmalloc is rather complex and can be backed by either SLUB, SLAB or
SLOB, all of which differ from the others.

I _think_ for large allocations (> 1 native page) they tend to pass the
request on to the page allocator, but still there is a level of
indirection.

If the host page size is 64KiB, while the allocation is only 4KiB or
8KiB, could there be a chance that they become misaligned?

Wei.

> 
> Wei.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ