[PATCH v2 39/54] target/m68k: Do not call tlb_set_page in helper_ptest

Richard Henderson posted 54 patches 1 week, 2 days ago
[PATCH v2 39/54] target/m68k: Do not call tlb_set_page in helper_ptest
Posted by Richard Henderson 1 week, 2 days ago
The entire operation of ptest is performed within
get_physical_address as part of ACCESS_PTEST.
There is no need to install the page into softmmu.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/m68k/helper.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 1decb6f39c..0a54eca9bb 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -1460,7 +1460,6 @@ void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
     hwaddr physical;
     int access_type;
     int prot;
-    int ret;
     target_ulong page_size;
 
     access_type = ACCESS_PTEST;
@@ -1476,14 +1475,7 @@ void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
 
     env->mmu.mmusr = 0;
     env->mmu.ssw = 0;
-    ret = get_physical_address(env, &physical, &prot, addr,
-                               access_type, &page_size);
-    if (ret == 0) {
-        tlb_set_page(env_cpu(env), addr & TARGET_PAGE_MASK,
-                     physical & TARGET_PAGE_MASK,
-                     prot, access_type & ACCESS_SUPER ?
-                     MMU_KERNEL_IDX : MMU_USER_IDX, page_size);
-    }
+    get_physical_address(env, &physical, &prot, addr, access_type, &page_size);
 }
 
 void HELPER(pflush)(CPUM68KState *env, uint32_t addr, uint32_t opmode)
-- 
2.43.0
Re: [PATCH v2 39/54] target/m68k: Do not call tlb_set_page in helper_ptest
Posted by Pierrick Bouvier 1 week, 1 day ago
On 11/14/24 08:01, Richard Henderson wrote:
> The entire operation of ptest is performed within
> get_physical_address as part of ACCESS_PTEST.
> There is no need to install the page into softmmu.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/m68k/helper.c | 10 +---------
>   1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/target/m68k/helper.c b/target/m68k/helper.c
> index 1decb6f39c..0a54eca9bb 100644
> --- a/target/m68k/helper.c
> +++ b/target/m68k/helper.c
> @@ -1460,7 +1460,6 @@ void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
>       hwaddr physical;
>       int access_type;
>       int prot;
> -    int ret;
>       target_ulong page_size;
>   
>       access_type = ACCESS_PTEST;
> @@ -1476,14 +1475,7 @@ void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
>   
>       env->mmu.mmusr = 0;
>       env->mmu.ssw = 0;
> -    ret = get_physical_address(env, &physical, &prot, addr,
> -                               access_type, &page_size);
> -    if (ret == 0) {
> -        tlb_set_page(env_cpu(env), addr & TARGET_PAGE_MASK,
> -                     physical & TARGET_PAGE_MASK,
> -                     prot, access_type & ACCESS_SUPER ?
> -                     MMU_KERNEL_IDX : MMU_USER_IDX, page_size);
> -    }
> +    get_physical_address(env, &physical, &prot, addr, access_type, &page_size);
>   }
>   
>   void HELPER(pflush)(CPUM68KState *env, uint32_t addr, uint32_t opmode)

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>