linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Michael Kelley <mikelley@microsoft.com>
To: Marc Zyngier <maz@kernel.org>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"boqun.feng" <boqun.feng@gmail.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"marcelo.cerri@canonical.com" <marcelo.cerri@canonical.com>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"apw@canonical.com" <apw@canonical.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	vkuznets <vkuznets@redhat.com>, KY Srinivasan <kys@microsoft.com>,
	"will@kernel.org" <will@kernel.org>,
	Sunil Muthuswamy <sunilmut@microsoft.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH v5 3/8] arm64: hyperv: Add memory alloc/free functions for Hyper-V size pages
Date: Fri, 8 Nov 2019 19:00:24 +0000	[thread overview]
Message-ID: <DM5PR21MB0137C1D8C235CE8D6B26E3E4D77B0@DM5PR21MB0137.namprd21.prod.outlook.com> (raw)
In-Reply-To: <43d53ebd2637bd9106137103028a4f0e@www.loen.fr>

From: Marc Zyngier <maz@kernel.org>  Sent: Thursday, November 7, 2019 6:20 AM
> > +/*
> > + * Functions for allocating and freeing memory with size and
> > + * alignment HV_HYP_PAGE_SIZE. These functions are needed because
> > + * the guest page size may not be the same as the Hyper-V page
> > + * size. And while kalloc() could allocate the memory, it does not
> > + * guarantee the required alignment. So a separate small memory
> > + * allocator is needed.  The free function is rarely used, so it
> > + * does not try to combine freed pages into larger chunks.
> 
> Is this still needed now that kmalloc has alignment guarantees
> (see 59bb47985c1d)?
> 

The new kmalloc alignment guarantee is good news, and at least
for now would allow these implementations to collapse to just
kmalloc/kzalloc/kfree calls.  My inclination is to keep the function calls
as wrappers, since ISA neutral Hyper-V drivers are starting to use
them, and future work on memory encryption in virtual environments
may require special handling of pages like these that are shared
between the host and guest.  But they probably can be moved into
the ISA neutral Hyper-V drivers instead of per arch.

Michael
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-11-08 19:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 19:03 [PATCH v5 0/8] Enable Linux guests on Hyper-V on ARM64 Michael Kelley
2019-10-03 19:03 ` [PATCH v5 1/8] arm64: hyperv: Add core Hyper-V include files Michael Kelley
2019-10-03 19:03 ` [PATCH v5 2/8] arm64: hyperv: Add hypercall and register access functions Michael Kelley
2019-11-04  4:36   ` Boqun Feng
2019-11-06  0:40     ` Michael Kelley
2019-11-06 10:19   ` Marc Zyngier
2019-11-06 17:59     ` Michael Kelley
2019-11-07  9:10       ` Marc Zyngier
2019-11-11 17:16         ` Michael Kelley
2019-10-03 19:03 ` [PATCH v5 3/8] arm64: hyperv: Add memory alloc/free functions for Hyper-V size pages Michael Kelley
2019-11-07 14:19   ` Marc Zyngier
2019-11-08 19:00     ` Michael Kelley [this message]
2019-10-03 19:03 ` [PATCH v5 4/8] arm64: hyperv: Add interrupt handlers for VMbus and stimer Michael Kelley
2019-10-03 19:03 ` [PATCH v5 5/8] arm64: hyperv: Add kexec and panic handlers Michael Kelley
2019-10-03 19:03 ` [PATCH v5 6/8] arm64: hyperv: Initialize hypervisor on boot Michael Kelley
2019-10-03 19:03 ` [PATCH v5 7/8] Drivers: hv: vmbus: Add hooks for per-CPU IRQ Michael Kelley
2019-10-03 19:03 ` [PATCH v5 8/8] Drivers: hv: Enable Hyper-V code to be built on ARM64 Michael Kelley

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=DM5PR21MB0137C1D8C235CE8D6B26E3E4D77B0@DM5PR21MB0137.namprd21.prod.outlook.com \
    --to=mikelley@microsoft.com \
    --cc=apw@canonical.com \
    --cc=boqun.feng@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.cerri@canonical.com \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=olaf@aepfle.de \
    --cc=sunilmut@microsoft.com \
    --cc=vkuznets@redhat.com \
    --cc=will@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).