qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: qemu-ppc@nongnu.org, paulus@samba.org, agraf@suse.de,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH V9 2/5] target-ppc: Fix htab_mask calculation
Date: Wed, 12 Feb 2014 11:32:07 +0100	[thread overview]
Message-ID: <20140212113207.0d8fb3f9@bahia.local> (raw)
In-Reply-To: <87lhxhtrlq.fsf@linux.vnet.ibm.com>

On Wed, 12 Feb 2014 00:16:25 +0530
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:
> 
> Hi Greg,
> 
> can you try the below patch and see if it fix the TCG mode failure ?
> 
> -aneesh
> 

Hi Aneesh,

The patche fixes the issue indeed. Maybe a helper could be factored out
since we have 4 times the same magic formula :)

Cheers.

--
Greg

> commit d98b5098bc04f44ef4e175f689345e92cf469231
> Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> 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	other threads:[~2014-02-12 10:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28  7:59 [Qemu-devel] [PATCH V9 0/5] target-ppc: Add support for dumping guest memory using qemu gdb server Aneesh Kumar K.V
2014-01-28  7:59 ` [Qemu-devel] [PATCH V9 1/5] target-ppc: Update external_htab even when HTAB is managed by kernel Aneesh Kumar K.V
2014-01-28  8:00 ` [Qemu-devel] [PATCH V9 2/5] target-ppc: Fix htab_mask calculation Aneesh Kumar K.V
2014-02-11 18:46   ` Aneesh Kumar K.V
2014-02-12 10:32     ` Greg Kurz [this message]
2014-02-13  2:59   ` [Qemu-devel] [PATCH V10] " Aneesh Kumar K.V
2014-02-13 10:40     ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2014-02-13 14:51       ` Alexander Graf
2014-02-14 13:06         ` Alexander Graf
2014-02-14 13:54           ` Alexander Graf
2014-02-14 14:28             ` Alexander Graf
2014-02-14 14:42               ` Alexander Graf
2014-02-15 11:02                 ` Greg Kurz
2014-01-28  8:00 ` [Qemu-devel] [PATCH V9 3/5] target-ppc: Fix page table lookup with kvm enabled Aneesh Kumar K.V
2014-02-10 16:27   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2014-02-12 15:24     ` [Qemu-devel] [PATCH] target-ppc: fix 32 bit build break in the page table lookup code Greg Kurz
2014-02-13  3:00       ` Aneesh Kumar K.V
2014-02-13 14:53         ` Alexander Graf
2014-02-13 16:54           ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2014-02-14  9:25             ` Alexander Graf
2014-01-28  8:00 ` [Qemu-devel] [PATCH V9 4/5] target-ppc: Change the hpte sore API Aneesh Kumar K.V
2014-01-28  8:00 ` [Qemu-devel] [PATCH V9 5/5] target-ppc: Update ppc_hash64_store_hpte to support updating in-kernel htab Aneesh Kumar K.V
2014-02-10 15:25   ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2014-02-12 15:40     ` [Qemu-devel] [PATCH] target-ppc: fix warn_unused_result build break with in-kernel HTAB support Greg Kurz
2014-02-13  3:00       ` Aneesh Kumar K.V
2014-02-13 14:51         ` Alexander Graf
2014-02-06 14:58 ` [Qemu-devel] [PATCH V9 0/5] target-ppc: Add support for dumping guest memory using qemu gdb server Alexander Graf

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=20140212113207.0d8fb3f9@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).