qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 1/2] target/m68k: fix physical address translation in m68k


From: Laurent Vivier
Subject: Re: [PATCH v4 1/2] target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
Date: Mon, 6 Jul 2020 21:40:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

Le 01/07/2020 à 22:15, Mark Cave-Ayland a écrit :
> The result of the get_physical_address() function should be combined with the
> offset of the original page access before being returned. Otherwise the
> m68k_cpu_get_phys_page_debug() function can round to the wrong page causing
> incorrect lookups in gdbstub and various "Disassembler disagrees with
> translator over instruction decoding" warnings to appear at translation time.
> 
> Fixes: 88b2fef6c3 ("target/m68k: add MC68040 MMU")
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> ---
>  target/m68k/helper.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/target/m68k/helper.c b/target/m68k/helper.c
> index 79b0b10ea9..631eab7774 100644
> --- a/target/m68k/helper.c
> +++ b/target/m68k/helper.c
> @@ -820,10 +820,14 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr 
> addr)
>      if (env->sr & SR_S) {
>          access_type |= ACCESS_SUPER;
>      }
> +
>      if (get_physical_address(env, &phys_addr, &prot,
>                               addr, access_type, &page_size) != 0) {
>          return -1;
>      }
> +
> +    addr &= TARGET_PAGE_MASK;
> +    phys_addr += addr & (page_size - 1);
>      return phys_addr;
>  }
>  
> 

Applied to my m68k branch.

Thanks,
Laurent



reply via email to

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