qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH V9 2/5] target-ppc: Fix htab_mask calculation


From: Aneesh Kumar K.V
Subject: Re: [Qemu-ppc] [PATCH V9 2/5] target-ppc: Fix htab_mask calculation
Date: Wed, 12 Feb 2014 00:16:25 +0530
User-agent: Notmuch/0.17+7~gc734dd75344e (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)

Hi Greg,

can you try the below patch and see if it fix the TCG mode failure ?

-aneesh

commit d98b5098bc04f44ef4e175f689345e92cf469231
Author: Aneesh Kumar K.V <address@hidden>
Date:   Tue Feb 11 23:43:12 2014 +0530

    tcg fixes

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index e1f778faf3ae..d3aca706fdc9 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -91,7 +91,10 @@ static target_ulong h_enter(PowerPCCPU *cpu, 
sPAPREnvironment *spapr,
 
     pteh &= ~0x60ULL;
 
-    if ((pte_index * HASH_PTE_SIZE_64) & ~env->htab_mask) {
+    /*
+     * hash value/pteg group index is normalized by htab_mask
+     */
+    if (((pte_index & ~7ULL) / HPTES_PER_GROUP) & ~env->htab_mask) {
         return H_PARAMETER;
     }
 
@@ -140,7 +143,10 @@ static RemoveResult remove_hpte(CPUPPCState *env, 
target_ulong ptex,
     uint64_t token;
     target_ulong v, r, rb;
 
-    if ((ptex * HASH_PTE_SIZE_64) & ~env->htab_mask) {
+    /*
+     * hash value/pteg group index is normalized by htab_mask
+     */
+    if (((ptex & ~7ULL) / HPTES_PER_GROUP) & ~env->htab_mask) {
         return REMOVE_PARM;
     }
 
@@ -266,7 +272,10 @@ static target_ulong h_protect(PowerPCCPU *cpu, 
sPAPREnvironment *spapr,
     uint64_t token;
     target_ulong v, r, rb;
 
-    if ((pte_index * HASH_PTE_SIZE_64) & ~env->htab_mask) {
+    /*
+     * hash value/pteg group index is normalized by htab_mask
+     */
+    if (((pte_index & ~7ULL) / HPTES_PER_GROUP) & ~env->htab_mask) {
         return H_PARAMETER;
     }
 
@@ -303,7 +312,10 @@ static target_ulong h_read(PowerPCCPU *cpu, 
sPAPREnvironment *spapr,
     uint8_t *hpte;
     int i, ridx, n_entries = 1;
 
-    if ((pte_index * HASH_PTE_SIZE_64) & ~env->htab_mask) {
+    /*
+     * hash value/pteg group index is normalized by htab_mask
+     */
+    if (((pte_index & ~7ULL) / HPTES_PER_GROUP) & ~env->htab_mask) {
         return H_PARAMETER;
     }
 




reply via email to

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