From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: Juergen Gross <jgross@suse.com>, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, mingo@kernel.org, bp@alien8.de,
hpa@zytor.com, boris.ostrovsky@oracle.com,
sstabellini@kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH 3/6] x86: Add nopv parameter to disable PV extensions
Date: Mon, 24 Jun 2019 21:50:16 +0800 [thread overview]
Message-ID: <cf315d9a-7027-aa8c-1cac-9be9b734811c@oracle.com> (raw)
In-Reply-To: <9e60cea2-a15f-b816-9049-f22be14c04b2@suse.com>
On 2019/6/24 21:18, Juergen Gross wrote:
> On 23.06.19 15:01, Zhenzhong Duan wrote:
>> In virtualization environment, PV extensions (drivers, interrupts,
>> timers, etc) are enabled in the majority of use cases which is the
>> best option.
>>
>> However, in some cases (kexec not fully working, benchmarking)
>> we want to disable PV extensions. As such introduce the
>> 'nopv' parameter that will do it.
>>
>> There is already 'xen_nopv' parameter for XEN platform but not for
>> others. 'xen_nopv' can then be removed with this change.
>>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
>> Cc: xen-devel@lists.xenproject.org
>> ---
>> Documentation/admin-guide/kernel-parameters.txt | 4 ++++
>> arch/x86/kernel/cpu/hypervisor.c | 11 +++++++++++
>> 2 files changed, 15 insertions(+)
>>
>> diff --git a/Documentation/admin-guide/kernel-parameters.txt
>> b/Documentation/admin-guide/kernel-parameters.txt
>> index 138f666..b352f36 100644
>> --- a/Documentation/admin-guide/kernel-parameters.txt
>> +++ b/Documentation/admin-guide/kernel-parameters.txt
>> @@ -5268,6 +5268,10 @@
>> improve timer resolution at the expense of processing
>> more timer interrupts.
>> + nopv= [X86]
>> + Disables the PV optimizations forcing the guest to run
>> + as generic guest with no PV drivers.
>> +
>> xirc2ps_cs= [NET,PCMCIA]
>> Format:
>> <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
>> diff --git a/arch/x86/kernel/cpu/hypervisor.c
>> b/arch/x86/kernel/cpu/hypervisor.c
>> index 479ca47..4f2c875 100644
>> --- a/arch/x86/kernel/cpu/hypervisor.c
>> +++ b/arch/x86/kernel/cpu/hypervisor.c
>> @@ -85,10 +85,21 @@ static void __init copy_array(const void *src,
>> void *target, unsigned int size)
>> to[i] = from[i];
>> }
>> +static bool nopv;
>> +static __init int xen_parse_nopv(char *arg)
>> +{
>> + nopv = true;
>> + return 0;
>> +}
>> +early_param("nopv", xen_parse_nopv);
>> +
>> void __init init_hypervisor_platform(void)
>> {
>> const struct hypervisor_x86 *h;
>> + if (nopv)
>> + return;
>> +
>
> Oh, this is no good idea.
>
> There are guest types which just won't work without pv interfaces, like
> Xen PV and Xen PVH. Letting them fail due to just a wrong command line
> parameter is not nice, especially as the failure might be very hard to
> track down to the issue for the user.
Yes, thanks for catching.
>
> I guess you could add a "ignore_nopv" member to struct hypervisor_x86
> set to true for the mentioned guest types and call the detect functions
> only if nopv is false or ignore_nopv is true.
I think your suggestion is good, I'll rework it based on your suggestion.
Thanks
Zhenzhong
next prev parent reply other threads:[~2019-06-24 13:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-23 13:01 [PATCH 1/6] x86/xen: Mark xen_hvm_need_lapic() and xen_hvm_need_lapic() as __init Zhenzhong Duan
2019-06-23 13:01 ` [PATCH 2/6] x86/jailhouse: Mark jailhouse_x2apic_available " Zhenzhong Duan
2019-06-23 13:01 ` [PATCH 3/6] x86: Add nopv parameter to disable PV extensions Zhenzhong Duan
2019-06-24 13:07 ` Juergen Gross
2019-06-24 13:18 ` Juergen Gross
2019-06-24 13:50 ` Zhenzhong Duan [this message]
2019-06-23 13:01 ` [PATCH 4/6] Revert "xen: Introduce 'xen_nopv' to disable PV extensions for HVM guests." Zhenzhong Duan
2019-06-23 13:01 ` [PATCH 5/6] locking/spinlocks, paravirt, hyperv: Correct the hv_nopvspin case Zhenzhong Duan
2019-06-23 13:01 ` [PATCH 6/6] Revert "x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized" Zhenzhong Duan
2019-06-24 13:06 ` [PATCH 1/6] x86/xen: Mark xen_hvm_need_lapic() and xen_hvm_need_lapic() as __init Juergen Gross
2019-06-24 13:58 ` Thomas Gleixner
2019-06-24 14:37 ` Zhenzhong Duan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf315d9a-7027-aa8c-1cac-9be9b734811c@oracle.com \
--to=zhenzhong.duan@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®