All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [RFC PATCH] xen, apic: Setup our own APIC driver and validator for APIC IDs.
Date: Thu, 22 Jan 2015 14:22:43 -0500	[thread overview]
Message-ID: <20150122192243.GD18286@l.oracle.com> (raw)
In-Reply-To: <54C113EA.80400@citrix.com>

On Thu, Jan 22, 2015 at 03:14:50PM +0000, David Vrabel wrote:
> On 22/01/15 15:09, Konrad Rzeszutek Wilk wrote:
> > On Thu, Jan 22, 2015 at 10:00:55AM +0000, David Vrabel wrote:
> >> On 21/01/15 21:56, Konrad Rzeszutek Wilk wrote:
> >>> +static struct apic xen_apic = {
> >>> +	.name = "Xen",
> >>> +	.probe = probe_xen,
> >>> +	/* The rest is copied from the default. */
> >>
> >> Explicitly initialize all required members here.  memcpy'ing from the
> >> default makes it far too unclear which ops this apic driver actually
> >> provides.
> > 
> > That will be hard for two reasons:
> >  1) if the 'struct apic' expands and we don't - then we will crash.
> 
> This is easy to identify and fix, right?

Perhaps. Some of the ops are not used until you run say 'perf' and then
some of the ops get invoked.
> 
> >  2)  we would need to use the default 'apic' functions ones - which are not
> >      necceesarily exposed to the rest of the system. Hence there will
> >      be a lot of exposing those.
> 
> I think you should try this anyway and then we can evaluate the result.
>  I don't think it will be as bad as you fear.
> 
> >>>  void __init xen_init_apic(void)
> >>>  {
> >>>  	x86_io_apic_ops.read = xen_io_apic_read;
> >>> +
> >>> +	memcpy(&xen_apic, apic, sizeof(struct apic));
> >>> +	xen_apic.probe = probe_xen;
> >>> +	xen_apic.name = "Xen";
> >>> +
> >>> +	xen_apic.read = xen_apic_read;
> >>> +	xen_apic.write = xen_apic_write;
> >>> +	xen_apic.icr_read = xen_apic_icr_read;
> >>> +	xen_apic.icr_write = xen_apic_icr_write;
> >>> +	xen_apic.wait_icr_idle = xen_apic_wait_icr_idle;
> >>> +	xen_apic.safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;
> >>> +	xen_apic.set_apic_id = xen_set_apic_id;
> >>> +	xen_apic.get_apic_id = xen_get_apic_id;
> >>> +
> >>> +	xen_apic.send_IPI_allbutself = xen_send_IPI_allbutself;
> >>> +	xen_apic.send_IPI_mask_allbutself = xen_send_IPI_mask_allbutself;
> >>> +	xen_apic.send_IPI_mask = xen_send_IPI_mask;
> >>> +	xen_apic.send_IPI_all = xen_send_IPI_all;
> >>> +	xen_apic.send_IPI_self = xen_send_IPI_self;
> >>> +
> >>> +	if (xen_check_x2apic())
> >>> +		xen_apic.apic_id_valid = xen_id_always_valid;
> >>
> >> Just always use xen_id_always_valid regardless of whether the machine
> >> has x2apic or not.  It is possible to have more VCPUs that PCPUs.
> > 
> > In which case perhaps the patch ought to be just simpler and
> > instead of having our own 'struct apic' we continue over-writting
> > the default one - and just change 'apic_id_valid' to our own.
> 
> Please stop pretending that Xen PV guests have a "native" apic with
> "specials". We should provide a complete PV-specific apic driver.
> 
> David

  reply	other threads:[~2015-01-22 19:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 21:56 [RFC PATCH] xen,apic: Setup our own APIC driver and validator for APIC IDs Konrad Rzeszutek Wilk
2015-01-22 10:00 ` [RFC PATCH] xen, apic: " David Vrabel
2015-01-22 15:09   ` Konrad Rzeszutek Wilk
2015-01-22 15:14     ` David Vrabel
2015-01-22 19:22       ` Konrad Rzeszutek Wilk [this message]
2015-01-22 21:41         ` Konrad Rzeszutek Wilk
2015-02-10 20:33   ` Konrad Rzeszutek Wilk
2015-02-11  9:53     ` David Vrabel
2015-02-11 18:37       ` Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2015-01-21 21:56 Konrad Rzeszutek Wilk

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=20150122192243.GD18286@l.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=xen-devel@lists.xen.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.