qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Phil Dennis-Jordan <phil@philjordan.eu>,
	Roman Bolshakov <rbolshakov@ddn.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Cameron Esfahani <dirty@apple.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Alexander Graf <agraf@csgraf.de>,
	Peter Maydell <peter.maydell@linaro.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH 03/11] i386/hvf: Don't send signal to thread when kicking
Date: Wed, 5 Feb 2025 21:58:34 +0100	[thread overview]
Message-ID: <efbf797d-b426-4c33-aba6-e463880ae667@linaro.org> (raw)
In-Reply-To: <CAAibmn0zwbsniR2bLcvhqTuTdPZTRkQPDv9v9==gyMpPNELLLA@mail.gmail.com>

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	other threads:[~2025-02-05 20:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 20:36 [PATCH 00/11] hvf and APIC fixes, improvements, and optimisations phil
2024-12-09 20:36 ` [PATCH 01/11] hvf: Add facility for initialisation code prior to first vCPU run phil
2024-12-10 10:05   ` Alexander Graf
2025-02-05 21:02   ` Philippe Mathieu-Daudé
2025-02-09 19:45     ` Phil Dennis-Jordan
2024-12-09 20:36 ` [PATCH 02/11] arm/hvf: Initialise GICv3 state just before " phil
2024-12-10 10:05   ` Alexander Graf
2025-02-05 14:47   ` Zenghui Yu
2024-12-09 20:36 ` [PATCH 03/11] i386/hvf: Don't send signal to thread when kicking phil
2024-12-09 21:22   ` Philippe Mathieu-Daudé
2024-12-10  8:17     ` Phil Dennis-Jordan
2024-12-10  9:21     ` Roman Bolshakov
2024-12-10  9:52       ` Phil Dennis-Jordan
2025-02-05 20:58         ` Philippe Mathieu-Daudé [this message]
2024-12-09 20:36 ` [PATCH 04/11] i386/hvf: Pre-fetch emulated instructions phil
2024-12-09 20:36 ` [PATCH 05/11] i386/hvf: Decode APIC access x86 instruction outside BQL phil
2024-12-09 20:36 ` [PATCH 06/11] i386/hvf: APIC access exit with fast-path for common mov cases phil
2024-12-09 20:36 ` [PATCH 07/11] i386/hvf: Enables APIC_ACCESS VM exits by setting APICBASE phil
2024-12-09 20:36 ` [PATCH 08/11] i386/hvf: Variable type fixup in decoder phil
2024-12-09 20:49   ` Philippe Mathieu-Daudé
2024-12-09 20:36 ` [PATCH 09/11] i386/hvf: Print hex pairs for each opcode byte in decode error phil
2024-12-09 20:54   ` Philippe Mathieu-Daudé
2024-12-10 11:28     ` Phil Dennis-Jordan
2024-12-09 20:36 ` [PATCH 10/11] hw/intc/apic: Fixes magic number use, removes outdated comment phil
2024-12-09 20:55   ` Philippe Mathieu-Daudé
2024-12-09 20:36 ` [PATCH 11/11] hw/intc/apic: Raise exception when setting reserved APICBASE bits phil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=efbf797d-b426-4c33-aba6-e463880ae667@linaro.org \
    --to=philmd@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=dirty@apple.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=phil@philjordan.eu \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rbolshakov@ddn.com \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).