qemu-devel
[Top][All Lists]
Advanced

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

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


From: Richard Henderson
Subject: Re: [PATCH] target/arm: Fix BTI versus CF_PCREL
Date: Tue, 30 Jul 2024 21:33:40 +1000
User-agent: Mozilla Thunderbird

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 flags = probe_access_full(env, addr, 0, MMU_INST_FETCH, mmu_idx,
+                                  false, &host, &full, 0);
+
+    assert(!(flags & TLB_INVALID_MASK));

Is there a race condition here where some other vCPU
knocks this entry out of the TLB between the point when
we started executing the TB and when we made this helper
function call ?

I don't think so, because cross-cpu flushes use async_safe_run_on_cpu, which will wait until this cpu returns to the main loop. But it's just as easy to allow this probe to fault and unwind, Just In Case.


r~



reply via email to

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