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

Re: [PATCH v2 09/12] x86: make mem-paging configuarable and default it to off for being unsupported


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 30 Apr 2021 16:37:54 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=hPP+gb/1JdksoVtDSzODY1lG/SGpk1N4fr0iVoKhuTo=; b=EkbuKv5ZKhA0eQ3nhYyzknWcoCzqH3hf5MqDYA0ut3J05/Z0GnpSroVOq2b5ghjOyOMbr2ukcWXmv7wPG0NcFV3TDkMUjmujnAp6r101On1FYIdoggtUmF7WzxY2qaOo2dR+V7s85yOIqbZzkFFQIDjiCHS5menBoSHr1JaOyhJ8+2UaIVzWKQCZ+1Z6BUfZled1pkC63trRMlRe2d8Q71zv4lQCYPJ+6aIsXXNACDuZ0BvTj+K99DGxo0QgKoxnFW8ejEKUSzglggY+zz66NKaHB6ZgNNPL/K7nUJPzuM4Rwzv56Gid7wMmeN977R2ArhzcoiqsbB4pcvSD48DKsg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=deYF4Eaf7INnwssLOGd4H/HU7w6kew0cERyr98QuzpKf8XrPCGaQ99SDaG4z5D0Ki/aF4aumrjedaxRBx2VOcdNZDJnfh3wVwYmW+/eeiwVfW5tXhaE543BH49K4MfGCDhHa+jrhyjehFXDLt/ZbxOmEJyQjyunpGgvPm5crzH9Mj5ab4OyKZGm7bBRHLk5ppThnE5Y6rVGOxY/8qSDxAaLDIwjaSRUz3n059jfAJ1JV7reyks4UZ1Lxl9PMukZbChaaGjkyEMLmxOWatxAuKBA78/9mWUr4AfKN5IKYjJ0eWkbT9yFyejTjmoWo/i/7+apxFFUQhAutN89DO6twXA==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Daniel de Graaf <dgdegra@xxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 30 Apr 2021 14:38:06 +0000
  • Ironport-hdrordr: A9a23:Eg2XSqlg35eD1lGuiy34J7lQ0CjpDfP2imdD5ilNYBxZY6Wkvu izgfUW0gL1gj4NWHcm3euNIrWEXGm0z/NIyKMWOqqvWxSjhXuwIOhZnO7f6hDDOwm7zO5S0q 98b7NzYeebMXFWhdv3iTPWL/8O29+CmZrHuc7771NACT5ncLth6QARMHf4LmRTSBNdDZQ0UL qwj/AmmxOadX4abtu2CxA+NoCum/TxmI/7ehlDPhY76WC15g+A0qLwEBSTw34lIlBy6IolmF KlryXJop+Nntv+4R/a2m/V4f1t6aHc4+oGPuOgoIw4Lj3tjyyheYhuXaaT1QpF3d2H2RIRv/ Tn5zsmIsRv+1PdF1vF3SfF6k3b/xsFr1/k1FOCjnPoraXCNU0HIvsEv611WF/9ySMbzbVB+Z MO5U21nd5rKCmFuyLH693BR3hR5zKJiEtnq8E/pThiS4cEAYUhyrA3zQduP7orOjn104wjGP kGNrCm2N9mNWmXaH3UpQBUsbqRd0V2Gh+HR34LsdCO3w5Xm2hkz1AZyNZ3pAZ4yK4A
  • Ironport-sdr: R9gneq8lKNy0l7lNl0mh34aqSZzE9ySzc9OjuLeaDbxQPH2WOSFkTICwOIYk6hv5wUkFmfK6fJ QHeJBVB06WukVyFMKdJj5Jx9HdVOIdECoG7VrC/kfBLgfcDnT6YR7rGFbDQm/npun5scd0jnlE PM6wXzud6KNmBb1OQcQ8xWnLu9snehEnc0aFbO1ssQQWJSkO2z5tDjr903aK1AbUuUG5y+/4Px WvKwkYaP9jsIlwk8orhs9eEBa+6xUhQkMtROetUlaKHV6wz36MccVFFFt80BDwPNesIOakvSch ir4=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Apr 30, 2021 at 04:16:24PM +0200, Jan Beulich wrote:
> On 30.04.2021 11:55, Roger Pau Monné wrote:
> > On Mon, Apr 12, 2021 at 04:12:41PM +0200, Jan Beulich wrote:
> >> --- a/xen/arch/x86/x86_64/compat/mm.c
> >> +++ b/xen/arch/x86/x86_64/compat/mm.c
> >> @@ -155,8 +155,10 @@ int compat_arch_memory_op(unsigned long
> >>      case XENMEM_get_sharing_shared_pages:
> >>          return mem_sharing_get_nr_shared_mfns();
> >>  
> >> +#ifdef CONFIG_MEM_PAGING
> >>      case XENMEM_paging_op:
> >>          return mem_paging_memop(guest_handle_cast(arg, 
> >> xen_mem_paging_op_t));
> >> +#endif
> >>  
> >>  #ifdef CONFIG_MEM_SHARING
> >>      case XENMEM_sharing_op:
> >> --- a/xen/arch/x86/x86_64/mm.c
> >> +++ b/xen/arch/x86/x86_64/mm.c
> >> @@ -994,8 +994,10 @@ long subarch_memory_op(unsigned long cmd
> >>      case XENMEM_get_sharing_shared_pages:
> >>          return mem_sharing_get_nr_shared_mfns();
> >>  
> >> +#ifdef CONFIG_MEM_PAGING
> >>      case XENMEM_paging_op:
> >>          return mem_paging_memop(guest_handle_cast(arg, 
> >> xen_mem_paging_op_t));
> >> +#endif
> > 
> > I would create a dummy handler when !CONFIG_MEM_PAGING in
> > asm-x86/mem_paging.h.
> 
> I was simply following the neighboring mem-sharing approach,
> which you've stripped here, but which is still visible in the
> xen/arch/x86/x86_64/compat/mm.c change above. I think the two
> are helpful to be similar in such aspects.
> 
> >> --- a/xen/include/asm-x86/p2m.h
> >> +++ b/xen/include/asm-x86/p2m.h
> >> @@ -136,11 +136,16 @@ typedef unsigned int p2m_query_t;
> >>  #define P2M_PAGEABLE_TYPES (p2m_to_mask(p2m_ram_rw) \
> >>                              | p2m_to_mask(p2m_ram_logdirty) )
> >>  
> >> +#ifdef CONFIG_MEM_PAGING
> >>  #define P2M_PAGING_TYPES (p2m_to_mask(p2m_ram_paging_out)        \
> >>                            | p2m_to_mask(p2m_ram_paged)           \
> >>                            | p2m_to_mask(p2m_ram_paging_in))
> >>  
> >>  #define P2M_PAGED_TYPES (p2m_to_mask(p2m_ram_paged))
> >> +#else
> >> +#define P2M_PAGING_TYPES 0
> >> +#define P2M_PAGED_TYPES 0
> >> +#endif
> > 
> > Since you don't guard the p2m related paged types in p2m_type_t is it
> > worth having diverging P2M_{PAGING/PAGED}_TYPES?
> > 
> > I guess it might be required in order to force the compiler to DCE
> > without having to add yet more CONFIG_MEM_PAGING guards?
> 
> Indeed, this is the reason.
> 
> > I don't really have a strong opinion on whether the code should be
> > removed, IMO it's best to start by making it off by default at build
> > time and remove it in a later release?
> 
> Matches my way of thinking. I also wouldn't want to be the one to
> delete code completely out of the blue.

Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.



 


Rackspace

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