All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Kulke <magnuskulke@linux.microsoft.com>
To: "Doru Blânzeanu" <dblanzeanu@linux.microsoft.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Wei Liu" <wei.liu@kernel.org>,
	"Magnus Kulke" <magnuskulke@microsoft.com>,
	"Doru Blânzeanu" <dblanzeanu@microsoft.com>,
	"Wei Liu" <liuwe@microsoft.com>
Subject: Re: [PATCH 0/5] Fix register page use for guests using mshv accel
Date: Mon, 12 Oct 2026 14:25:43 +0200	[thread overview]
Message-ID: <aszRx6JGOui7rLmd@example.com> (raw)
In-Reply-To: <20260707221645.24557-1-dblanzeanu@linux.microsoft.com>

On Wed, Jul 08, 2026 at 01:16:40AM +0300, Doru Blânzeanu wrote:
> This patch series is a fix for the recent merge of the outdated patch series:
> https://lore.kernel.org/all/20260428135053.251200-1-dblanzeanu@linux.microsoft.com/
> 
> The above patch series had some newer versions that fixed addressed feedback
> from reviewers.
> 
> The commits do the following:
> 1. Moves the definition for the `hv_vp_register_page` to `hvhdk.h`
>    Fixes: 8afb40b7fe
> 2. Changes the register page setup to fail in case the mmap of the page fails.
>    This way it signals an issue early.
>    Fixes: a173f8f170
> 3. Rename functions local to the `mshv-cpu.c` linked to register page get.
>    Use the register page to read registers on VM exit. General purpose
>    registers, RIP, RFLAGS, segment registers, and control registers
>    (CR0, CR4, CR4, CR8, EFER) are read directly from the page. Registers
>    not present on the page (TR, LDTR, GDTR, IDTR, CR2, APIC_BASE) are not
>    fetched anymore for performance reasons.
>    Removes the fallback to ioctls in case the register page is not correctly set
>    up and aborts.
>    Fixes: 40072a7391
> 4. Changes the registers storing to only use the register page and not rely on
>    ioctls for perfomance improvements. From local tests, the special registers
>    that are not stored, do not get modified when emulating. However, if there's
>    an issue discovered, we'll fix later.
>    Fixes: 80c7f8e9cd
> 5. When a device handler (e.g. vmport) calls cpu_synchronize_state() during
>    I/O port dispatch, it sets cpu->accel->dirty = true and may modify
>    registers directly in env. The old PIO code ignored this: it
>    unconditionally wrote the stale info->rax from the VM-exit intercept
>    message back to the hypervisor and then cleared dirty, discarding any
>    register changes made by the device.
>    Note: This was a change present in version 3 of the patch series but not
>    present in the version 1 of the patch series (the one merged)
> 
> The register page is only used when it has been successfully mmapped and
> the hypervisor has marked it as valid (`isvalid != 0`). Otherwise, an error is
> returned and execution aborted to signal something faulty and unexpected.
> 
> Changes since v1:
> - Rebased on latest master to fix a merge conflict coming from the elimination
>   of the accel specific dirty field
> 
> -----BEGIN SSH SIGNATURE-----
> U1NIU0lHAAAAAQAAAE0AAAAac2stc3NoLWVkMjU1MTlAb3BlbnNzaC5jb20AAAAgF4l9Pi
> ZyIMDy0ZI4SCYaMCvjXS3h6Dpo3xDFvSh0I7oAAAAHc3NoOmdpdAAAAANnaXQAAAAAAAAA
> BnNoYTUxMgAAAGcAAAAac2stc3NoLWVkMjU1MTlAb3BlbnNzaC5jb20AAABA4egRAbnGLI
> XkdzHMqxAMQj1wQNIw+Ja9we8xUkEiJW96FaummDyD2h2TxplwF93KnWYW/sUYZMX5b1C3
> 3OOcBgUAACUF
> -----END SSH SIGNATURE-----
> -----BEGIN SSH SIGNATURE-----
> U1NIU0lHAAAAAQAAAE0AAAAac2stc3NoLWVkMjU1MTlAb3BlbnNzaC5jb20AAAAgF4l9Pi
> ZyIMDy0ZI4SCYaMCvjXS3h6Dpo3xDFvSh0I7oAAAAHc3NoOmdpdAAAAANnaXQAAAAAAAAA
> BnNoYTUxMgAAAGcAAAAac2stc3NoLWVkMjU1MTlAb3BlbnNzaC5jb20AAABAqkJRImazba
> 3Xjj17Hi7FDcJ5XC7f+rFXUvDc58gax1GyCHtOu16ldDx3ldSi2Zl8iGFtauFsLHRAdPpK
> IoPyDAUAACUR
> -----END SSH SIGNATURE-----
> -----BEGIN SSH SIGNATURE-----
> U1NIU0lHAAAAAQAAAE0AAAAac2stc3NoLWVkMjU1MTlAb3BlbnNzaC5jb20AAAAgF4l9Pi
> ZyIMDy0ZI4SCYaMCvjXS3h6Dpo3xDFvSh0I7oAAAAHc3NoOmdpdAAAAANnaXQAAAAAAAAA
> BnNoYTUxMgAAAGcAAAAac2stc3NoLWVkMjU1MTlAb3BlbnNzaC5jb20AAABAJ1tI5FyxL+
> GZ8gHzwMy4Bvk3bYniUpXhdKF+Y41Ec6aSaK92zZEILSBmpioCBTjawsYF7/0Gqju5Ukjg
> Fai0CQUAACV5
> -----END SSH SIGNATURE-----
> 
> Doru Blânzeanu (5):
>   include/hw/hyperv: move hv_vp_register_page struct definition
>   target/i386/mshv: abort when hv_vp_register_page setup fails
>   target/i386/mshv: remove fallback for register page get registers
>   target/i386/mshv: remove fallback for register page set registers
>   target/i386/mshv: fix pio handlers clobbering device-modified
>     registers
> 
>  include/hw/hyperv/hvgdk.h      |   2 +
>  include/hw/hyperv/hvgdk_mini.h | 103 --------------
>  include/hw/hyperv/hvhdk.h      | 106 ++++++++++++++
>  target/i386/mshv/mshv-cpu.c    | 247 +++++++++++++++------------------
>  4 files changed, 219 insertions(+), 239 deletions(-)
> 
> -- 
> 2.53.0

included in mkulke-pull-20261006


  parent reply	other threads:[~2026-10-12 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07 22:16 [PATCH 0/5] Fix register page use for guests using mshv accel Doru Blânzeanu
2026-07-07 22:16 ` [PATCH 1/5] include/hw/hyperv: move hv_vp_register_page struct definition Doru Blânzeanu
2026-07-08 16:36   ` Magnus Kulke
2026-07-07 22:16 ` [PATCH 2/5] target/i386/mshv: abort when hv_vp_register_page setup fails Doru Blânzeanu
2026-07-08 16:37   ` Magnus Kulke
2026-07-08 16:38   ` Magnus Kulke
2026-07-07 22:16 ` [PATCH 3/5] target/i386/mshv: remove fallback for register page get registers Doru Blânzeanu
2026-07-08 16:49   ` Magnus Kulke
2026-07-07 22:16 ` [PATCH 4/5] target/i386/mshv: remove fallback for register page set registers Doru Blânzeanu
2026-07-08 16:44   ` Magnus Kulke
2026-07-07 22:16 ` [PATCH 5/5] target/i386/mshv: fix pio handlers clobbering device-modified registers Doru Blânzeanu
2026-07-08 16:50   ` Magnus Kulke
2026-10-12 12:25 ` Magnus Kulke [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-07  8:25 [PATCH 0/5] Fix register page use for guests using mshv accel Doru Blânzeanu

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=aszRx6JGOui7rLmd@example.com \
    --to=magnuskulke@linux.microsoft.com \
    --cc=dblanzeanu@linux.microsoft.com \
    --cc=dblanzeanu@microsoft.com \
    --cc=liuwe@microsoft.com \
    --cc=magnuskulke@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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 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.