From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [kvm-devel] [RFC][PATCH 3/4] kvm-vmx: KVM_EXIT_DEBUG on #BP exceptions Date: Thu, 22 May 2008 17:34:08 +0300 Message-ID: <48358460.9020805@qumranet.com> References: <482D9198.7040801@web.de> <4834474B.7030600@qumranet.com> <483575C2.1040303@web.de> <200805220926.52133.hollisb@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , kvm-devel To: Hollis Blanchard Return-path: Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194]:51784 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751983AbYEVOeK (ORCPT ); Thu, 22 May 2008 10:34:10 -0400 In-Reply-To: <200805220926.52133.hollisb@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Hollis Blanchard wrote: > In addition to injecting debug interrupts, qemu should also be able to inject > machine checks, for the case of undecoded MMIO accesses. > > As long as qemu can access the complete register state (e.g. including "reason > for machine check" registers), I don't think the injection interface *needs* > to be more complicated than "exception number". > > OTOH, I can see the argument for atomic injection operations, so to support > that you'd end up with a sub-structure like kvm_exit, something like: > > struct kvm_inject_arch { > u32 exception_type; > union { > struct machine_check { > u32 mcsr; > } mc; > struct debug { > } debug; > }; > } > > This stuff is completely arch-specific, so making a common "inject" ioctl > number that simply calls arch function (like GET_SREGS) would be appropriate. > > In the mmio case, I think it makes more sense to have a 'mmio failed' flag, and kvm can generate and inject the exception. We mostly try to keep cpu emulation outside userspace. (of course, that depends on what happens on real hardware. Is there a machine check pin? or does the cpu generate the exception internally?) -- error compiling committee.c: too many arguments to function