From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDILy-00024I-Kl for qemu-devel@nongnu.org; Tue, 11 Feb 2014 13:46:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDILp-00075M-Lf for qemu-devel@nongnu.org; Tue, 11 Feb 2014 13:46:42 -0500 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:50979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDILp-00074n-0j for qemu-devel@nongnu.org; Tue, 11 Feb 2014 13:46:33 -0500 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Feb 2014 00:16:29 +0530 From: "Aneesh Kumar K.V" In-Reply-To: <1390896003-3195-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1390896003-3195-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1390896003-3195-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Date: Wed, 12 Feb 2014 00:16:25 +0530 Message-ID: <87lhxhtrlq.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH V9 2/5] target-ppc: Fix htab_mask calculation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: agraf@suse.de, paulus@samba.org, Greg Kurz Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org 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 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; }