qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/8] PPC: booke: add tlbnps handling


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 6/8] PPC: booke: add tlbnps handling
Date: Mon, 23 Jan 2012 18:33:00 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8

On 01/23/2012 06:29 PM, Scott Wood wrote:
On 01/20/2012 10:15 PM, Alexander Graf wrote:
+/* returns bitmap of supported page sizes for a given TLB */
+static inline uint32_t booke206_tlbnps(CPUState *env, const int tlbn)
+{
+    bool mav2 = false;
+    uint32_t ret = 0;
+
+    if (mav2) {
+        ret = env->spr[SPR_BOOKE_TLB0PS + tlbn];
+    } else {
+        uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];
+        uint32_t min = (tlbncfg&  TLBnCFG_MINSIZE)>>  TLBnCFG_MINSIZE_SHIFT;
+        uint32_t max = (tlbncfg&  TLBnCFG_MAXSIZE)>>  TLBnCFG_MAXSIZE_SHIFT;
+        int i;
+        for (i = min; i<= max; i++) {
+            ret |= (1<<  (i<<  1));
+        }
+    }
For mav1 only the even sizes are supported.

Yes, which is why min and max are >> 1 compared to the MAV2 values.

Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]