Re: [PATCH] target/arm: Fix BTI versus CF_PCREL

2024-07-30 Thread Richard Henderson
On 7/30/24 19:30, Peter Maydell wrote: +static bool is_guarded_page(CPUARMState *env, target_ulong addr) +{ +#ifdef CONFIG_USER_ONLY +return page_get_flags(addr) & PAGE_BTI; +#else +CPUTLBEntryFull *full; +void *host; +int mmu_idx = cpu_mmu_index(env_cpu(env), true); +int flag

Re: [PATCH] target/arm: Fix BTI versus CF_PCREL

2024-07-30 Thread Peter Maydell
On Tue, 30 Jul 2024 at 03:07, Richard Henderson wrote: > > With pcrel, we cannot check the guarded page bit at translation > time, as different mappings of the same physical page may or may > not have the GP bit set. > > Instead, add a couple of helpers to check the page at runtime, > after all ot

Re: [PATCH] target/arm: Fix BTI versus CF_PCREL

2024-07-30 Thread Philippe Mathieu-Daudé
On 30/7/24 03:39, Richard Henderson wrote: With pcrel, we cannot check the guarded page bit at translation time, as different mappings of the same physical page may or may not have the GP bit set. Instead, add a couple of helpers to check the page at runtime, after all other filters that might o

[PATCH] target/arm: Fix BTI versus CF_PCREL

2024-07-29 Thread Richard Henderson
With pcrel, we cannot check the guarded page bit at translation time, as different mappings of the same physical page may or may not have the GP bit set. Instead, add a couple of helpers to check the page at runtime, after all other filters that might obviate the need for the check. The set_btype