All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
To: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix mask of pte index
Date: Tue, 21 May 2013 01:16:14 -0500	[thread overview]
Message-ID: <519B112E.7040100@linux.vnet.ibm.com> (raw)
In-Reply-To: <1369105221-26307-1-git-send-email-qiaonuohan@cn.fujitsu.com>

On 05/20/2013 10:00 PM, Qiao Nuohan wrote:
> Function walk_pte needs pte index to calculate virtual address. However, pte
> index of PAE paging or IA-32e paging is 9 bit, so the mask should be 0x1ff.
> ---
>  target-i386/arch_memory_mapping.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/target-i386/arch_memory_mapping.c b/target-i386/arch_memory_mapping.c
> index 844893f..a2eb7e7 100644
> --- a/target-i386/arch_memory_mapping.c
> +++ b/target-i386/arch_memory_mapping.c
> @@ -38,7 +38,7 @@ static void walk_pte(MemoryMappingList *list, hwaddr pte_start_addr,
>              continue;
>          }
> 
> -        start_vaddr = start_line_addr | ((i & 0x1fff) << 12);
> +        start_vaddr = start_line_addr | ((i & 0x1ff) << 12);
>          memory_mapping_list_add_merge_sorted(list, start_paddr,
>                                               start_vaddr, 1 << 12);
>      }
> 

Verified that this agrees with the spec for IA-32e/PAE paging. Note that
walk_pte2() is correct; only walk_pte() has the typo.

Reviewed by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>

Jesse Larrew
Software Engineer, KVM Team
IBM Linux Technology Center
Phone: (512) 973-2052 (T/L: 363-2052)
jlarrew@linux.vnet.ibm.com

  reply	other threads:[~2013-05-21  6:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21  3:00 [Qemu-devel] [PATCH] Fix mask of pte index Qiao Nuohan
2013-05-21  6:16 ` Jesse Larrew [this message]
2013-05-21 11:32   ` Andreas Färber
2013-05-21 12:05     ` Qiao Nuohan
2013-05-21 16:53       ` Andreas Färber
2013-05-22  1:21         ` Qiao Nuohan
2013-05-22  1:25           ` Qiao Nuohan
2013-05-22 12:48             ` Andreas Färber

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=519B112E.7040100@linux.vnet.ibm.com \
    --to=jlarrew@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qiaonuohan@cn.fujitsu.com \
    /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.