lkml.org 
[lkml]   [2017]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/10] x86: jailhouse: Enable APIC and SMP support
On Mon, 20 Nov 2017, Konrad Rzeszutek Wilk wrote:

> 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)?

Why so? See further down.

> >
> > > + }
> > > +#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
>

\
 
 \ /
  Last update: 2017-11-20 18:27    [W:0.062 / U:5.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site