All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maran Wilson <maran.wilson@oracle.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Juergen Gross" <jgross@suse.com>
Cc: kvm@vger.kernel.org, rkrcmar@redhat.com,
	andrew.cooper3@citrix.com, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	JBeulich@suse.com, hpa@zytor.com, xen-devel@lists.xenproject.org,
	tglx@linutronix.de
Subject: Re: [RFC PATCH] KVM: x86: Allow Qemu/KVM to use PVH entry point
Date: Thu, 7 Dec 2017 15:03:55 -0800	[thread overview]
Message-ID: <0b35e55b-47ec-c11a-bd56-75b37e868d31__23580.3250958726$1512688035$gmane$org@oracle.com> (raw)
In-Reply-To: <a7781053-07ec-299a-0610-ece3c30bdb8e@redhat.com>

Just FYI: I sent out a v2 of this patch but in doing so I moved a few 
people from the "to" line to the "cc" line.

For anyone who previously did not comment but still wanted to follow the 
discussion, here's the link to the v2 email:

https://lkml.org/lkml/2017/12/7/1624

Thanks,
-Maran

On 12/1/2017 12:08 AM, Paolo Bonzini wrote:
> On 30/11/2017 19:23, Maran Wilson wrote:
>> Are you saying the Linux PVH entry code (such as init_pvh_bootparams())
>> should use the fw_cfg interface to read the e820 memory map data and put
>> it into the zeropage? Basically, keeping the patch very much like it
>> already is, just extracting the e820 data via the fw_cfg interface
>> instead of from the second module of start_info struct?
> Yes.
>
>> If that is the case, I guess I'm a bit hesitant to throw the QEMU
>> specific fw_cfg interface into the mix on the Linux PVH side when the
>> existing PVH ABI already seems to contain an interface for passing
>> modules/blobs to the guest. But if you feel there is a compelling reason
>> to use the fw_cfg interface here, I'm happy to explore that approach
>> further.
> I think the same holds true for Xen, but it is still using a hypercall
> to get the memory map.  In the end, using fw_cfg seems closest to what
> the Xen code does.
>
> There are other possibilities:
>
> 1) defining a v2 PVH ABI that includes the e820 map would also be a
> possibility.
>
> 2) modify enlighten_pvh.c to get the start info in multiboot format,
> something like:
>
> diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
> index 98ab17673454..656e41449db0 100644
> --- a/arch/x86/xen/enlighten_pvh.c
> +++ b/arch/x86/xen/enlighten_pvh.c
> @@ -88,19 +88,22 @@ void __init xen_prepare_pvh(void)
>   	u32 msr;
>   	u64 pfn;
>   
> -	if (pvh_start_info.magic != XEN_HVM_START_MAGIC_VALUE) {
> +	if (pvh_start_info.magic == XEN_HVM_START_MAGIC_VALUE) {
> +		xen_pvh = 1;
> +
> +		init_pvh_bootparams_xen();
> +
> +		msr = cpuid_ebx(xen_cpuid_base() + 2);
> +		pfn = __pa(hypercall_page);
> +		wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
> +
> +		x86_init.oem.arch_setup = xen_pvh_arch_setup;
> +	} else if (pvh_start_info.magic == MULTIBOOT_INFO_MAGIC_VALUE) {
> +		init_pvh_bootparams_multiboot();
> +
> +	} else {
>   		xen_raw_printk("Error: Unexpected magic value (0x%08x)\n",
>   				pvh_start_info.magic);
>   		BUG();
>   	}
> -
> -	xen_pvh = 1;
> -
> -	msr = cpuid_ebx(xen_cpuid_base() + 2);
> -	pfn = __pa(hypercall_page);
> -	wrmsr_safe(msr, (u32)pfn, (u32)(pfn >> 32));
> -
> -	init_pvh_bootparams();
> -
> -	x86_init.oem.arch_setup = xen_pvh_arch_setup;
>   }
>
>
> Note that this would *not* be a multiboot-format kernel, as it would
> still have the Xen PVH ELF note.  It would just reuse the format of
> the start info struct.
>
> However, I think it is simpler to just use the e820 memory map from
> fw_cfg.
>
> Paolo


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2017-12-07 23:06 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 19:34 [RFC PATCH] KVM: x86: Allow Qemu/KVM to use PVH entry point Maran Wilson
2017-11-28 19:34 ` Maran Wilson
2017-11-28 19:41 ` Andrew Cooper
2017-11-28 19:41   ` Andrew Cooper
2017-11-28 19:41   ` Andrew Cooper
2017-11-28 19:58 ` Christoph Hellwig
2017-11-28 19:58 ` Christoph Hellwig
2017-11-29  8:21 ` Juergen Gross
2017-11-29  8:50   ` Roger Pau Monné
2017-11-29  8:50   ` Roger Pau Monné
2017-11-29 14:03     ` Boris Ostrovsky
2017-11-29 14:11       ` Juergen Gross
2017-11-29 14:11       ` Juergen Gross
2017-11-29 14:18         ` Roger Pau Monné
2017-11-29 14:25           ` Boris Ostrovsky
2017-11-29 14:44             ` Paolo Bonzini
2017-11-29 14:44             ` Paolo Bonzini
2017-11-29 14:47               ` Juergen Gross
2017-11-29 14:47               ` Juergen Gross
2017-11-29 14:50                 ` Paolo Bonzini
2017-11-29 14:50                 ` Paolo Bonzini
2017-11-29 14:52                 ` Andrew Cooper
2017-11-29 14:52                 ` Andrew Cooper
2017-11-30 18:23               ` Maran Wilson
2017-11-30 18:23               ` Maran Wilson
2017-12-01  8:08                 ` Paolo Bonzini
2017-12-01  8:08                 ` Paolo Bonzini
2017-12-07 23:03                   ` Maran Wilson
2017-12-07 23:03                   ` Maran Wilson [this message]
2017-11-29 14:25           ` Boris Ostrovsky
2017-11-29 14:18         ` Roger Pau Monné
2017-11-29 14:03     ` Boris Ostrovsky
2017-11-29 17:24   ` Maran Wilson
2017-11-29 17:24   ` Maran Wilson
2017-11-29  8:21 ` Juergen Gross
2017-11-29  8:59 ` Paolo Bonzini
2017-11-29 17:14   ` Maran Wilson
2017-11-29 17:14   ` Maran Wilson
2017-11-29 17:16     ` Paolo Bonzini
2017-11-29 17:16     ` Paolo Bonzini
2017-11-29  8:59 ` Paolo Bonzini

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='0b35e55b-47ec-c11a-bd56-75b37e868d31__23580.3250958726$1512688035$gmane$org@oracle.com' \
    --to=maran.wilson@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=roger.pau@citrix.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.