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

RE: [PATCH v4 4/4] xen/mm: Provide dummy M2P-related helpers when !CONFIG_HAVE_M2P


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Lengyel, Tamas" <tamas.lengyel@xxxxxxxxx>
  • Date: Tue, 22 Sep 2020 20:35:51 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IG6KSoNa9sdFpbG6KKueSP5i0QdsSOqs/ZRvs1BM+kc=; b=WX320QF9PXjPQcW5x26OwwhaUNlmB3GaKvNXoe+8yQhshaq4X1E2WMD/LhNONBYf4zneS+wN298HYgq6Bcszl0mkZTUCBIb2nQn3XRRFb05E4Z8gY91KOIHXGzEnLWWJZUMU+4joqFYJKDZhqtZAoL3/NhX5pYW5mYEMxkBbPAdzVjUQkqvQochKQCNAR/hmKfZ5NCY/ZE4KiZzbr5nCdtG/iP7bD5PXrEyTZn1AFK5ER3K3VW+oV8gKkvy4JDiq51dIlnBXpeiQXCzMvXs6bw3VaI2n+TNYXsApsJ6qulpms7mWc6AfUDW87zHkVJOV74+oIzh6c0DrMX0u6sz2qg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ku3y+dY0NSXC+bO47xdvNpp/fjtyiO4A7REj/Gj3ElqF88PDPdngNhskiMXp1xOx1uQJc4q4vHcHPRtFbmITUiBxT+wWQP6u8Odp14wsC8FqhtoDqpN6tyUMgxrYVt5/Z/Lw/t62uiREvAAZ6GSXnNhsX19E3N2elX6MaQaHVQM4dJsWvMsCkD5ISBuYi6a8/DYZmIa5VTaU3NTHLLzwJXmpL/8ds3tR3d2gzsSBvmgM/H0Xx/sTP7J/ZBK8IxzwLVNPdLjVXNho4S80PJBGoF8G+EQt5FbcnmoGLwpw2Mz2kK6nIgQlqH7x3MW7ajwhhpyoZcKoZARh40E2y9fa4g==
  • Authentication-results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=intel.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Julien Grall" <julien.grall@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 22 Sep 2020 20:36:39 +0000
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.5.1.3
  • Ironport-sdr: ko960nfxeG6ftuNI5C+EppNICdttOEwfpVq7rhcZ8I5EivcJln46J4G6pT3Fdz9Mn7B4fJGtHe UL7ZtDaLix0Q==
  • Ironport-sdr: J6IALuIGG1SbzJPyFpwBOXIvgQ5BaoWg8iKP6jYf+zngE1c3MMBVe4dvQwmE0905OubSNqYt/c 9xQtKeCKbbyg==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWkEGpuNLDgmCAl02PgO4dghBJ9al0TQsAgACx4YCAAAWXgIAAGbNw
  • Thread-topic: [PATCH v4 4/4] xen/mm: Provide dummy M2P-related helpers when !CONFIG_HAVE_M2P


> -----Original Message-----
> From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Sent: Tuesday, September 22, 2020 3:00 PM
> To: Julien Grall <julien@xxxxxxx>; Jan Beulich <jbeulich@xxxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; Julien Grall <julien.grall@xxxxxxx>;
> Stefano Stabellini <sstabellini@xxxxxxxxxx>; Volodymyr Babchuk
> <Volodymyr_Babchuk@xxxxxxxx>; George Dunlap
> <george.dunlap@xxxxxxxxxx>; Ian Jackson <iwj@xxxxxxxxxxxxxx>; Wei Liu
> <wl@xxxxxxx>; Lengyel, Tamas <tamas.lengyel@xxxxxxxxx>
> Subject: Re: [PATCH v4 4/4] xen/mm: Provide dummy M2P-related helpers
> when !CONFIG_HAVE_M2P
> 
> On 22/09/2020 19:39, Julien Grall wrote:
> > Hi Jan,
> >
> > On 22/09/2020 09:02, Jan Beulich wrote:
> >> On 21.09.2020 20:02, Julien Grall wrote:
> >>> --- a/xen/include/xen/mm.h
> >>> +++ b/xen/include/xen/mm.h
> >>> @@ -685,4 +685,17 @@ static inline void put_page_alloc_ref(struct
> >>> page_info *page)
> >>>       }
> >>>   }
> >>>   +/*
> >>> + * Dummy implementation of M2P-related helpers for common code
> when
> >>> + * the architecture doesn't have an M2P.
> >>> + */
> >>> +#ifndef CONFIG_HAS_M2P
> >>> +
> >>> +#define INVALID_M2P_ENTRY        (~0UL) #define SHARED_M2P(_e)
> >>> +false
> >>> +
> >>> +static inline void set_gpfn_from_mfn(unsigned long mfn, unsigned
> >>> long pfn) {}
> >>
> >> While I think this would better BUG() or at least
> >> ASSERT_UNREACHABLE(), I realize its use in page_alloc.c prevents
> >> this. However, if this was a macro, I think the need for having
> >> INVALID_P2M_ENTRY would vanish, as long as the stub macro didn't
> evaluate its 2nd argument.
> > This is not very future proof... The cost of defining
> > INVALID_M2P_ENTRY is very minimal compare to the damage that may
> > result from this choice.
> >
> >> I'm feeling somewhat uneasy with the SHARED_M2P() definition: This
> >> would seem to better be tied to CONFIG_MEM_SHARING rather than M2P
> >> existence.
> >
> > I can see pros and cons in both solution. To me it contains the word
> > "M2P" so it makes sense to be protected by HAS_M2P.
> >
> > If someone else think that it should be protected by
> > CONFIG_MEM_SHARING, then I will do the change.
> >
> > I have added Tamas to give him an opportunity to share his view.
> 
> This is clearly guarded by HAS_M2P first first and foremost.
> 
> However, the work to actually let MEM_SHARING be turned off in this regard is
> rather larger, and not appropriate to delay this series with.

I don't see any issue with making CONFIG_MEM_SHARING also depend on 
CONFIG_HAS_M2P, so IMHO it would be enough to put both behind that.

Tamas

 


Rackspace

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