From: "Roger Pau Monné" <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Grygorii Strashko <grygorii_strashko@epam.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Teddy Astie <teddy.astie@vates.tech>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/domain: restrict context switch hooks for the idle domain
Date: Fri, 2 Oct 2026 10:05:48 +0200 [thread overview]
Message-ID: <ar9l3GKKZtIjfgaP@Mac.lan> (raw)
In-Reply-To: <4eb32155-1b04-4f04-ab9b-f30e584cb033@suse.com>
On Fri, Oct 02, 2026 at 09:55:09AM +0200, Jan Beulich wrote:
> On 02.10.2026 09:48, Roger Pau Monné wrote:
> > On Fri, Oct 02, 2026 at 07:45:07AM +0200, Jan Beulich wrote:
> >> On 01.10.2026 16:27, Roger Pau Monne wrote:
> >>> --- a/xen/arch/x86/domain.c
> >>> +++ b/xen/arch/x86/domain.c
> >>> @@ -813,8 +813,6 @@ static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
> >>> void __init arch_init_idle_domain(struct domain *d)
> >>> {
> >>> static const struct arch_csw idle_csw = {
> >>> - .from = paravirt_ctxt_switch_from,
> >>> - .to = paravirt_ctxt_switch_to,
> >>> .tail = idle_loop,
> >>> };
> >>
> >> Leaving NULL pointers around isn't a good thing, though. May I suggest to
> >> at least poison the pointers then?
> >
> > I don't mind doing so, but I don't think we usually do that for other
> > hook structures, ie: hvm_function_table for example doesn't poison
> > unset hooks (and it possibly can't, because there are .hook != NULL
> > checks).
> >
> > TBH I'm missing a benefit of the poisoning here. Using NULL or a
> > poisoned value will both trigger a page-fault, and NULL has the
> > benefit of callers easily checking whether the hook is set.
>
> NULL in the context of a HVM vCPU will #PF. NULL in the context of a PV
> one may not, depending on what the guest may have put there.
It still feels a bit arbitrary to do here but not in other places, but
never mind, I will adjust and send v2.
Thanks, Roger.
next prev parent reply other threads:[~2026-10-02 8:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 14:27 [PATCH] x86/domain: restrict context switch hooks for the idle domain Roger Pau Monne
2026-10-01 15:17 ` Juergen Gross
2026-10-01 17:23 ` Jason Andryuk
2026-10-02 5:45 ` Jan Beulich
2026-10-02 7:48 ` Roger Pau Monné
2026-10-02 7:55 ` Jan Beulich
2026-10-02 8:05 ` Roger Pau Monné [this message]
2026-10-02 8:09 ` Jan Beulich
2026-10-02 9:23 ` Roger Pau Monné
2026-10-02 9:29 ` Roger Pau Monné
2026-10-02 9:35 ` Jan Beulich
2026-10-02 9:49 ` Roger Pau Monné
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=ar9l3GKKZtIjfgaP@Mac.lan \
--to=roger@xenproject.org \
--cc=andrew.cooper3@citrix.com \
--cc=grygorii_strashko@epam.com \
--cc=jbeulich@suse.com \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.