Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932878AbbGJOYY (ORCPT ); Fri, 10 Jul 2015 10:24:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56753 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbbGJOYO (ORCPT ); Fri, 10 Jul 2015 10:24:14 -0400 Subject: Re: [PATCH] x86/kconfig/32: Mark CONFIG_VM86 as BROKEN To: Ingo Molnar References: <20150709055225.GA29556@gmail.com> <20150709055917.GA30478@gmail.com> <559FA988.9030205@redhat.com> <20150710141351.GB16910@gmail.com> Cc: Andy Lutomirski , Brian Gerst , Linus Torvalds , Arjan van de Ven , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , Oleg Nesterov , Kees Cook , Peter Zijlstra , Borislav Petkov From: Paolo Bonzini X-Enigmail-Draft-Status: N1110 Message-ID: <559FD587.9090806@redhat.com> Date: Fri, 10 Jul 2015 16:24:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <20150710141351.GB16910@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 35 On 10/07/2015 16:13, Ingo Molnar wrote: > > This isn't hard, at least for Intel: make emulation_required() return true > > always (and fix the fallout). However, it's not necessary. The emulator is > > designed to be independent from the rest of KVM. At some point I think Avi was > > testing it in userspace (or planning to do so). So you would just move it from > > arch/x86/kvm to arch/x86/emulate. > > Very nice! Thanks. :) Mostly on behalf of the former maintainers---and the Xen folks too, the emulator has its roots there. So, the starting point for hooking into the emulator is struct x86_emulate_ops (in asm/kvm_emulate.h) and the function that calls into it in KVM is x86_emulate_instruction. You can look there to see how the emulator can be used. If it doesn't compile straight away in userspace, I'll gladly accept patches. There are parts of emulation that are actually done (for simplicity and laziness) in x86_emulate_instruction rather than emulate.c, most notably hardware debugging support, but these aren't really needed for an initial prototype of vm86. A lot of the stuff in x86_emulate_instruction isn't necessary for vm86 and can be WARN()ed away, because for example IN/OUT always cause a #GP in vm86 mode. Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/