The guest should be checking this before trying to use performance monitors,
for example.

Signed-off-by: Rusty Russell <[email protected]>

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:
         *
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to