From: "Rusty Russell" <rusty.russell@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>,
Christoffer Dall <c.dall@virtualopensystems.com>,
Peter Maydell <Peter.Maydell@arm.com>
Cc: android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: [PATCH] ARM: KVM: Emulate ID_DFR0 to say we don't support anything.
Date: Fri, 23 Mar 2012 11:08:49 +1030 [thread overview]
Message-ID: <87obro882u.fsf@rustcorp.com.au> (raw)
In-Reply-To: <87ty1g88dv.fsf@rustcorp.com.au>
The guest should be checking this before trying to use performance monitors,
for example.
Signed-off-by: Rusty Russell <rusty.russell@linaro.org>
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:
*
next parent reply other threads:[~2012-03-23 0:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4F590411.9060201@arm.com>
[not found] ` <87ty1g88dv.fsf@rustcorp.com.au>
2012-03-23 0:38 ` Rusty Russell [this message]
2012-03-23 9:04 ` [Android-virt] [PATCH] ARM: KVM: Emulate ID_DFR0 to say we don't support anything Peter Maydell
2012-03-23 23:23 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87obro882u.fsf@rustcorp.com.au \
--to=rusty.russell@linaro.org \
--cc=Peter.Maydell@arm.com \
--cc=android-virt@lists.cs.columbia.edu \
--cc=c.dall@virtualopensystems.com \
--cc=kvm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox