[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: Jan Beulich <jbeulich@xxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Mon, 14 Feb 2022 13:35:23 +0000
- Accept-language: en-GB, en-US
- 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=oNwQtLuu98X4SQwPPIlMBgTUYnA+4NuDfMaIFjB1k3k=; b=Xa/qOlG0fVs7PO8BXySs/nTndbmM2JaGPOzWepQoDGAzeBBSIhDPRQziPeK5+zcIo6WjJNBNdIbzzFo366YW+F8sAWAlkO9KSkZQTAD81VPpfiA8u9KzQHSHVR4ggpJmOGGzoZcOVR6yro01Ou1dSG66jbXarqOioTchJKOVNU6nCRn9HOHvYkjiPQUIPXL/a5DvBEVXuBRUQkDsiWwHAQA33Cdc7Gcgtp4RsJbseLXZRo3zJCxbNUCCUTNu4CgP1ggI/xT5/V5O9IVRNwvRex3XzKc3cVH/6zFi3ngslSTZACJfasE514YP7lO02dFNnpqBYVS1Z+pw1a8gE5YdFA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C6TIlZenqg5KawbFShSAiukHuzygQYqESB0Z2bFj0X6HSH6Rm9FlVwJsyR0n++i70Ob4xea2CD79MtA0gRL8s3vD/llM7ad+Umsc1lt4boqWL9N6076RmkgrKz5sO3CGtyxhhaVbVb046fRO13BZy4uebh4v+IrmEgcA+SI0Zn/Ba8+09ZBfZxgs5cBpm0GzgggMnxStxVMpSlvObmiEOSkklKA5FcAEYAOdnoS5noF0EgZwVWAoRK7GoauwPteFa8M2r89BoBoFOap0+YFvEW3KHmfN2Be26YnDodjAM5nLcf7Rbpje/WHQA07QWYUojEawcKOUbNWsPfG/JMOulg==
- Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 14 Feb 2022 13:35:35 +0000
- Ironport-data: A9a23:HCGzc6mYkTY7zlpUF1aimnno5gxUIURdPkR7XQ2eYbSJt1+Wr1Gzt xIaXWuCP/mNN2bxetsiOoWxoEsB75CGxtRmT1RvrHszQSMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BClVlxJVF/fngqoDUUYYoAQgsA180IMsdoUg7wbRh2Nc02YLR7z6l4 rseneWOYDdJ5BYsWo4kw/rrRMRH5amaVJsw5zTSVNgT1LPsvyB94KE3fMldG0DQUIhMdtNWc s6YpF2PEsE1yD92Yj+tuu6TnkTn2dc+NyDW4pZdc/DKbhSvOkXee0v0XRYRQR4/ttmHozx+4 IRtsKOfY14PB5L3gtQdXh9fSwxvI4QTrdcrIVDn2SCS50jPcn+qyPRyFkAme4Yf/46bA0kXq 6ZecmpUKEne2aTmm9pXScE17ignBODtMJkSpTdLyjbBAOx9aZvCX7/L9ZlT2zJYasVmQ62DN pZINmcHgBLoTV4SIEceUJAE2+b1nHftVTF49XOZqv9ii4TU5FMoi+W8WDbPQfSaSMMQkkuGq 2bu+2XiHgpcJNGZ0SCC8H+nmqnIhyyTcJ0WPK218LhtmlL77m4ZBQASVFC7ieKkkUP4UNVaQ 3H44QJ38/J0rhbyCICgAVvo+xZooyLwRfIBM+gFxyvU7JPr2BypBmUCSWZsecIP4ZpeqSMR6 neFmNbgBDpKubKTSG6A+rr8kQ5eKRT5PkdZO3ZaEFJtD83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OpBzZZmkmzSkruOCXTc2QzocrCWehzKh77D3VzKC2A0Fbj9JybA+tU DYjg3Q/MyYwrOG4y6Z81WWw4VdmdPnxNcGLteLkNIpJjLljRvtTJh9WoeFoCs+rIiUmRMXeZ j30lMd1vZImjXsl1KO0ELQMs7boW4TAkrZuBilaL3Y0JfErXwBepB8bMliA2XkAgIbzaBBOe Rwrj6kXtNsfGD9dG6W3am5azh60kWzunYsiugVkjhWVpYfcqZYqcgF8FpSC4poJlO21GkLKp gkMCjn3ocdTbpaVQGvgkB/hNi3GngjFBaPRUYP/sSTzjhNhXh8i08V3tYWkHsM/I80D8As3Z WKDo140LVVCsMGZ6N0A+kMBcOxF2zWWBrJdGafO07uGq0LM2/E75T3/LI27ue3f4Fg9up/pL 3RFFdD8WIicUPnDsODmJVN7xDWWW24GS/gz8lPjqIJ8oEUhICbeBFrZGpe5vdIks9vdPEzAc zDSq6+K8WTWVfTJQ==
- Ironport-sdr: 4NFVUWzNbz1zl9wW0Cva4tIfHZqNhw5wHJG/jMORtFexvPxs2swAUCLT6xMGh1FhNt9HsNSaSt 6CkAn6GG+4/JIM+2S64MS3ast4QCAj/MdoGZxQzXyjswE3QJQAdm869TCMjyzDsBO6DsMUTh1F CsOZ9X2KpV1T8RlwxeumHI6i1FPHRY4h+ywVVbmxNWYAJttLfMVkd03rsyS0BWgORApg7fUtGI DoXVRw6P/pVS2Dezh+ZUQuh8kWpFt+FqH3Ppw33wYxMZ0Dgh0NvQ+EeDkyhS5cwLO6M8OE+Sri KePF641MjcYRI5DXKoMmI4XL
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHYIaJjsOAx5ctsj06lom2YGua3HKyTBU+AgAAG24A=
- Thread-topic: [PATCH v2 5/7] x86/hvm: Use __initdata_cf_clobber for hvm_funcs
On 14/02/2022 13:10, Jan Beulich wrote:
> 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.
I could split it out, but we could probably make 200 patches of
"sprinkle some __ro_after_init around, now that it exists".
>
>> --- 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>
I should probably put something in the commit message too. It is a
theoretical risk, but not (IMO) a practical one.
~Andrew
|