2019-07-02 02:18:16

by Zhenzhong Duan

[permalink] [raw]
Subject: [PATCH v3 3/4] Revert "xen: Introduce 'xen_nopv' to disable PV extensions for HVM guests."

This reverts commit 8d693b911bb9c57009c24cb1772d205b84c7985c.

Instead we use an unified parameter 'nopv' for all the hypervisor
platforms.

Signed-off-by: Zhenzhong Duan <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Cc: Boris Ostrovsky <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
---
Documentation/admin-guide/kernel-parameters.txt | 4 ----
arch/x86/xen/enlighten_hvm.c | 12 +-----------
2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 21e08af..d5c3dcc 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -5251,10 +5251,6 @@
Disables the ticketlock slowpath using Xen PV
optimizations.

- xen_nopv [X86]
- Disables the PV optimizations forcing the HVM guest to
- run as generic HVM guest with no PV drivers.
-
xen_scrub_pages= [XEN]
Boolean option to control scrubbing pages before giving them back
to Xen, for use by other domains. Can be also changed at runtime
diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c
index ac4943c..7fcb4ea 100644
--- a/arch/x86/xen/enlighten_hvm.c
+++ b/arch/x86/xen/enlighten_hvm.c
@@ -210,18 +210,8 @@ static void __init xen_hvm_guest_init(void)
#endif
}

-static bool xen_nopv;
-static __init int xen_parse_nopv(char *arg)
-{
- xen_nopv = true;
- return 0;
-}
-early_param("xen_nopv", xen_parse_nopv);
-
bool __init xen_hvm_need_lapic(void)
{
- if (xen_nopv)
- return false;
if (xen_pv_domain())
return false;
if (!xen_hvm_domain())
@@ -233,7 +223,7 @@ bool __init xen_hvm_need_lapic(void)

static uint32_t __init xen_platform_hvm(void)
{
- if (xen_pv_domain() || xen_nopv)
+ if (xen_pv_domain())
return 0;

return xen_cpuid_base();
--
1.8.3.1


2019-07-02 03:50:44

by Boris Ostrovsky

[permalink] [raw]
Subject: Re: [PATCH v3 3/4] Revert "xen: Introduce 'xen_nopv' to disable PV extensions for HVM guests."

On Mon, Jul 01, 2019 at 10:20:27AM +0800, Zhenzhong Duan wrote:
> This reverts commit 8d693b911bb9c57009c24cb1772d205b84c7985c.
>
> Instead we use an unified parameter 'nopv' for all the hypervisor
> platforms.
>
> Signed-off-by: Zhenzhong Duan <[email protected]>
> Reviewed-by: Juergen Gross <[email protected]>
> Cc: Boris Ostrovsky <[email protected]>
> Cc: Juergen Gross <[email protected]>
> Cc: Stefano Stabellini <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> ---
> Documentation/admin-guide/kernel-parameters.txt | 4 ----
> arch/x86/xen/enlighten_hvm.c | 12 +-----------
> 2 files changed, 1 insertion(+), 15 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 21e08af..d5c3dcc 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -5251,10 +5251,6 @@
> Disables the ticketlock slowpath using Xen PV
> optimizations.
>
> - xen_nopv [X86]
> - Disables the PV optimizations forcing the HVM guest to
> - run as generic HVM guest with no PV drivers.
> -


So someone upgrades the kernel and suddenly things work differently?

At least there should be a warning that the option has been replaced
with 'nopv' (but I would actually keep this option working as well).

-boris



> xen_scrub_pages= [XEN]
> Boolean option to control scrubbing pages before giving them back
> to Xen, for use by other domains. Can be also changed at runtime
> diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c
> index ac4943c..7fcb4ea 100644
> --- a/arch/x86/xen/enlighten_hvm.c
> +++ b/arch/x86/xen/enlighten_hvm.c
> @@ -210,18 +210,8 @@ static void __init xen_hvm_guest_init(void)
> #endif
> }
>
> -static bool xen_nopv;
> -static __init int xen_parse_nopv(char *arg)
> -{
> - xen_nopv = true;
> - return 0;
> -}
> -early_param("xen_nopv", xen_parse_nopv);
> -
> bool __init xen_hvm_need_lapic(void)
> {
> - if (xen_nopv)
> - return false;
> if (xen_pv_domain())
> return false;
> if (!xen_hvm_domain())
> @@ -233,7 +223,7 @@ bool __init xen_hvm_need_lapic(void)
>
> static uint32_t __init xen_platform_hvm(void)
> {
> - if (xen_pv_domain() || xen_nopv)
> + if (xen_pv_domain())
> return 0;
>
> return xen_cpuid_base();
> --
> 1.8.3.1
>

2019-07-02 04:40:38

by Zhenzhong Duan

[permalink] [raw]
Subject: Re: [PATCH v3 3/4] Revert "xen: Introduce 'xen_nopv' to disable PV extensions for HVM guests."


On 2019/7/2 11:48, Boris Ostrovsky wrote:
> On Mon, Jul 01, 2019 at 10:20:27AM +0800, Zhenzhong Duan wrote:
>> This reverts commit 8d693b911bb9c57009c24cb1772d205b84c7985c.
>>
>> Instead we use an unified parameter 'nopv' for all the hypervisor
>> platforms.
>>
>> Signed-off-by: Zhenzhong Duan<[email protected]>
>> Reviewed-by: Juergen Gross<[email protected]>
>> Cc: Boris Ostrovsky<[email protected]>
>> Cc: Juergen Gross<[email protected]>
>> Cc: Stefano Stabellini<[email protected]>
>> Cc: Thomas Gleixner<[email protected]>
>> Cc: Ingo Molnar<[email protected]>
>> Cc: Borislav Petkov<[email protected]>
>> ---
>> Documentation/admin-guide/kernel-parameters.txt | 4 ----
>> arch/x86/xen/enlighten_hvm.c | 12 +-----------
>> 2 files changed, 1 insertion(+), 15 deletions(-)
>>
>> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
>> index 21e08af..d5c3dcc 100644
>> --- a/Documentation/admin-guide/kernel-parameters.txt
>> +++ b/Documentation/admin-guide/kernel-parameters.txt
>> @@ -5251,10 +5251,6 @@
>> Disables the ticketlock slowpath using Xen PV
>> optimizations.
>>
>> - xen_nopv [X86]
>> - Disables the PV optimizations forcing the HVM guest to
>> - run as generic HVM guest with no PV drivers.
>> -
> So someone upgrades the kernel and suddenly things work differently?
>
> At least there should be a warning that the option has been replaced
> with 'nopv' (but I would actually keep this option working as well).

OK, I'll add new patch to map xen_nopv to nopv. So if 'xen_nopv' is
used, we go

to the path for 'nopv'. I will be same effect.

Thanks

Zhenzhong