public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Sean Christopherson <seanjc@google.com>
Subject: [GIT PULL] KVM: x86: Emulated MMIO changes for 7.1
Date: Fri, 10 Apr 2026 16:58:23 -0700	[thread overview]
Message-ID: <20260410235832.2312342-5-seanjc@google.com> (raw)
In-Reply-To: <20260410235832.2312342-1-seanjc@google.com>

Emulated MMIO changes to fix a use-after-free (kernel stack) bug, and do a
spring cleaning of the code (though it could certainly use even more cleaning).

The following changes since commit 11439c4635edd669ae435eec308f4ab8a0804808:

  Linux 7.0-rc2 (2026-03-01 15:39:31 -0800)

are available in the Git repository at:

  https://github.com/kvm-x86/linux.git tags/kvm-x86-mmio-7.1

for you to fetch changes up to e2138c4a5be1e50d75281136bdc3e709cb07ec5e:

  KVM: x86: Add helpers to prepare kvm_run for userspace MMIO exit (2026-03-02 16:06:49 -0800)

----------------------------------------------------------------
KVM x86 emulated MMIO changes for 7.1

Copy single-chunk MMIO write values into a persistent (per-fragment) field to
fix use-after-free stack bugs due to KVM dereferencing a stack pointer after an
exit to userspace.

Clean up and comment the emulated MMIO code to try to make it easier to
maintain (not necessarily "easy", but "easier").

----------------------------------------------------------------
Sean Christopherson (14):
      KVM: x86: Use scratch field in MMIO fragment to hold small write values
      KVM: x86: Open code handling of completed MMIO reads in emulator_read_write()
      KVM: x86: Trace unsatisfied MMIO reads on a per-page basis
      KVM: x86: Use local MMIO fragment variable to clean up emulator_read_write()
      KVM: x86: Open code read vs. write userspace MMIO exits in emulator_read_write()
      KVM: x86: Move MMIO write tracing into vcpu_mmio_write()
      KVM: x86: Harden SEV-ES MMIO against on-stack use-after-free
      KVM: x86: Dedup kvm_sev_es_mmio_{read,write}()
      KVM: x86: Consolidate SEV-ES MMIO emulation into a single public API
      KVM: x86: Bury emulator read/write ops in emulator_{read,write}_emulated()
      KVM: x86: Fold emulator_write_phys() into write_emulate()
      KVM: x86: Rename .read_write_emulate() to .read_write_guest()
      KVM: x86: Don't panic the kernel if completing userspace I/O / MMIO goes sideways
      KVM: x86: Add helpers to prepare kvm_run for userspace MMIO exit

 arch/x86/include/asm/kvm_host.h |   3 -
 arch/x86/kvm/emulate.c          |  13 ++
 arch/x86/kvm/svm/sev.c          |  20 +--
 arch/x86/kvm/vmx/tdx.c          |  14 +-
 arch/x86/kvm/x86.c              | 287 ++++++++++++++++++----------------------
 arch/x86/kvm/x86.h              |  32 ++++-
 include/linux/kvm_host.h        |   3 +-
 7 files changed, 180 insertions(+), 192 deletions(-)

  parent reply	other threads:[~2026-04-10 23:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 23:58 [GIT PULL] KVM: x86 pull requests for 7.1 Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: x86: A lonely fix " Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: guest_memfd change " Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: x86: Misc changes " Sean Christopherson
2026-04-10 23:58 ` Sean Christopherson [this message]
2026-04-10 23:58 ` [GIT PULL] KVM: x86: MMU " Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: x86: Nested SVM " Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: Selftests " Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: x86: SVM+SEV changes Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: x86: SVM changes for 7.1 (short version) Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: x86: VMX changes for 7.1 Sean Christopherson
2026-04-10 23:58 ` [GIT PULL] KVM: x86: VMXON and EFER.SVME extraction " Sean Christopherson
2026-04-11  0:02   ` Sean Christopherson

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=20260410235832.2312342-5-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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