From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
x86@kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
jailhouse-dev@googlegroups.com
Subject: Re: [PATCH 03/10] x86: jailhouse: Enable APIC and SMP support
Date: Mon, 20 Nov 2017 09:39:50 -0500 [thread overview]
Message-ID: <20171120143950.GC24312@char.us.oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1711172254490.2186@nanos>
On Fri, Nov 17, 2017 at 11:42:02PM +0100, Thomas Gleixner wrote:
> On Thu, 16 Nov 2017, Jan Kiszka wrote:
>
> Just noticed, that all prefixes should be 'x86/jailhouse:' please
>
> > +static unsigned int x2apic_get_apic_id(unsigned long id)
> > +{
> > + return id;
> > +}
> > +
> > static void __init jailhouse_init_platform(void)
> > {
> > u64 pa_data = boot_params.hdr.setup_data;
> > struct jailhouse_setup_data *data;
> > + unsigned int cpu;
> >
> > data = early_memremap(pa_data, sizeof(*data));
> >
> > @@ -59,6 +66,23 @@ static void __init jailhouse_init_platform(void)
> > data->compatible_version > SETUP_REQUIRED_VERSION)
> > panic("Jailhouse: Unsupported setup data structure");
> >
> > +#ifdef CONFIG_X86_X2APIC
> > + /*
> > + * Register x2APIC handlers early. We need them when running
> > + * register_lapic_address.
> > + */
> > + if (x2apic_enabled()) {
> > + apic->read = native_apic_msr_read;
> > + apic->write = native_apic_msr_write;
> > + apic->get_apic_id = x2apic_get_apic_id;
>
> Uurgh. That looks hacky.
Could just create a new APIC driver (which would call most of these)?
>
> > + }
> > +#endif
> > + register_lapic_address(0xfee00000);
>
> No need to do all of this here. The right thing to do is to override
>
> x86_init.mpparse.get_smp_config
>
> which is invoked after generic_apic_probe() which should select
> x2apic_phys, but I might be wrong.
>
>
> > + for (cpu = 0; cpu < data->num_cpus; cpu++)
> > + generic_processor_info(data->cpu_ids[cpu],
> > + boot_cpu_apic_version);
>
> Please add brackets around multi line statements.
>
> Thanks,
>
> tglx
next prev parent reply other threads:[~2017-11-20 14:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 7:26 [PATCH 00/10] x86: Add support for running as secondary Jailhouse guest Jan Kiszka
2017-11-16 7:26 ` [PATCH 01/10] x86/apic: Install an empty physflat_init_apic_ldr Jan Kiszka
2017-11-17 21:43 ` Thomas Gleixner
2017-11-16 7:26 ` [PATCH 02/10] x86: jailhouse: Add infrastructure for running in non-root cell Jan Kiszka
2017-11-17 21:54 ` Thomas Gleixner
2017-11-18 19:21 ` Jan Kiszka
2017-11-20 11:22 ` Thomas Gleixner
2017-11-16 7:26 ` [PATCH 03/10] x86: jailhouse: Enable APIC and SMP support Jan Kiszka
2017-11-17 22:42 ` Thomas Gleixner
2017-11-20 14:39 ` Konrad Rzeszutek Wilk [this message]
2017-11-20 17:26 ` Thomas Gleixner
2017-11-16 7:26 ` [PATCH 04/10] x86: jailhouse: Enable PMTIMER Jan Kiszka
2017-11-17 22:44 ` Thomas Gleixner
2017-11-16 7:26 ` [PATCH 05/10] x86: jailhouse: Set up timekeeping Jan Kiszka
2017-11-17 22:49 ` Thomas Gleixner
2017-11-18 19:23 ` Jan Kiszka
2017-11-20 11:24 ` Thomas Gleixner
2017-11-20 12:21 ` Jan Kiszka
2017-11-23 18:36 ` Thomas Gleixner
2017-11-23 19:48 ` Jan Kiszka
2017-11-16 7:26 ` [PATCH 06/10] x86: jailhouse: Avoid access of unsupported platform resources Jan Kiszka
2017-11-17 22:57 ` Thomas Gleixner
2017-11-17 22:59 ` Thomas Gleixner
2017-11-16 7:26 ` [PATCH 07/10] x86: jailhouse: Silence ACPI warning Jan Kiszka
2017-11-16 7:26 ` [PATCH 08/10] x86: jailhouse: Halt instead of failing to restart Jan Kiszka
2017-11-16 7:26 ` [PATCH 09/10] x86: jailhouse: Wire up IOAPIC for legacy UART ports Jan Kiszka
2017-11-17 23:14 ` Thomas Gleixner
2017-11-16 7:26 ` [PATCH 10/10] x86: jailhouse: Initialize PCI support Jan Kiszka
2017-11-18 21:15 ` [PATCH 00/10] x86: Add support for running as secondary Jailhouse guest H. Peter Anvin
2017-11-20 7:00 ` Jan Kiszka
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=20171120143950.GC24312@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=hpa@zytor.com \
--cc=jailhouse-dev@googlegroups.com \
--cc=jan.kiszka@siemens.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).