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

Re: [PATCH v2 2/5] x86: don't maintain compat M2P when !PV32


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 24 Aug 2020 14:23:51 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 24 Aug 2020 13:24:14 +0000
  • Ironport-sdr: vIBSF2W0c97vwNgvDV+eAmhS4uVFP5ZvskZNQmS08z2k2GaZqcDilo0cOyGTjunWQDW8M6huBm dz/yMxL1LiY0k8mktNKgcXKhUrML0mH3rjtPg7DZoO7QUmnW/Lo1GptMF9qfjbpC2y31BGfnnh YbetVDMZmPFSOlwJVOTRI2SCcbPXSSz1QeXaNyS/iYzTuJ8xLiNkNZH3jsvbI99rXCyNYcmpnT qsXfY5Q8lZGtbVCZL1FQl9vgQ8/AZ42kHorXsh8ZVjRMHNMjUbS5xmLbnbEBikKYjBiIRCYqE3 jHc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/08/2020 13:34, Jan Beulich wrote:
> --- a/xen/arch/x86/x86_64/mm.c
> +++ b/xen/arch/x86/x86_64/mm.c
> @@ -34,17 +34,31 @@ EMIT_FILE;
>  #include <asm/fixmap.h>
>  #include <asm/hypercall.h>
>  #include <asm/msr.h>
> +#include <asm/pv/domain.h>
>  #include <asm/setup.h>
>  #include <asm/numa.h>
>  #include <asm/mem_paging.h>
>  #include <asm/mem_sharing.h>
>  #include <public/memory.h>
>  
> +#ifdef CONFIG_PV32
> +
>  #define compat_machine_to_phys_mapping ((unsigned int 
> *)RDWR_COMPAT_MPT_VIRT_START)
>  
> -unsigned int __read_mostly m2p_compat_vstart = 
> __HYPERVISOR_COMPAT_VIRT_START;
> +unsigned int __initdata m2p_compat_vstart = __HYPERVISOR_COMPAT_VIRT_START;
> +
> +l2_pgentry_t *__read_mostly compat_idle_pg_table_l2;
> +
> +#else /* !CONFIG_PV32 */
> +
> +/*
> + * Declare the symbol such that (dead) code referencing it can be built
> + * without a lot of #ifdef-ary, but mark it fully const and don't define
> + * this symbol anywhere (relying on DCE by the compiler).
> + */
> +extern const unsigned int *const compat_machine_to_phys_mapping;

This has a different indirection.  I know it is for DCE, but it still
ought to match.

I'm also not convinced that asymmetric const is a good idea.  All it
will do is confuse people, because now the "failed to DCE" error will be
a compiler error for writing to a read-only array, not a link time error
like every other instance of failed DCE.

Therefore, it ought to be:

extern unsigned int compat_machine_to_phys_mapping[];

Otherwise, Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

I'm disappointed that HYPERVISOR_COMPAT_VIRT_START() hasn't disappeared,
and instead sprouted a nop wrapper, but I guess it can wait for
subsequent cleanup.

~Andrew



 


Rackspace

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