From: "Roger Pau Monné" <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen/x86: restrict XENFEAT_pae_pgdir_above_4gb setting to PV guests
Date: Thu, 1 Oct 2026 10:29:20 +0200 [thread overview]
Message-ID: <ar4Z4EQo7FulrZXF@Mac.lan> (raw)
In-Reply-To: <a9d59bc1-6e21-4a8b-84e5-6daac02997c3@suse.com>
On Thu, Oct 01, 2026 at 09:34:34AM +0200, Jan Beulich wrote:
> On 30.09.2026 21:11, Roger Pau Monne wrote:
> > @@ -692,7 +690,9 @@ long do_xen_version(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
> > if ( is_pv_domain(d) )
> > fi.submap |= (1U << XENFEAT_mmu_pt_update_preserve_ad) |
> > (1U << XENFEAT_highmem_assist) |
> > - (1U << XENFEAT_gnttab_map_avail_bits);
> > + (1U << XENFEAT_gnttab_map_avail_bits) |
> > + (VM_ASSIST(d, pae_extended_cr3) ?
> > + (1U << XENFEAT_pae_pgdir_above_4gb) : 0);
>
> Nit: Unlike binary operators, which we want to have placed at the end of
> wrapped lines, we generally prefer the ternary operator to be wrapped
> differently. E.g.
>
> (VM_ASSIST(d, pae_extended_cr3)
> ? (1U << XENFEAT_pae_pgdir_above_4gb) : 0);
>
> or
>
> (VM_ASSIST(d, pae_extended_cr3)
> ? (1U << XENFEAT_pae_pgdir_above_4gb)
> : 0);
>
> This isn't written down anywhere, so I'm not going to insist.
I had it written as your first proposal, but then moved the ternary
operator at the end of the line as I've assumed it would be prefer to
match the position of the binary ones.
> Furthermore, wouldn't it be plausible to also add IS_ENABLED(CONFIG_PV32)
> (or, imo less desirably, opt_pv32)?
I could do:
if ( IS_ENABLED(CONFIG_PV32) && VM_ASSIST(d, pae_extended_cr3) )
fi.submap |= 1U << XENFEAT_pae_pgdir_above_4gb
As I think adding the IS_ENABLED(CONFIG_PV32) check to the previous
expression is too much.
Let me know your preference.
Thanks, Roger.
next prev parent reply other threads:[~2026-10-01 8:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 19:11 [PATCH] xen/x86: restrict XENFEAT_pae_pgdir_above_4gb setting to PV guests Roger Pau Monne
2026-09-30 20:42 ` Teddy Astie
2026-10-01 7:34 ` Jan Beulich
2026-10-01 8:29 ` Roger Pau Monné [this message]
2026-10-01 9:09 ` Andrew Cooper
2026-10-01 11:00 ` Jan Beulich
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=ar4Z4EQo7FulrZXF@Mac.lan \
--to=roger@xenproject.org \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.org \
--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.