From: Paul Bolle Subject: Re: [Xen-devel] lguest: unhandled trap 13 and CONFIG_MICROCODE_INTEL_EARLY Date: Thu, 09 May 2013 10:24:52 +0200 Message-ID: <1368087892.7587.19.camel@x61.thuisdomein> References: <1367450300.11532.32.camel@x61.thuisdomein> <87li7srb3r.fsf@rustcorp.com.au> <5187C369.5020902@zytor.com> <87mws7nzag.fsf@rustcorp.com.au> <20130508172040.GA1256@phenom.dumpdata.com> <8738txnd13.fsf@rustcorp.com.au> <518B1702.7010307@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <518B1702.7010307-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lguest-bounces+glkvl-lguest=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "Lguest" To: "H. Peter Anvin" Cc: Jeremy Fitzhardinge , lguest-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Konrad Rzeszutek Wilk , xen-devel-GuqFBffKawuULHF6PoxzQEEOCMrvLtNR@public.gmane.org, Thomas Gleixner , Ingo Molnar List-Id: xen-devel@lists.xenproject.org On Wed, 2013-05-08 at 20:24 -0700, H. Peter Anvin wrote: > On 05/08/2013 06:43 PM, Rusty Russell wrote: > > > > OK, that confirms my understanding it's lguest-only. > > > > To return to the immediate proposal: I'd like to expand it KEEP_SEGMENTS > > to say "don't do any privileged ops before the platform entry point" > > which is what it used to do (before we added those config options), and > > still does (if they're disabled). > > > > This fixes lguest for those configs, and if there *are* any other users, > > this just means they don't support OLPC machines (since 2.6.37) or early > > microcode (3.9). OLPC + KEEP_SEGMENTS is vanishingly unlikely (the OLPC > > bootloader doesn't use it), and early microcode never worked with > > paravirt anyway (those native_cpuid() calls). > > > > Failing that, second best to remove KEEP_SEGMENTS, and have lguest > > 'emulate' (ie. skip!) those instructions. We already do this for in/out > > instructions, see drivers/lguest/x86/core.c emulate_insn(). More code, > > but it's lguest code. > > > > Or we can skip the microcode stuff for platform == 2. And could the OLPC specific code movl %cr3, %eax movl %eax, pa(olpc_ofw_pgd) in head_32.S perhaps be moved to (just before) the enable_paging label? I don't think anything cares about %cr3 before that, so it won't interfere with OLPC's (creative?) use of that register. And olpc_ofw_pgd seems to be only used much later on, as the call chain looks something like: ENTRY(initial_code) i386_start_kernel() start_kernel() setup_arch() setup_olpc_ofw_pgd() early_ioremap(olpc_ofw_pgd, [...]); That would move those two OLPC specific lines to a point were pv_mmu_ops.read_cr3 points to lguest_read_cr3() so lguest can handle them, wouldn't it? Paul Bolle