From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v8 14/15] ARM: KVM: Handle I/O aborts Date: Mon, 18 Jun 2012 16:48:07 +0300 Message-ID: <4FDF3197.4030603@redhat.com> References: <20120615190553.24590.18391.stgit@ubuntu> <20120615190919.24590.12779.stgit@ubuntu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org To: Christoffer Dall Return-path: Received: from mx1.redhat.com ([209.132.183.28]:23443 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108Ab2FRNsP (ORCPT ); Mon, 18 Jun 2012 09:48:15 -0400 In-Reply-To: <20120615190919.24590.12779.stgit@ubuntu> Sender: kvm-owner@vger.kernel.org List-ID: On 06/15/2012 10:09 PM, Christoffer Dall wrote: > When the guest accesses I/O memory this will create data abort > exceptions and they are handled by decoding the HSR information > (physical address, read/write, length, register) and forwarding reads > and writes to QEMU which performs the device emulation. > > Certain classes of load/store operations do not support the syndrome > information provided in the HSR and we therefore must be able to fetch > the offending instruction from guest memory and decode it manually. > > This requires changing the general flow somewhat since new calls to run > the VCPU must check if there's a pending MMIO load and perform the write > after userspace has made the data available. > > > memslot = gfn_to_memslot(vcpu->kvm, gfn); > diff --git a/arch/arm/kvm/trace.h b/arch/arm/kvm/trace.h > index e474a0a..bd3a6cc 100644 > --- a/arch/arm/kvm/trace.h > +++ b/arch/arm/kvm/trace.h > @@ -39,6 +39,27 @@ TRACE_EVENT(kvm_exit, > TP_printk("PC: 0x%08lx", __entry->vcpu_pc) > ); > > +TRACE_EVENT(kvm_mmio_emulate, > + TP_PROTO(unsigned long vcpu_pc, unsigned long instr, > + unsigned long cpsr), > + TP_ARGS(vcpu_pc, instr, cpsr), > + > + TP_STRUCT__entry( > + __field( unsigned long, vcpu_pc ) > + __field( unsigned long, instr ) > + __field( unsigned long, cpsr ) > + ), > + > + TP_fast_assign( > + __entry->vcpu_pc = vcpu_pc; > + __entry->vcpu_pc = instr; > + __entry->vcpu_pc = cpsr; -ECUTANDPASTE > + ), > + > + TP_printk("Emulate MMIO at: 0x%08lx (instr: %08lx, cpsr: %08lx)", > + __entry->vcpu_pc, __entry->instr, __entry->cpsr) > +); > + -- error compiling committee.c: too many arguments to function