From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [Xen-devel] lguest: unhandled trap 13 and CONFIG_MICROCODE_INTEL_EARLY Date: Thu, 09 May 2013 11:13:36 +0930 Message-ID: <8738txnd13.fsf@rustcorp.com.au> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130508172040.GA1256-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@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: Konrad Rzeszutek Wilk Cc: lguest-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Jeremy Fitzhardinge , xen-devel-GuqFBffKawuULHF6PoxzQEEOCMrvLtNR@public.gmane.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar List-Id: xen-devel@lists.xenproject.org Konrad Rzeszutek Wilk writes: > On Tue, May 07, 2013 at 02:48:15PM +0930, Rusty Russell wrote: >> "H. Peter Anvin" writes: >> > On 05/05/2013 09:22 PM, Rusty Russell wrote: >> >> >> >> HPA, how about we extend the KEEP_SEGMENTS flag to mean "don't touch >> >> privileged registers" in general? That's what it used to do when it >> >> was introduced, and AFAIK only lguest uses it. Xen folk CC'd. >> >> >> > >> > KEEP_SEGMENTS was introduced at the request of Xen, not lguest. I'm a >> > bit concerned about extending it as I don't know what else might end up >> > being affected. >> >> Not sure if they ever used it, or if they still have their own entry >> point. > > I don't ever recall it being used. But git commit bd53147db8bdf5dd49025c198ff18ac23f560e0e > says > > Both x86 and x86_64 support the same boot protocol so we need > to implement the KEEP_SEGMENTS on x86_64 as well. It isn't > just paravirt bootloaders that could use this functionality. > > And a quick Google search tells me: > http://lkml.indiana.edu/hypermail/linux/kernel/1102.0/01422.html > > I think the only potential user is whatever Eric Biederman thought off? 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. Cheers, Rusty.