diff mbox series

[10/24] target/arm/cpu: Restrict cpu_untagged_addr() to user emulation

Message ID 20241114011310.3615-11-philmd@linaro.org
State Superseded
Headers show
Series exec: Build up 'cputlb.h' and 'ram_addr.h' headers | expand

Commit Message

Philippe Mathieu-Daudé Nov. 14, 2024, 1:12 a.m. UTC
Move the #endif guard where it belongs to restrict
the cpu_untagged_addr() implementation to user
emulation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/arm/cpu.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Pierrick Bouvier Nov. 14, 2024, 4:12 a.m. UTC | #1
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote:
> Move the #endif guard where it belongs to restrict
> the cpu_untagged_addr() implementation to user
> emulation.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/arm/cpu.h | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index d86e641280..12b8466542 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -3355,8 +3355,8 @@ extern const uint64_t pred_esz_masks[5];
>   #define TAG_GRANULE      (1 << LOG2_TAG_GRANULE)
>   
>   #ifdef CONFIG_USER_ONLY
> +
>   #define TARGET_PAGE_DATA_SIZE (TARGET_PAGE_SIZE >> (LOG2_TAG_GRANULE + 1))
> -#endif
>   
>   #ifdef TARGET_TAGGED_ADDRESSES
>   /**
> @@ -3382,6 +3382,7 @@ static inline target_ulong cpu_untagged_addr(CPUState *cs, target_ulong x)
>       }
>       return x;
>   }
> -#endif
> +#endif /* TARGET_TAGGED_ADDRESSES */
> +#endif /* CONFIG_USER_ONLY */
>   
>   #endif

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Richard Henderson Nov. 14, 2024, 7:03 p.m. UTC | #2
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote:
> Move the #endif guard where it belongs to restrict
> the cpu_untagged_addr() implementation to user
> emulation.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/arm/cpu.h | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index d86e641280..12b8466542 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -3355,8 +3355,8 @@ extern const uint64_t pred_esz_masks[5];
>   #define TAG_GRANULE      (1 << LOG2_TAG_GRANULE)
>   
>   #ifdef CONFIG_USER_ONLY
> +
>   #define TARGET_PAGE_DATA_SIZE (TARGET_PAGE_SIZE >> (LOG2_TAG_GRANULE + 1))
> -#endif
>   
>   #ifdef TARGET_TAGGED_ADDRESSES
>   /**
> @@ -3382,6 +3382,7 @@ static inline target_ulong cpu_untagged_addr(CPUState *cs, target_ulong x)
>       }
>       return x;
>   }
> -#endif
> +#endif /* TARGET_TAGGED_ADDRESSES */
> +#endif /* CONFIG_USER_ONLY */
>   
>   #endif

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index d86e641280..12b8466542 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3355,8 +3355,8 @@  extern const uint64_t pred_esz_masks[5];
 #define TAG_GRANULE      (1 << LOG2_TAG_GRANULE)
 
 #ifdef CONFIG_USER_ONLY
+
 #define TARGET_PAGE_DATA_SIZE (TARGET_PAGE_SIZE >> (LOG2_TAG_GRANULE + 1))
-#endif
 
 #ifdef TARGET_TAGGED_ADDRESSES
 /**
@@ -3382,6 +3382,7 @@  static inline target_ulong cpu_untagged_addr(CPUState *cs, target_ulong x)
     }
     return x;
 }
-#endif
+#endif /* TARGET_TAGGED_ADDRESSES */
+#endif /* CONFIG_USER_ONLY */
 
 #endif