All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Juergen Gross <jgross@suse.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	kvm@vger.kernel.org, xen-devel@lists.xenproject.org,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	boris.ostrovsky@oracle.com, pbonzini@redhat.com,
	rkrcmar@redhat.com, rjw@rjwysocki.net, len.brown@intel.com,
	pavel@ucw.cz
Subject: Re: [PATCH 2/3] x86: add guest_late_init hook to hypervisor_x86 structure
Date: Wed, 8 Nov 2017 10:58:54 +0100	[thread overview]
Message-ID: <20171108095854.b7gqsc44x4jl7b4b@gmail.com> (raw)
In-Reply-To: <7ee9d814-9845-8145-d30a-9570f7cb43d8@suse.com>


* Juergen Gross <jgross@suse.com> wrote:

> On 08/11/17 10:40, Ingo Molnar wrote:
> > 
> > * Juergen Gross <jgross@suse.com> wrote:
> > 
> >>> Plus add a default empty function (which hypervisors can override). This avoids 
> >>> all the hidden conditions and wrappery.
> >>
> >> Hmm, x86_hyper is just a pointer being NULL on bare metal. So we would
> >> have to add a pre-filled struct with dummy functions and in case a
> >> hypervisor is detected we'd need to copy all non-NULL pointers of the
> >> hypervisor specific struct to the pre-filled one.
> > 
> > Ok, I missed that detail - but yeah, since this is mostly about boot code,
> > where readability is king, I still think it would be an overall improvement.
> > 
> > This is the pattern we are trying to use with x86_platform ops for example, and 
> > doing:
> > 
> >   git grep -w x86_platform arch/x86
> > 
> > gives a pretty clear idea about how it's used - while if it was all within 
> > wrappers it would be a lot more difficult to discover all the callsites.
> > 
> > Admittedly it's not done totally consistently:
> > 
> >  arch/x86/kernel/apic/probe_32.c:        if (x86_platform.apic_post_init)
> >  arch/x86/kernel/apic/probe_64.c:        if (x86_platform.apic_post_init)
> >  arch/x86/kernel/ebda.c: if (!x86_platform.legacy.reserve_bios_regions)
> >  arch/x86/kernel/platform-quirks.c:      if (x86_platform.set_legacy_features)
> >  arch/x86/platform/intel-mid/device_libs/platform_mrfld_rtc.c:   if (!x86_platform.legacy.rtc)
> > 
> > ... but the _idea_ behind it is consistent ;-)
> > 
> >> In case there are no objections I can add a patch to modify the current
> >> way x86_hyper is used to the pre-filled variant.
> > 
> > Yeah, sounds good to me!
> 
> Okay. With you mentioning x86_platform: should I make x86_hyper a member
> of x86_platform (e.g. x86_platform.hyper.) ?
> 
> I think this would fit quite nice.

Yeah, seems like a good idea!

Thanks,

	Ingo

  reply	other threads:[~2017-11-08  9:59 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  9:07 [PATCH 0/3] x86/xen: support booting PVH guest via standard boot path Juergen Gross
2017-11-08  9:07 ` [PATCH 1/3] x86/acpi: add test for ACPI_FADT_NO_VGA Juergen Gross
2017-11-08  9:07 ` Juergen Gross
2017-11-08  9:07 ` [PATCH 2/3] x86: add guest_late_init hook to hypervisor_x86 structure Juergen Gross
2017-11-08  9:07   ` Juergen Gross
2017-11-08  9:13   ` Ingo Molnar
2017-11-08  9:27     ` Juergen Gross
2017-11-08  9:40       ` Ingo Molnar
2017-11-08  9:49         ` Juergen Gross
2017-11-08  9:58           ` Ingo Molnar [this message]
2017-11-08  9:58           ` Ingo Molnar
2017-11-08  9:49         ` Juergen Gross
2017-11-08  9:40       ` Ingo Molnar
2017-11-08  9:27     ` Juergen Gross
2017-11-08  9:13   ` Ingo Molnar
2017-11-08  9:53   ` Paolo Bonzini
2017-11-08  9:53   ` Paolo Bonzini
2017-11-08  9:07 ` [PATCH 3/3] x86/xen: use guest_late_init to detect Xen PVH guest Juergen Gross
2017-11-08  9:07   ` Juergen Gross
2017-11-08 11:18   ` Jan Beulich
2017-11-08 11:18   ` [Xen-devel] " Jan Beulich
     [not found]   ` <5A02F633020000780018D26A@suse.com>
2017-11-08 11:55     ` Juergen Gross
2017-11-08 12:03       ` Paolo Bonzini
2017-11-08 12:24         ` Juergen Gross
2017-11-08 12:24         ` [Xen-devel] " Juergen Gross
2017-11-08 12:26           ` Paolo Bonzini
2017-11-08 12:40             ` Juergen Gross
2017-11-08 12:40             ` [Xen-devel] " Juergen Gross
2017-11-08 12:26           ` Paolo Bonzini
2017-11-08 12:03       ` Paolo Bonzini
2017-11-08 12:31       ` Jan Beulich
2017-11-08 12:31       ` [Xen-devel] " Jan Beulich
2017-11-08 12:45         ` Juergen Gross
2017-11-08 12:58           ` Jan Beulich
2017-11-08 12:58           ` [Xen-devel] " Jan Beulich
     [not found]           ` <5A030D78020000780018D37B@suse.com>
2017-11-08 13:36             ` Juergen Gross
2017-11-08 14:10               ` Boris Ostrovsky
2017-11-08 14:10               ` [Xen-devel] " Boris Ostrovsky
2017-11-08 14:17                 ` Juergen Gross
2017-11-08 14:17                 ` [Xen-devel] " Juergen Gross
2017-11-08 14:24                   ` Boris Ostrovsky
2017-11-08 14:24                   ` Boris Ostrovsky
2017-11-08 13:36             ` Juergen Gross
2017-11-08 12:45         ` Juergen Gross
2017-11-08 11:55     ` Juergen Gross
2017-11-08 13:37 ` [PATCH 0/3] x86/xen: support booting PVH guest via standard boot path Boris Ostrovsky
2017-11-08 13:37 ` Boris Ostrovsky
2017-11-08 13:40   ` Juergen Gross
2017-11-08 13:40   ` Juergen Gross
2017-11-08 13:47     ` Boris Ostrovsky
2017-11-08 13:47     ` 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=20171108095854.b7gqsc44x4jl7b4b@gmail.com \
    --to=mingo@kernel.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=kvm@vger.kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=pbonzini@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=rkrcmar@redhat.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.