[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4] x86/arm/mm: use gfn instead of pfn in p2m_get_mem_access/p2m_set_mem_access


  • To: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Mon, 29 Jun 2015 19:20:07 +0300
  • Cc: Keir Fraser <keir@xxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Tamas K Lengyel <tlengyel@xxxxxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Mon, 29 Jun 2015 16:20:32 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=hcGwd4T6GEqcduYllJ3urT2OSWUsurS0nv52nMVkVbRkRpmOZpvLXwF+BFN9Gb/wO6dX7LORcvTrzLP7h0BepRYpGIRLh/oLahrOKnZrtnxQm8lTODKXhIyboZawg237yzxS4w4/gSvEmV6cv/eExwK64FKCxKDjwL9+TCqpHiyNRcUz2NYUye85BNvRDFX366gp3j/bAyAejqUj/gWX4rtbYwKPTHzk3/+jUiivURXZWWPz4YoV7w9FKtQ/7OkbQKjEmtE613PhJu92y4w/GgGOMoJv7m7iJu6Dft5fKSi9cWelqlpxpZcRoCD1wAj2haZBFn+5iMl5ugaYAfn1Aw==; h=Received:Received:Received:Received:Received:Subject:To:References:Cc:From:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 06/29/2015 06:45 PM, Vitaly Kuznetsov wrote:
> 'pfn' and 'start_pfn' are ambiguous, both these functions expect GFNs as 
> input.
> 
> On x86 the interface of p2m_set_mem_access() in p2m.c doesn't match the
> declaration in p2m-common.h as 'pfn' is being used instead of 'start_pfn'.
> 
> On ARM both p2m_set_mem_access and p2m_get_mem_access interfaces don't match
> declarations from p2m-common.h: p2m_set_mem_access uses 'pfn' instead of
> 'start_pfn' and p2m_get_mem_access uses 'gpfn' instead of 'pfn'.
> 
> Convert p2m_get_mem_access/p2m_set_mem_access (and __p2m_get_mem_access on 
> ARM)
> interfaces to using gft_t instead of unsigned long and update all users of
> these functions.
> 
> There is also an issue in p2m_get_mem_access on x86: 'gfn' parameter passed to
> gfn_lock/gfn_unlock is not defined. This code compiles only because of a
> coincidence: gfn_lock/gfn_unlock are currently macros which don't use their
> second argument.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
> ---
> Changes since v3:
> - Comment codying style fix [Razvan Cojocaru]
> - Use INVALID_GFN instead of ~0 and -1 [Andrew Cooper]
> - Convert p2m_get_mem_access/p2m_set_mem_access interfaces to using gfn_t
>   [Andrew Cooper]
> 
> Changes since v2:
> - Instead of adding start_ prefix on ARM remove it on x86 [Jan Beulich,
>   Ian Campbell, Razvan Cojocaru]
> 
> Changes since v1:
> - This patch is a successor of '[PATCH] x86/mm: use existing 'pfn' in
>   p2m_get_mem_access', instead of fixing gfn_lock/gfn_unlock arguments we do
>   s/pfn/gfn/g for both p2m_get_mem_access/p2m_set_mem_access [Andrew Cooper,
>   Jan Beulich]
> 
> P.S.
> - The patch was compile-tested on x86 and ARM64.
> ---
>  xen/arch/arm/p2m.c           | 33 +++++++++++++++++----------------
>  xen/arch/x86/mm/p2m.c        | 36 ++++++++++++++++++++----------------
>  xen/common/mem_access.c      |  4 ++--
>  xen/include/xen/p2m-common.h | 13 ++++++-------
>  4 files changed, 45 insertions(+), 41 deletions(-)

Reviewed-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.