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

Re: [PATCH v1] x86/mm: avoid inadvertently degrading a TLB flush to local only


  • To: David Vrabel <dvrabel@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 20 Apr 2022 08:34:21 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MWFDDgg8Nbqzjp77dd7JQVOZiKBHZONaRwwGPMrVjrg=; b=a8q6rZSqHJwF7lxhbafe41OaOh+dw6iJt+TudD1tYY7xBw335o59xbJDQLuzEubJ2mfv7aGttSpXqYqnS0IAX8uKa5eDPYCuU91uCKr1LZvhp3niPFKfPfJQgsAow32cfjIwHXWx0cwgL01p3YriqEdrzI6psMVFhOlQvRZrDOrG2OFc/EejFDRPoZpgjd6oMvc38iZ9p/q/ay/RPvYK69Q0nZiRkJajuOm+1+SSygjj2zVi9j48y0AtbHWMoYwPb6oVB0xjQmB56WjiAIY7VfUYuSjuCak1KO2JIKBt0cCg37vNwxBDgDH+6uiCMeKjS9D+Znu/p6THLpfJ4sGiog==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q5/MWbeK6TRJSMFnPjAE8QyR4iwHyitTOKNAYAOSudOyybkfsF6w4bv4r0tunM6RK/23RUGPo3dOb8GzhB4m1wOnJhTrRVFbx87ZNktwap+xHQvVTspaJLyFT1V4PxsNu0e1yCvHfvQ42yQAmWZD700yeZSmfnswhA9MsfOcxMg3FNfQP4A1f0J3xYLr5/i3Uu4H/V1vDafJgrflRKiCfCuL9KAqFNpH6c7ax8oEaiRMGlSepcCfQ2259rPJwHdLi2cDAem6C9LZXNzJxXeezDOurx5usLcvYzN7Kz0ZYw+BcZiQgyUbvrshScxHkRuPlzvHTu+cpQxF+srI9LiI/A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, David Vrabel <dvrabel@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 20 Apr 2022 06:34:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.04.2022 17:03, David Vrabel wrote:
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -5071,11 +5071,10 @@ l1_pgentry_t *virt_to_xen_l1e(unsigned long v)
>  #define lNf_to_l1f(f) (((f) & _PAGE_PRESENT) ? ((f) & ~_PAGE_PSE) : (f))
>  
>  /*
> - * map_pages_to_xen() can be called with interrupts disabled during
> - * early bootstrap. In this case it is safe to use flush_area_local()
> - * and avoid locking because only the local CPU is online.
> + * map_pages_to_xen() can be called early in boot before any other
> + * CPUs are online. Use flush_area_local() in this case.
>   */
> -#define flush_area(v,f) (!local_irq_is_enabled() ?              \
> +#define flush_area(v,f) (system_state < SYS_STATE_smp_boot ?    \
>                           flush_area_local((const void *)v, f) : \
>                           flush_area_all((const void *)v, f))
>  

I agree with the change, but I wonder whether it wouldn't better be
accompanied by an assertion proving that IRQs are enabled. But wait -
flush_area_mask() has such an assertion, so all is fine.

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan




 


Rackspace

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