lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1711201826410.1734@nanos>
Date:   Mon, 20 Nov 2017 18:26:56 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
cc:     Jan Kiszka <jan.kiszka@...mens.com>,
        Ingo Molnar <mingo@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        jailhouse-dev@...glegroups.com
Subject: Re: [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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ