All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Loïc Minier" <lool@dooz.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Ignore writes of perf reg (cp15 with crm == 12)
Date: Wed, 28 Jul 2010 16:23:05 +0200	[thread overview]
Message-ID: <20100728142305.GF13511@bee.dooz.org> (raw)
In-Reply-To: <1280086076-20649-1-git-send-email-loic.minier@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]

 I found out Matt Waddel has written a better looking patch, but I
 didn't test it; reviews welcome -- attached

-- 
Loïc Minier

[-- Attachment #2: Type: message/rfc822, Size: 5566 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2.1.2: cp15-9-pmcr.patch --]
[-- Type: text/x-diff, Size: 2508 bytes --]

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 7440163..b5d8a6c 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -130,6 +130,7 @@ typedef struct CPUARMState {
         uint32_t c6_data;
         uint32_t c9_insn; /* Cache lockdown registers.  */
         uint32_t c9_data;
+        uint32_t c9_pmcr_data; /* Performance Monitor Control Register */
         uint32_t c12_vbar; /* secure/nonsecure vector base address register. */
         uint32_t c12_mvbar; /* monitor vector base address register. */
         uint32_t c13_fcse; /* FCSE PID.  */
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 1f5f307..2136c07 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -1558,6 +1558,15 @@ void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val)
         case 1: /* TCM memory region registers.  */
             /* Not implemented.  */
             goto bad_reg;
+        case 12:
+            switch (op2) {
+            case 0:
+                env->cp15.c9_pmcr_data = val;
+                break;
+            default:
+                goto bad_reg;
+            }
+            break;
         default:
             goto bad_reg;
         }
@@ -1897,6 +1906,13 @@ uint32_t HELPER(get_cp15)(CPUState *env, uint32_t insn)
                 goto bad_reg;
             /* L2 Lockdown and Auxiliary control.  */
             return 0;
+        case 12:
+            switch (op2) {
+            case 0:
+                return env->cp15.c9_pmcr_data;
+            default:
+                goto bad_reg;
+            }
         default:
             goto bad_reg;
         }
diff --git a/target-arm/machine.c b/target-arm/machine.c
index 8595549..026776d 100644
--- a/target-arm/machine.c
+++ b/target-arm/machine.c
@@ -46,6 +46,7 @@ void cpu_save(QEMUFile *f, void *opaque)
     qemu_put_be32(f, env->cp15.c6_data);
     qemu_put_be32(f, env->cp15.c9_insn);
     qemu_put_be32(f, env->cp15.c9_data);
+    qemu_put_be32(f, env->cp15.c9_pmcr_data);
     qemu_put_be32(f, env->cp15.c13_fcse);
     qemu_put_be32(f, env->cp15.c13_context);
     qemu_put_be32(f, env->cp15.c13_tls1);
@@ -156,6 +157,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
     env->cp15.c6_data = qemu_get_be32(f);
     env->cp15.c9_insn = qemu_get_be32(f);
     env->cp15.c9_data = qemu_get_be32(f);
+    env->cp15.c9_pmcr_data = qemu_get_be32(f);
     env->cp15.c13_fcse = qemu_get_be32(f);
     env->cp15.c13_context = qemu_get_be32(f);
     env->cp15.c13_tls1 = qemu_get_be32(f);


  parent reply	other threads:[~2010-07-28 14:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-25 19:27 [Qemu-devel] [PATCH] Ignore writes of perf reg (cp15 with crm == 12) Loïc Minier
2010-07-28 11:29 ` [Qemu-devel] " Arnd Bergmann
2010-07-28 14:23 ` Loïc Minier [this message]
2010-07-30 21:30   ` [Qemu-devel] " Aurelien Jarno

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=20100728142305.GF13511@bee.dooz.org \
    --to=lool@dooz.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.