* [PATCH] target/i386: Use probe_access_full_mmu in ptw_translate
@ 2024-10-09 0:20 Richard Henderson
2024-10-09 3:48 ` Philippe Mathieu-Daudé
2024-10-09 8:12 ` Alex Bennée
0 siblings, 2 replies; 4+ messages in thread
From: Richard Henderson @ 2024-10-09 0:20 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, pbonzini, qemu-stable
The probe_access_full_mmu function was designed for this purpose,
and does not report the memory operation event to plugins.
Cc: qemu-stable@nongnu.org
Fixes: 6d03226b422 ("plugins: force slow path when plugins instrument memory ops")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/i386/tcg/sysemu/excp_helper.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
index 8fb05b1f53..8f4dc08535 100644
--- a/target/i386/tcg/sysemu/excp_helper.c
+++ b/target/i386/tcg/sysemu/excp_helper.c
@@ -62,12 +62,11 @@ typedef struct PTETranslate {
static bool ptw_translate(PTETranslate *inout, hwaddr addr, uint64_t ra)
{
- CPUTLBEntryFull *full;
int flags;
inout->gaddr = addr;
- flags = probe_access_full(inout->env, addr, 0, MMU_DATA_STORE,
- inout->ptw_idx, true, &inout->haddr, &full, ra);
+ flags = probe_access_full_mmu(inout->env, addr, 0, MMU_DATA_STORE,
+ inout->ptw_idx, &inout->haddr, NULL);
if (unlikely(flags & TLB_INVALID_MASK)) {
TranslateFault *err = inout->err;
@@ -429,9 +428,8 @@ do_check_protect_pse36:
CPUTLBEntryFull *full;
int flags, nested_page_size;
- flags = probe_access_full(env, paddr, 0, access_type,
- MMU_NESTED_IDX, true,
- &pte_trans.haddr, &full, 0);
+ flags = probe_access_full_mmu(env, paddr, 0, access_type,
+ MMU_NESTED_IDX, &pte_trans.haddr, &full);
if (unlikely(flags & TLB_INVALID_MASK)) {
*err = (TranslateFault){
.error_code = env->error_code,
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] target/i386: Use probe_access_full_mmu in ptw_translate
2024-10-09 0:20 [PATCH] target/i386: Use probe_access_full_mmu in ptw_translate Richard Henderson
@ 2024-10-09 3:48 ` Philippe Mathieu-Daudé
2024-10-11 19:00 ` Richard Henderson
2024-10-09 8:12 ` Alex Bennée
1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-10-09 3:48 UTC (permalink / raw)
To: Richard Henderson, qemu-devel; +Cc: alex.bennee, pbonzini, qemu-stable
On 8/10/24 21:20, Richard Henderson wrote:
> The probe_access_full_mmu function was designed for this purpose,
> and does not report the memory operation event to plugins.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 6d03226b422 ("plugins: force slow path when plugins instrument memory ops")
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/i386/tcg/sysemu/excp_helper.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
> index 8fb05b1f53..8f4dc08535 100644
> --- a/target/i386/tcg/sysemu/excp_helper.c
> +++ b/target/i386/tcg/sysemu/excp_helper.c
> @@ -62,12 +62,11 @@ typedef struct PTETranslate {
>
> static bool ptw_translate(PTETranslate *inout, hwaddr addr, uint64_t ra)
We can remove the @ra argument; maybe clearer to do it in a
separate commit.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/i386: Use probe_access_full_mmu in ptw_translate
2024-10-09 3:48 ` Philippe Mathieu-Daudé
@ 2024-10-11 19:00 ` Richard Henderson
0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2024-10-11 19:00 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: alex.bennee, pbonzini, qemu-stable
On 10/8/24 20:48, Philippe Mathieu-Daudé wrote:
> On 8/10/24 21:20, Richard Henderson wrote:
>> The probe_access_full_mmu function was designed for this purpose,
>> and does not report the memory operation event to plugins.
>>
>> Cc: qemu-stable@nongnu.org
>> Fixes: 6d03226b422 ("plugins: force slow path when plugins instrument memory ops")
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>> target/i386/tcg/sysemu/excp_helper.c | 10 ++++------
>> 1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
>> index 8fb05b1f53..8f4dc08535 100644
>> --- a/target/i386/tcg/sysemu/excp_helper.c
>> +++ b/target/i386/tcg/sysemu/excp_helper.c
>> @@ -62,12 +62,11 @@ typedef struct PTETranslate {
>> static bool ptw_translate(PTETranslate *inout, hwaddr addr, uint64_t ra)
>
> We can remove the @ra argument; maybe clearer to do it in a
> separate commit.
Good idea.
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/i386: Use probe_access_full_mmu in ptw_translate
2024-10-09 0:20 [PATCH] target/i386: Use probe_access_full_mmu in ptw_translate Richard Henderson
2024-10-09 3:48 ` Philippe Mathieu-Daudé
@ 2024-10-09 8:12 ` Alex Bennée
1 sibling, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2024-10-09 8:12 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel, pbonzini, qemu-stable
Richard Henderson <richard.henderson@linaro.org> writes:
> The probe_access_full_mmu function was designed for this purpose,
> and does not report the memory operation event to plugins.
I note the kdoc for probe_access_full_mmu has the wrong title. It might
be worth referencing the fault and instrumentation behaviour in the
probe_access_full() kdoc as well.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 6d03226b422 ("plugins: force slow path when plugins instrument memory ops")
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/i386/tcg/sysemu/excp_helper.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c
> index 8fb05b1f53..8f4dc08535 100644
> --- a/target/i386/tcg/sysemu/excp_helper.c
> +++ b/target/i386/tcg/sysemu/excp_helper.c
> @@ -62,12 +62,11 @@ typedef struct PTETranslate {
>
> static bool ptw_translate(PTETranslate *inout, hwaddr addr, uint64_t ra)
> {
> - CPUTLBEntryFull *full;
> int flags;
>
> inout->gaddr = addr;
> - flags = probe_access_full(inout->env, addr, 0, MMU_DATA_STORE,
> - inout->ptw_idx, true, &inout->haddr, &full, ra);
> + flags = probe_access_full_mmu(inout->env, addr, 0, MMU_DATA_STORE,
> + inout->ptw_idx, &inout->haddr, NULL);
>
> if (unlikely(flags & TLB_INVALID_MASK)) {
> TranslateFault *err = inout->err;
> @@ -429,9 +428,8 @@ do_check_protect_pse36:
> CPUTLBEntryFull *full;
> int flags, nested_page_size;
>
> - flags = probe_access_full(env, paddr, 0, access_type,
> - MMU_NESTED_IDX, true,
> - &pte_trans.haddr, &full, 0);
> + flags = probe_access_full_mmu(env, paddr, 0, access_type,
> + MMU_NESTED_IDX, &pte_trans.haddr, &full);
> if (unlikely(flags & TLB_INVALID_MASK)) {
> *err = (TranslateFault){
> .error_code = env->error_code,
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-11 19:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 0:20 [PATCH] target/i386: Use probe_access_full_mmu in ptw_translate Richard Henderson
2024-10-09 3:48 ` Philippe Mathieu-Daudé
2024-10-11 19:00 ` Richard Henderson
2024-10-09 8:12 ` Alex Bennée
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).