mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Zhenzhong Duan <zhenzhong.duan@oracle.com>, linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org, jgross@suse.com,
	sstabellini@kernel.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de
Subject: Re: [PATCH v6 4/4] x86/xen: Add "nopv" support for HVM guest
Date: Mon, 8 Jul 2019 09:46:53 -0400	[thread overview]
Message-ID: <86b0dbb9-74a7-6883-e6d7-210bd35a6944@oracle.com> (raw)
In-Reply-To: <1562490908-17882-5-git-send-email-zhenzhong.duan@oracle.com>

On 7/7/19 5:15 AM, Zhenzhong Duan wrote:
>  
> +static uint32_t __init xen_platform_hvm(void)
> +{
> +	if (xen_pv_domain())
> +		return 0;
> +
> +	if (xen_pvh_domain() && nopv) {
> +		/* Guest booting via the Xen-PVH boot entry goes here */
> +		pr_info("\"nopv\" parameter is ignored in PVH guest\n");
> +		nopv = false;
> +	} else if (nopv) {
> +		/*
> +		 * Guest booting via normal boot entry (like via grub2) goes
> +		 * here.
> +		 */
> +		x86_init.hyper.guest_late_init = xen_hvm_guest_late_init;
> +		return 0;

After staring at this some more I don't think we can do this.
Hypervisor-specific code should not muck with with x86_init.hyper, it's
layering violation. That's what init_hypervisor_platform() is for.

So we may have to create another hypervisor_x86 ops structure for Xen
nopv (which I don't find very appealing TBH). Or update
x86_hyper_xen_hvm and return xen_cpuid_base() instead of zero (but then
you'd need to update all these structs from __initconst to _init or some
such). Or something else.


-boris


> +	}
> +	return xen_cpuid_base();
> +}
> +
>  const __initconst struct hypervisor_x86 x86_hyper_xen_hvm = {
>  	.name                   = "Xen HVM",
>  	.detect                 = xen_platform_hvm,
> @@ -268,4 +283,5 @@ static __init void xen_hvm_guest_late_init(void)
>  	.init.init_mem_mapping	= xen_hvm_init_mem_mapping,
>  	.init.guest_late_init	= xen_hvm_guest_late_init,
>  	.runtime.pin_vcpu       = xen_pin_vcpu,
> +	.ignore_nopv            = true,
>  };


  reply	other threads:[~2019-07-08 13:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-07  9:15 [PATCH v6 0/4] misc fixes to PV extensions code Zhenzhong Duan
2019-07-07  9:15 ` [PATCH v6 1/4] x86/xen: Mark xen_hvm_need_lapic() and xen_x2apic_para_available() as __init Zhenzhong Duan
2019-07-07  9:15 ` [PATCH v6 2/4] x86: Add "nopv" parameter to disable PV extensions Zhenzhong Duan
2019-07-07  9:15 ` [PATCH v6 3/4] xen: Map "xen_nopv" parameter to "nopv" and mark it obsolete Zhenzhong Duan
2019-07-07  9:15 ` [PATCH v6 4/4] x86/xen: Add "nopv" support for HVM guest Zhenzhong Duan
2019-07-08 13:46   ` Boris Ostrovsky [this message]
2019-07-09  4:20     ` Zhenzhong Duan
2019-07-09 14:54       ` Boris Ostrovsky
2019-07-10  2:07         ` Zhenzhong Duan
2019-07-10 13:21           ` Boris Ostrovsky

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=86b0dbb9-74a7-6883-e6d7-210bd35a6944@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sstabellini@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zhenzhong.duan@oracle.com \
    /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

Powered by JetHome