All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maran Wilson <maran.wilson@oracle.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	pbonzini@redhat.com, jgross@suse.com, roger.pau@citrix.com,
	andrew.cooper3@citrix.com, hch@infradead.org, JBeulich@suse.com,
	x86@kernel.org, xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	rkrcmar@redhat.com, jpoimboe@redhat.com, bp@suse.de,
	kirill.shutemov@linux.intel.com, thomas.lendacky@amd.com,
	luto@kernel.org, dave.hansen@linux.intel.com,
	davem@davemloft.net, gregkh@linuxfoundation.org,
	mchehab@kernel.org, linus.walleij@linaro.org,
	rdunlap@infradead.org
Subject: Re: [RFC PATCH v4 4/7] xen/pvh: Move Xen specific PVH VM initialization out of common code
Date: Thu, 1 Mar 2018 09:43:49 -0800	[thread overview]
Message-ID: <2876cbf2-e26a-d6dd-064a-32cf93a9e7ab@oracle.com> (raw)
In-Reply-To: <d9b1e5ef-af73-d2cb-0f3d-f41cdc8f35cd@oracle.com>

On 3/1/2018 8:05 AM, Boris Ostrovsky wrote:
> On 02/28/2018 01:28 PM, Maran Wilson wrote:
>> We need to refactor PVH entry code so that support for other hypervisors
>> like Qemu/KVM can be added more easily.
>>
>> This patch moves the small block of code used for initializing Xen PVH
>> virtual machines into the Xen specific file. This initialization is not
>> going to be needed for Qemu/KVM guests. Moving it out of the common file
>> is going to allow us to compile kernels in the future without CONFIG_XEN
>> that are still capable of being booted as a Qemu/KVM guest via the PVH
>> entry point.
>>
>> Signed-off-by: Maran Wilson <maran.wilson@oracle.com>
>> ---
>>   arch/x86/pvh.c               | 28 ++++++++++++++++++++--------
>>   arch/x86/xen/enlighten_pvh.c | 18 +++++++++++++++++-
>>   2 files changed, 37 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/x86/pvh.c b/arch/x86/pvh.c
>> index b56cb5e7d6ac..2d7a7f4958cb 100644
>> --- a/arch/x86/pvh.c
>> +++ b/arch/x86/pvh.c
>> @@ -72,26 +72,38 @@ static void __init init_pvh_bootparams(void)
>>   	pvh_bootparams.hdr.type_of_loader = (9 << 4) | 0; /* Xen loader */
>>   }
>>   
>> +/*
>> + * If we are trying to boot a Xen PVH guest, it is expected that the kernel
>> + * will have been configured to provide the required override for this routine.
>> + */
>> +void __init __weak xen_pvh_init(void)
>> +{
>> +	xen_raw_printk("Error: Missing xen PVH initialization\n");
> I think this should be printk (or, more precisely, this should not be
> xen_raw_printk()): we are here because we are *not* a Xen guest and so
> Xen-specific printk will not work. (and the same is true for the next
> patch where weak mem_map_via_hcall() is added).

Actually I left that xen_raw_printk() statement in on purpose. It's also 
possible that some future developer accidentally drops or hides the 
strong version of the routine even when CONFIG_XEN (and CONFIG_HVC_XEN) 
is enabled. In that situation, this error message might prove helpful in 
quickly identifying the problem when he or she attempts to boot a Xen guest.

And in situations where CONFIG_XEN is disabled or someone is booting a 
non xen guest, the statement simply becomes a nop, so no harm is done. 
And also, I believe this code is far too early for normal printk() 
statements to work so switching to that won't buy us anything.

Thanks,
-Maran

> -boris
>
>
>> +	BUG();
>> +}
>>

  parent reply	other threads:[~2018-03-01 17:43 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28 18:27 [RFC PATCH v4 0/7] KVM: x86: Allow Qemu/KVM to use PVH entry point Maran Wilson
2018-02-28 18:27 ` Maran Wilson
2018-02-28 18:27 ` [RFC PATCH v4 1/7] xen/pvh: Split CONFIG_XEN_PVH into CONFIG_PVH and CONFIG_XEN_PVH Maran Wilson
2018-02-28 18:27 ` Maran Wilson
2018-02-28 21:07   ` Konrad Rzeszutek Wilk
2018-02-28 21:07   ` [Xen-devel] " Konrad Rzeszutek Wilk
2018-03-01  5:43     ` Juergen Gross
2018-03-01  5:43     ` [Xen-devel] " Juergen Gross
2018-03-01  7:19   ` Juergen Gross
2018-03-01  7:19   ` Juergen Gross
2018-03-01 15:02   ` Boris Ostrovsky
2018-03-01 15:02   ` Boris Ostrovsky
2018-03-01 15:17     ` Paolo Bonzini
2018-03-01 15:17     ` Paolo Bonzini
2018-03-01 17:24       ` Maran Wilson
2018-03-01 17:24       ` Maran Wilson
2018-02-28 18:27 ` [RFC PATCH v4 2/7] xen/pvh: Move PVH entry code out of Xen specific tree Maran Wilson
2018-02-28 21:08   ` [Xen-devel] " Konrad Rzeszutek Wilk
2018-02-28 21:35     ` Paolo Bonzini
2018-02-28 21:35     ` [Xen-devel] " Paolo Bonzini
2018-03-01  6:11       ` Juergen Gross
2018-03-01  6:11       ` [Xen-devel] " Juergen Gross
2018-03-01  8:46         ` Paolo Bonzini
2018-03-01 16:15           ` Boris Ostrovsky
2018-03-01 16:15           ` [Xen-devel] " Boris Ostrovsky
2018-03-01  8:46         ` Paolo Bonzini
2018-03-01 17:22       ` [Xen-devel] " Maran Wilson
2018-03-01 17:22       ` Maran Wilson
2018-02-28 21:08   ` Konrad Rzeszutek Wilk
2018-02-28 18:27 ` Maran Wilson
2018-02-28 18:27 ` [RFC PATCH v4 3/7] xen/pvh: Create a new file for Xen specific PVH code Maran Wilson
2018-02-28 18:27 ` Maran Wilson
2018-02-28 21:09   ` Konrad Rzeszutek Wilk
2018-02-28 21:09   ` [Xen-devel] " Konrad Rzeszutek Wilk
2018-02-28 18:28 ` [RFC PATCH v4 4/7] xen/pvh: Move Xen specific PVH VM initialization out of common code Maran Wilson
2018-02-28 21:10   ` [Xen-devel] " Konrad Rzeszutek Wilk
2018-02-28 21:10     ` Konrad Rzeszutek Wilk
2018-03-01  7:20   ` Juergen Gross
2018-03-01  7:20   ` Juergen Gross
2018-03-01 16:05   ` Boris Ostrovsky
2018-03-01 17:43     ` Maran Wilson
2018-03-01 17:43     ` Maran Wilson [this message]
2018-03-01 16:05   ` Boris Ostrovsky
2018-02-28 18:28 ` Maran Wilson
2018-02-28 18:28 ` [RFC PATCH v4 5/7] xen/pvh: Move Xen code for getting mem map via hcall out of common file Maran Wilson
2018-03-01  7:21   ` Juergen Gross
2018-03-01  7:21   ` Juergen Gross
2018-02-28 18:28 ` Maran Wilson
2018-02-28 18:28 ` [RFC PATCH v4 6/7] xen/pvh: Add memory map pointer to hvm_start_info struct Maran Wilson
2018-02-28 18:28 ` Maran Wilson
2018-03-01  7:29   ` Juergen Gross
2018-03-01  7:29   ` Juergen Gross
2018-03-01  7:41     ` Jan Beulich
2018-03-01  7:41       ` Jan Beulich
2018-03-01 17:19       ` Maran Wilson
2018-03-01 17:19       ` Maran Wilson
2018-03-01  7:41     ` Jan Beulich
2018-03-01 15:23   ` [Xen-devel] " Konrad Rzeszutek Wilk
2018-03-01 15:23     ` Konrad Rzeszutek Wilk
2018-02-28 18:28 ` [RFC PATCH v4 7/7] KVM: x86: Allow Qemu/KVM to use PVH entry point Maran Wilson
2018-02-28 18:28 ` Maran Wilson
2018-03-01  7:31   ` Juergen Gross
2018-03-01  7:31   ` Juergen Gross
2018-02-28 21:39 ` [RFC PATCH v4 0/7] " Paolo Bonzini
2018-02-28 21:39 ` Paolo Bonzini
2018-03-20 19:16 ` [PATCH v5 " Maran Wilson
2018-03-20 19:18   ` [PATCH v5 1/7] xen/pvh: Split CONFIG_XEN_PVH into CONFIG_PVH and CONFIG_XEN_PVH Maran Wilson
2018-03-20 19:18   ` Maran Wilson
2018-03-20 19:23     ` Randy Dunlap
2018-03-20 20:55       ` Maran Wilson
2018-03-20 20:55       ` Maran Wilson
2018-03-20 19:23     ` Randy Dunlap
2018-03-20 19:18   ` [PATCH v5 2/7] xen/pvh: Move PVH entry code out of Xen specific tree Maran Wilson
2018-03-20 19:18   ` Maran Wilson
2018-03-20 19:19   ` [PATCH v5 3/7] xen/pvh: Create a new file for Xen specific PVH code Maran Wilson
2018-03-20 19:19   ` Maran Wilson
2018-03-20 19:19   ` [PATCH v5 4/7] xen/pvh: Move Xen specific PVH VM initialization out of common file Maran Wilson
2018-03-20 19:19   ` Maran Wilson
2018-03-20 19:19   ` [PATCH v5 5/7] xen/pvh: Move Xen code for getting mem map via hcall " Maran Wilson
2018-03-20 19:19   ` Maran Wilson
2018-03-20 19:20   ` [PATCH v5 6/7] xen/pvh: Add memory map pointer to hvm_start_info struct Maran Wilson
2018-03-20 19:20   ` Maran Wilson
2018-03-20 19:21   ` [PATCH v5 7/7] KVM: x86: Allow Qemu/KVM to use PVH entry point Maran Wilson
2018-03-20 19:21   ` Maran Wilson
2018-03-20 19:16 ` [PATCH v5 0/7] " Maran Wilson

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=2876cbf2-e26a-d6dd-064a-32cf93a9e7ab@oracle.com \
    --to=maran.wilson@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jpoimboe@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=rkrcmar@redhat.com \
    --cc=roger.pau@citrix.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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.