public inbox for linux-hyperv@vger.kernel.org
 help / color / mirror / Atom feed
From: vdso@mailbox.org
To: Anirudh Rayabharam <anirudh@anirudhrb.com>
Cc: kys@microsoft.com, decui@microsoft.com, haiyangz@microsoft.com,
	linux-kernel@vger.kernel.org, longli@microsoft.com,
	wei.liu@kernel.org, linux-hyperv@vger.kernel.org
Subject: Re: [PATCH 1/3] hyperv: add definitions for arm64 gpa intercepts
Date: Tue, 16 Dec 2025 21:46:48 -0800 (PST)	[thread overview]
Message-ID: <549411914.201492.1765950408211@app.mailbox.org> (raw)
In-Reply-To: <jhyqp7vlqsmnps52cgzzuyon3aihcxizog4bknnofuibhud5ry@3nix3cwzwapw>


> On 12/16/2025 9:08 PM  Anirudh Rayabharam <anirudh@anirudhrb.com> wrote:
> 
>  
> On Tue, Dec 16, 2025 at 07:07:45AM -0800, vdso@mailbox.org wrote:
> > 
> > > On 12/16/2025 6:20 AM  Anirudh Rayabharam <anirudh@anirudhrb.com> wrote:
> > 
> > [...]
> > 
> > > +#if IS_ENABLED(CONFIG_ARM64)
> > > +union hv_arm64_vp_execution_state {
> > > +	u16 as_uint16;
> > > +	struct {
> > > +		u16 cpl:2;
> > 
> > That looks oddly x86(-64)-specific (Current Priviledge Level).
> > 
> > Unless I'm mistaken, CPL doesn't belong here, and the bitfield isn't
> > used on ARM64. Provided the layout of the struct is correct, the
> > bitfield can have a better name of `reserved0` or something like that.
> 
> Hmmm... this is how it is defined in the hypervisor headers though.

The questions would be why the hypervisor has got that there (e.g., the
definitions of that struct for x86 and ARM64 are merged), and if Linux needs
to care about the reason valid in the hv's codebase. Perhaps the definitions
are merged there to write less arch-specific code, similar to what Stas suggested
for the patch 2.

I haven't been able to find anything called CPL in the ARM64 arch docs, and
that field really sticks out as the x86-64's CPL. Naming it like that in an
ARM64-specific structure doesn't look justified.

  reply	other threads:[~2025-12-17  5:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 14:20 [PATCH 0/3] Fixes for movable pages Anirudh Rayabharam
2025-12-16 14:20 ` [PATCH 1/3] hyperv: add definitions for arm64 gpa intercepts Anirudh Rayabharam
2025-12-16 15:07   ` vdso
2025-12-17  5:08     ` Anirudh Rayabharam
2025-12-17  5:46       ` vdso [this message]
2025-12-18 20:06       ` Wei Liu
2025-12-16 14:20 ` [PATCH 2/3] mshv: handle gpa intercepts for arm64 Anirudh Rayabharam
2025-12-16 16:11   ` Stanislav Kinsburskii
2025-12-17  5:10     ` Anirudh Rayabharam
2025-12-16 14:20 ` [PATCH 3/3] mshv: release mutex on region invalidation failure Anirudh Rayabharam
2025-12-16 15:14   ` vdso
2025-12-16 16:18   ` Stanislav Kinsburskii
2025-12-18 20:01   ` Wei Liu

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=549411914.201492.1765950408211@app.mailbox.org \
    --to=vdso@mailbox.org \
    --cc=anirudh@anirudhrb.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=wei.liu@kernel.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