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

Re: [PATCH v2 5/7] x86/hvm: Use __initdata_cf_clobber for hvm_funcs


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Feb 2022 14:10:51 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=jBhE8pdS0z6X5OGHjjYTQ2s9u5suaBp+9zliY5yvTy8=; b=Ubpky9QnI+z2AhfEoIYdKvx8cLx+pp23gsAvQ5cnZdjHaBMnZ31OBUkiWyivixkpn+DCef/GfPlPt7hAy8VrQQn9nXGlSO921hYTA5TH8qQIMpPGv1Jw8RkIOADfoCwkXbwOuzTs0Axpw/SeG4azFWkCyFpijh7pIxg0ttGxISdc8GUfbYevT0HgKyVW7yvW5jcuYSoaSLlZLgPcJZTQwZu6rNmjMZUu1AY0C0X48fE4RDVrOYIV9BgaRunKX0cpqeWR5lq27n+5qjpIHTQLb/ykuwtEE96BHVH1v/9bz82AT4lU4H4JaBMJs2POVoeOcjQKEaunHpEEM0irtCcUTw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hBRdkQOrxhH1JhAs1g1LZ0k0AkAbMWWODznuk03LVg2rFqkFfG7LqsRxIXyKwvdcgDl3A9INaq6BPvLZn+ZJh3HEALlCZtr6Y6v6Sg8+p3TC5veCnBKbBh3zMQQxRDdIk7VwSTQlW8vVyg404pr8CEf26+NJYvj+744xBjGN9rQ2TX8C9cg3RUfnGoJMAo4zIjqk1NBR4Ezg4UkDWSO704T0O8DsErwKtS68jCAqLk7hg6nbgbiPselj+Kry0RRw5CO+8cCkjQlZRsaUCRAeTtq7D7PoKfY61VuEzlW0qTkgVP+TlFFDPsZw//+7iDyGOd0bBp6Mvxfh6T/MVVtBeA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 14 Feb 2022 13:11:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.02.2022 13:56, Andrew Cooper wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -88,7 +88,7 @@ unsigned int opt_hvm_debug_level __read_mostly;
>  integer_param("hvm_debug", opt_hvm_debug_level);
>  #endif
>  
> -struct hvm_function_table hvm_funcs __read_mostly;
> +struct hvm_function_table __ro_after_init hvm_funcs;

Strictly speaking this is an unrelated change. I'm fine with it living here,
but half a sentence would be nice in the description.

> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -2513,7 +2513,7 @@ static void cf_check svm_set_reg(struct vcpu *v, 
> unsigned int reg, uint64_t val)
>      }
>  }
>  
> -static struct hvm_function_table __initdata svm_function_table = {
> +static struct hvm_function_table __initdata_cf_clobber svm_function_table = {
>      .name                 = "SVM",
>      .cpu_up_prepare       = svm_cpu_up_prepare,
>      .cpu_dead             = svm_cpu_dead,
> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> index 41db538a9e3d..758df3321884 100644
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2473,7 +2473,7 @@ static void cf_check vmx_set_reg(struct vcpu *v, 
> unsigned int reg, uint64_t val)
>      vmx_vmcs_exit(v);
>  }
>  
> -static struct hvm_function_table __initdata vmx_function_table = {
> +static struct hvm_function_table __initdata_cf_clobber vmx_function_table = {
>      .name                 = "VMX",
>      .cpu_up_prepare       = vmx_cpu_up_prepare,
>      .cpu_dead             = vmx_cpu_dead,

While I'd like to re-raise my concern regarding the non-pointer fields
in these structure instances (just consider a sequence of enough bool
bitfields, which effectively can express any value, including ones
which would appear like pointers into .text), since for now all is okay
afaict:
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®.