diff mbox series

[v7,4/5] x86/paravirt: Remove const mark from x86_hyper_xen_hvm variable

Message ID 1562846532-32152-5-git-send-email-zhenzhong.duan@oracle.com (mailing list archive)
State New, archived
Headers show
Series misc fixes to PV extensions code | expand

Commit Message

Zhenzhong Duan July 11, 2019, 12:02 p.m. UTC
.. as "nopv" support needs it to be changeable at boot up stage.

Checkpatch report warning, so move variable declarations from
hypervisor.c to hypervisor.h

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
---
 arch/x86/include/asm/hypervisor.h | 8 ++++++++
 arch/x86/kernel/cpu/hypervisor.c  | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

Jürgen Groß July 16, 2019, 10:57 a.m. UTC | #1
On 11.07.19 14:02, Zhenzhong Duan wrote:
> .. as "nopv" support needs it to be changeable at boot up stage.
> 
> Checkpatch report warning, so move variable declarations from
> hypervisor.c to hypervisor.h
> 
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> ---
>   arch/x86/include/asm/hypervisor.h | 8 ++++++++
>   arch/x86/kernel/cpu/hypervisor.c  | 8 --------
>   2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
> index f7b4c53..e41cbf2 100644
> --- a/arch/x86/include/asm/hypervisor.h
> +++ b/arch/x86/include/asm/hypervisor.h
> @@ -58,6 +58,14 @@ struct hypervisor_x86 {
>   	bool ignore_nopv;
>   };
>   
> +extern const struct hypervisor_x86 x86_hyper_vmware;
> +extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
> +extern const struct hypervisor_x86 x86_hyper_xen_pv;
> +extern const struct hypervisor_x86 x86_hyper_kvm;
> +extern const struct hypervisor_x86 x86_hyper_jailhouse;
> +extern const struct hypervisor_x86 x86_hyper_acrn;
> +extern struct hypervisor_x86 x86_hyper_xen_hvm;

This should either stay const and be changed in patch 5, or you
should adapt its definition in arch/x86/xen/enlighten_hvm.c in
this patch.


Juergen
Zhenzhong Duan July 17, 2019, 2:09 a.m. UTC | #2
On 2019/7/16 18:57, Juergen Gross wrote:
> On 11.07.19 14:02, Zhenzhong Duan wrote:
>> .. as "nopv" support needs it to be changeable at boot up stage.
>>
>> Checkpatch report warning, so move variable declarations from
>> hypervisor.c to hypervisor.h
>>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Stefano Stabellini <sstabellini@kernel.org>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Borislav Petkov <bp@alien8.de>
>> ---
>>   arch/x86/include/asm/hypervisor.h | 8 ++++++++
>>   arch/x86/kernel/cpu/hypervisor.c  | 8 --------
>>   2 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/hypervisor.h 
>> b/arch/x86/include/asm/hypervisor.h
>> index f7b4c53..e41cbf2 100644
>> --- a/arch/x86/include/asm/hypervisor.h
>> +++ b/arch/x86/include/asm/hypervisor.h
>> @@ -58,6 +58,14 @@ struct hypervisor_x86 {
>>       bool ignore_nopv;
>>   };
>>   +extern const struct hypervisor_x86 x86_hyper_vmware;
>> +extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
>> +extern const struct hypervisor_x86 x86_hyper_xen_pv;
>> +extern const struct hypervisor_x86 x86_hyper_kvm;
>> +extern const struct hypervisor_x86 x86_hyper_jailhouse;
>> +extern const struct hypervisor_x86 x86_hyper_acrn;
>> +extern struct hypervisor_x86 x86_hyper_xen_hvm;
>
> This should either stay const and be changed in patch 5, or you
> should adapt its definition in arch/x86/xen/enlighten_hvm.c in
> this patch.

Ok, thanks for your suggestion.

I'll choose 2nd opinion as I don't need to change descripton with that.

Zhenzhong
Jürgen Groß July 17, 2019, 3:34 a.m. UTC | #3
On 17.07.19 04:09, Zhenzhong Duan wrote:
> 
> On 2019/7/16 18:57, Juergen Gross wrote:
>> On 11.07.19 14:02, Zhenzhong Duan wrote:
>>> .. as "nopv" support needs it to be changeable at boot up stage.
>>>
>>> Checkpatch report warning, so move variable declarations from
>>> hypervisor.c to hypervisor.h
>>>
>>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
>>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>> Cc: Juergen Gross <jgross@suse.com>
>>> Cc: Stefano Stabellini <sstabellini@kernel.org>
>>> Cc: Thomas Gleixner <tglx@linutronix.de>
>>> Cc: Ingo Molnar <mingo@redhat.com>
>>> Cc: Borislav Petkov <bp@alien8.de>
>>> ---
>>>   arch/x86/include/asm/hypervisor.h | 8 ++++++++
>>>   arch/x86/kernel/cpu/hypervisor.c  | 8 --------
>>>   2 files changed, 8 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/arch/x86/include/asm/hypervisor.h 
>>> b/arch/x86/include/asm/hypervisor.h
>>> index f7b4c53..e41cbf2 100644
>>> --- a/arch/x86/include/asm/hypervisor.h
>>> +++ b/arch/x86/include/asm/hypervisor.h
>>> @@ -58,6 +58,14 @@ struct hypervisor_x86 {
>>>       bool ignore_nopv;
>>>   };
>>>   +extern const struct hypervisor_x86 x86_hyper_vmware;
>>> +extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
>>> +extern const struct hypervisor_x86 x86_hyper_xen_pv;
>>> +extern const struct hypervisor_x86 x86_hyper_kvm;
>>> +extern const struct hypervisor_x86 x86_hyper_jailhouse;
>>> +extern const struct hypervisor_x86 x86_hyper_acrn;
>>> +extern struct hypervisor_x86 x86_hyper_xen_hvm;
>>
>> This should either stay const and be changed in patch 5, or you
>> should adapt its definition in arch/x86/xen/enlighten_hvm.c in
>> this patch.
> 
> Ok, thanks for your suggestion.
> 
> I'll choose 2nd opinion as I don't need to change descripton with that.

Just resend the last two modified patches then, please.


Juergen
diff mbox series

Patch

diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index f7b4c53..e41cbf2 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -58,6 +58,14 @@  struct hypervisor_x86 {
 	bool ignore_nopv;
 };
 
+extern const struct hypervisor_x86 x86_hyper_vmware;
+extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
+extern const struct hypervisor_x86 x86_hyper_xen_pv;
+extern const struct hypervisor_x86 x86_hyper_kvm;
+extern const struct hypervisor_x86 x86_hyper_jailhouse;
+extern const struct hypervisor_x86 x86_hyper_acrn;
+extern struct hypervisor_x86 x86_hyper_xen_hvm;
+
 extern bool nopv;
 extern enum x86_hypervisor_type x86_hyper_type;
 extern void init_hypervisor_platform(void);
diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
index 7eaad41..553bfbf 100644
--- a/arch/x86/kernel/cpu/hypervisor.c
+++ b/arch/x86/kernel/cpu/hypervisor.c
@@ -26,14 +26,6 @@ 
 #include <asm/processor.h>
 #include <asm/hypervisor.h>
 
-extern const struct hypervisor_x86 x86_hyper_vmware;
-extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
-extern const struct hypervisor_x86 x86_hyper_xen_pv;
-extern const struct hypervisor_x86 x86_hyper_xen_hvm;
-extern const struct hypervisor_x86 x86_hyper_kvm;
-extern const struct hypervisor_x86 x86_hyper_jailhouse;
-extern const struct hypervisor_x86 x86_hyper_acrn;
-
 static const __initconst struct hypervisor_x86 * const hypervisors[] =
 {
 #ifdef CONFIG_XEN_PV