From: Wei Liu <wei.liu@kernel.org>
To: Michael Kelley <mikelley@microsoft.com>
Cc: Wei Liu <wei.liu@kernel.org>,
Stephen Hemminger <sthemmin@microsoft.com>,
KY Srinivasan <kys@microsoft.com>,
Dexuan Cui <decui@microsoft.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>, "x86@kernel.org" <x86@kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>, "arnd@arndb.de" <arnd@arndb.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: Re: [PATCH 1/3] Drivers: hv: Make portions of Hyper-V init code be arch neutral
Date: Mon, 12 Jul 2021 18:51:07 +0000 [thread overview]
Message-ID: <20210712185107.vgm2qyltftzmfua7@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <MWHPR21MB15930361106EDB7183D3505CD7159@MWHPR21MB1593.namprd21.prod.outlook.com>
On Mon, Jul 12, 2021 at 06:41:21PM +0000, Michael Kelley wrote:
> From: Wei Liu <wei.liu@kernel.org> Sent: Monday, July 12, 2021 11:24 AM
> >
> > 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?
> >
> > Wei.
>
> It does. The alignment guarantee made by kmalloc() was changed a
> couple of years ago. See commit 59bb47985c1d. Here's the current text
> from the comments preceding kmalloc():
>
> * The allocated object address is aligned to at least ARCH_KMALLOC_MINALIGN
> * bytes. For @size of power of two bytes, the alignment is also guaranteed
> * to be at least to the size.
OK. That's good.
Wei.
>
> Michael
>
next prev parent reply other threads:[~2021-07-12 18:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-12 3:25 [PATCH 0/3] Additional refactoring of Hyper-V arch specific code Michael Kelley
2021-07-12 3:25 ` [PATCH 1/3] Drivers: hv: Make portions of Hyper-V init code be arch neutral Michael Kelley
2021-07-12 18:24 ` Wei Liu
2021-07-12 18:40 ` Wei Liu
2021-07-12 18:41 ` Michael Kelley
2021-07-12 18:51 ` Wei Liu [this message]
2021-07-12 3:25 ` [PATCH 2/3] Drivers: hv: Add arch independent default functions for some Hyper-V handlers Michael Kelley
2021-07-12 3:25 ` [PATCH 3/3] Drivers: hv: Move Hyper-V misc functionality to arch-neutral code Michael Kelley
2021-07-14 9:37 ` [PATCH 0/3] Additional refactoring of Hyper-V arch specific code Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210712185107.vgm2qyltftzmfua7@liuwe-devbox-debian-v2 \
--to=wei.liu@kernel.org \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=decui@microsoft.com \
--cc=hpa@zytor.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=mingo@redhat.com \
--cc=sthemmin@microsoft.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).