From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rusty Russell" Subject: [PATCH] ARM: KVM: Emulate ID_DFR0 to say we don't support anything. Date: Fri, 23 Mar 2012 11:08:49 +1030 Message-ID: <87obro882u.fsf@rustcorp.com.au> References: <4F590411.9060201@arm.com> <87ty1g88dv.fsf@rustcorp.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org To: Marc Zyngier , Christoffer Dall , Peter Maydell Return-path: Received: from ozlabs.org ([203.10.76.45]:41679 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755669Ab2CWAoV (ORCPT ); Thu, 22 Mar 2012 20:44:21 -0400 In-Reply-To: <87ty1g88dv.fsf@rustcorp.com.au> Sender: kvm-owner@vger.kernel.org List-ID: The guest should be checking this before trying to use performance monitors, for example. Signed-off-by: Rusty Russell diff --git a/arch/arm/kvm/emulate.c b/arch/arm/kvm/emulate.c index e356d1c..c07eb2b 100644 --- a/arch/arm/kvm/emulate.c +++ b/arch/arm/kvm/emulate.c @@ -238,6 +238,15 @@ static bool read_l2ctlr(struct kvm_vcpu *vcpu, return true; } +static bool read_id_dfr0(struct kvm_vcpu *vcpu, + const struct coproc_params *p, + unsigned long arg) +{ + /* We support no performance monitors (27-24 = b1111) and no debug */ + *vcpu_reg(vcpu, p->Rt1) = 0x0F000000; + return true; +} + static bool access_cp15_reg(struct kvm_vcpu *vcpu, const struct coproc_params *p, unsigned long cp15_reg) @@ -277,6 +286,9 @@ struct coproc_emulate { #define RW .is_w = DF static const struct coproc_emulate coproc_emulate[] = { + /* ID_DFR0 (guest asks what PMU/debug we support) */ + { CRn( 0), CRm( 1), Op1( 0), Op2( 2), is32, READ, read_id_dfr0}, + /* * L2CTLR access: *