Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: isaku.yamahata@intel.com
To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com,
	Michael Roth <michael.roth@amd.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	erdemaktas@google.com, Sagi Shahar <sagis@google.com>,
	David Matlack <dmatlack@google.com>,
	Kai Huang <kai.huang@intel.com>,
	Zhi Wang <zhi.wang.linux@gmail.com>,
	chen.bo@intel.com, linux-coco@lists.linux.dev,
	Chao Peng <chao.p.peng@linux.intel.com>,
	Ackerley Tng <ackerleytng@google.com>,
	Vishal Annapurve <vannapurve@google.com>,
	Yuan Yao <yuan.yao@linux.intel.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Xu Yilun <yilun.xu@intel.com>,
	Quentin Perret <qperret@google.com>,
	wei.w.wang@intel.com, Fuad Tabba <tabba@google.com>
Subject: [RFC PATCH 0/6] KVM: gmem: Implement error_remove_page
Date: Wed, 13 Sep 2023 03:48:49 -0700	[thread overview]
Message-ID: <cover.1694599703.git.isaku.yamahata@intel.com> (raw)

From: Isaku Yamahata <isaku.yamahata@intel.com>

This patch series is to share my progress on the KVM gmem error_remove_page task.
Although I'm still working on test cases, I don't want to hold the patches
locally until I finish test cases.

- Update error_remove_page method.  Unmap gfn on poisoned pages.  Pass related
  arguments.  Unfortunately, the error_remove_page callback is passed struct
  page.  So the callback can't know about the actual poisoned address and range.
  The memory poisoning would be based on cache line size, though.
- Add a new flag to KVM_EXIT_MEMORY_FAULT to indicate the page is poisoned.
- Add check in faultin_pfn_private.  When the page is poisoned,
  KVM_EXIT_MEMORY_FAULT(HWPOISON).
- Only test case for ioctl(FIBMAP).  Test cases are TODO.

TODOs
- Implement test cases to inject HWPOISON or MCE by hwpoison
  (/sys/kernel/debug/hwpoison/corrupt-pfn) or MCE injection
  (/sys/kernel/debug/mce-inject).
- Update qemu to handle KVM_EXIT_MEMORY_FAULT(HWPOISON)
- Update TDX KVM to handle it and Add test cases for TDX.
- Try to inject HWPOISON as soon as the poison is detected.

Isaku Yamahata (6):
  KVM: guest_memfd: Add config to show the capability to handle error
    page
  KVM: guestmem_fd: Make error_remove_page callback to unmap guest
    memory
  KVM: guest_memfd, x86: MEMORY_FAULT exit with hw poisoned page
  KVM: guest_memfd: Implemnet bmap inode operation
  KVM: selftests: Add selftest for guest_memfd() fibmap
  KVM: X86: Allow KVM gmem hwpoison test cases

 arch/x86/kvm/Kconfig                          |  2 +
 arch/x86/kvm/mmu/mmu.c                        | 21 +++--
 include/linux/kvm_host.h                      |  2 +
 include/uapi/linux/kvm.h                      |  3 +-
 .../testing/selftests/kvm/guest_memfd_test.c  | 45 ++++++++++
 virt/kvm/Kconfig                              |  7 ++
 virt/kvm/guest_mem.c                          | 82 +++++++++++++++----
 7 files changed, 139 insertions(+), 23 deletions(-)


base-commit: a5accd8596fa84b9fe00076444b5ef628d2351b9
-- 
2.25.1


             reply	other threads:[~2023-09-13 10:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 10:48 isaku.yamahata [this message]
2023-09-13 10:48 ` [RFC PATCH 1/6] KVM: guest_memfd: Add config to show the capability to handle error page isaku.yamahata
2023-09-13 16:16   ` Sean Christopherson
2023-09-13 10:48 ` [RFC PATCH 2/6] KVM: guestmem_fd: Make error_remove_page callback to unmap guest memory isaku.yamahata
2023-09-13 16:28   ` Sean Christopherson
2023-09-13 10:48 ` [RFC PATCH 3/6] KVM: guest_memfd, x86: MEMORY_FAULT exit with hw poisoned page isaku.yamahata
2023-09-13 17:37   ` Sean Christopherson
2023-09-13 10:48 ` [RFC PATCH 4/6] KVM: guest_memfd: Implemnet bmap inode operation isaku.yamahata
2023-09-13 17:46   ` Sean Christopherson
2023-09-13 10:48 ` [RFC PATCH 5/6] KVM: selftests: Add selftest for guest_memfd() fibmap isaku.yamahata
2023-09-13 10:48 ` [RFC PATCH 6/6] KVM: X86: Allow KVM gmem hwpoison test cases isaku.yamahata

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=cover.1694599703.git.isaku.yamahata@intel.com \
    --to=isaku.yamahata@intel.com \
    --cc=ackerleytng@google.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=chen.bo@intel.com \
    --cc=dmatlack@google.com \
    --cc=erdemaktas@google.com \
    --cc=isaku.yamahata@gmail.com \
    --cc=jarkko@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=qperret@google.com \
    --cc=sagis@google.com \
    --cc=seanjc@google.com \
    --cc=tabba@google.com \
    --cc=vannapurve@google.com \
    --cc=wei.w.wang@intel.com \
    --cc=yilun.xu@intel.com \
    --cc=yuan.yao@linux.intel.com \
    --cc=zhi.wang.linux@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).