From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "mingo@redhat.com" <mingo@redhat.com>,
"kas@kernel.org" <kas@kernel.org>,
"tglx@kernel.org" <tglx@kernel.org>,
"bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"seanjc@google.com" <seanjc@google.com>,
"binbin.wu@linux.intel.com" <binbin.wu@linux.intel.com>,
"Li, Xiaoyao" <xiaoyao.li@intel.com>,
"sathyanarayanan.kuppuswamy@linux.intel.com"
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"david.laight.linux@gmail.com" <david.laight.linux@gmail.com>,
"Huang, Kai" <kai.huang@intel.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"tsyrulnikov.borys@gmail.com" <tsyrulnikov.borys@gmail.com>,
"djbw@kernel.org" <djbw@kernel.org>,
"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v4 2/3] x86/insn-eval: Add insn_assign_reg() helper
Date: Wed, 1 Jul 2026 00:06:33 +0000 [thread overview]
Message-ID: <a038a3dabd917b0da28059fc7b0116996b099868.camel@intel.com> (raw)
In-Reply-To: <daac026e677c10b68740b16ed8ad2556bd9583f8.1780584300.git.kas@kernel.org>
On Thu, 2026-06-04 at 15:47 +0100, Kiryl Shutsemau (Meta) wrote:
> KVM's instruction emulator has a small helper, assign_register(), that
> writes a value into a sub-register with x86 partial-register-write
> semantics: 1- and 2-byte writes leave the upper bits of the destination
> untouched, 4-byte writes zero-extend to 64 bits, 8-byte writes overwrite
> the full register.
>
> The TDX guest #VE handler needs the same logic for port I/O emulation
> to get 32-bit zero-extension right. Rather than copy-pasting the helper,
> lift it to <asm/insn-eval.h> as insn_assign_reg() so both can use it.
>
> Rewrite the body using arithmetic instead of pointer punning so the
> helper does not depend on -fno-strict-aliasing or little-endian byte
> order, and add <asm/insn.h> to the header's includes so it builds
> standalone in callers that have not pulled it in transitively.
>
> No functional change.
>
> Signed-off-by: Kiryl Shutsemau <kas@kernel.org>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
We should probably ping Sean/Paolo to ack this if we want Dave to take it. Is it
the plan?
next prev parent reply other threads:[~2026-07-01 0:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 14:46 [PATCH v4 0/3] x86/tdx: Fix port I/O handling bugs Kiryl Shutsemau (Meta)
2026-06-04 14:46 ` [PATCH v4 1/3] x86/tdx: Fix off-by-one in port I/O handling Kiryl Shutsemau (Meta)
2026-06-05 7:08 ` Binbin Wu
2026-07-01 0:06 ` Edgecombe, Rick P
2026-06-04 14:47 ` [PATCH v4 2/3] x86/insn-eval: Add insn_assign_reg() helper Kiryl Shutsemau (Meta)
2026-07-01 0:06 ` Edgecombe, Rick P [this message]
2026-07-01 0:28 ` Borislav Petkov
2026-07-01 13:25 ` Sean Christopherson
2026-06-04 14:47 ` [PATCH v4 3/3] x86/tdx: Fix zero-extension for 32-bit port I/O Kiryl Shutsemau (Meta)
2026-06-05 7:10 ` Binbin Wu
2026-06-05 11:57 ` Kiryl Shutsemau
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=a038a3dabd917b0da28059fc7b0116996b099868.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=ak@linux.intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david.laight.linux@gmail.com \
--cc=djbw@kernel.org \
--cc=kai.huang@intel.com \
--cc=kas@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=seanjc@google.com \
--cc=tglx@kernel.org \
--cc=tsyrulnikov.borys@gmail.com \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
/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