qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH 03/11] i386/hvf: Don't send signal to thread when kicking


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 03/11] i386/hvf: Don't send signal to thread when kicking
Date: Wed, 5 Feb 2025 21:58:34 +0100
User-agent: Mozilla Thunderbird

On 10/12/24 10:52, Phil Dennis-Jordan wrote:


On Tue 10. Dec 2024 at 10:21, Roman Bolshakov <rbolshakov@ddn.com <mailto:rbolshakov@ddn.com>> wrote:

    On 10.12.2024 04:22, Philippe Mathieu-Daudé wrote:
     > On 9/12/24 21:36, phil@philjordan.eu <mailto:phil@philjordan.eu>
    wrote:
     >> From: Phil Dennis-Jordan <phil@philjordan.eu
    <mailto:phil@philjordan.eu>>
     >>
     >> This seems to be entirely superfluous and is costly enough to
    show up in
     >
     > So the pthread_kill(cpu->thread, SIG_IPI) is entirely superfluous?
     >
     >> profiling. hv_vcpu_interrupt() has been demonstrated to very
    reliably
     >> cause VM exits - even if the target vCPU isn't even running, it will
     >> immediately exit on entry.
     >>
     >> Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu
    <mailto:phil@philjordan.eu>>
     >> ---
     >>   target/i386/hvf/hvf.c | 2 +-
     >>   1 file changed, 1 insertion(+), 1 deletion(-)
     >>
     >> diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
     >> index 3b6ee79fb2..936c31dbdd 100644
     >> --- a/target/i386/hvf/hvf.c
     >> +++ b/target/i386/hvf/hvf.c
     >> @@ -214,7 +214,7 @@ static inline bool
     >> apic_bus_freq_is_known(CPUX86State *env)
     >>     void hvf_kick_vcpu_thread(CPUState *cpu)
     >>   {
     >> -    cpus_kick_thread(cpu);
     >> +    cpu->thread_kicked = true;
     >>       hv_vcpu_interrupt(&cpu->accel->fd, 1);
     >>   }
     >
    SIG_IPI is macOS crutch handled in XNU kernel that was essential until
    Phil submitted proper kick support with hv_vcpu_interrupt().

Ah yes, perhaps it allowed exit from hv_vcpu_run(). hv_vcpu_run_until() definitely does not exit early upon receiving SIG_IPI (USR1).

Maybe worth explaining and mentioning commit bf9bf2306cc ("i386/hvf:
In kick_vcpu use hv_vcpu_interrupt to force exit") in this patch
description?



reply via email to

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