On Tue, Apr 16, 2024 at 11:50:19AM -0700, Sean Christopherson wrote:
> On Mon, Apr 15, 2024, Yan Zhao wrote:
> > On Mon, Apr 15, 2024 at 08:05:49AM +, Ackerley Tng wrote:
> > > >> The Intel GHCI Spec says in R12, bit 63 is set if the GPA is valid. As
> > > >
On Mon, Apr 15, 2024 at 08:05:49AM +, Ackerley Tng wrote:
> Yan Zhao writes:
>
> > On Fri, Apr 12, 2024 at 04:56:36AM +, Ackerley Tng wrote:
> >> Yan Zhao writes:
> >>
> >> > ...
> >> >> diff --git a/tools/testing/selftests/kv
On Fri, Apr 12, 2024 at 04:56:36AM +, Ackerley Tng wrote:
> Yan Zhao writes:
>
> > ...
> >> diff --git a/tools/testing/selftests/kvm/include/x86_64/tdx/test_util.h
> >> b/tools/testing/selftests/kvm/include/x86_64/tdx/test_util.h
> >> index b570b6d978f
On Tue, Dec 12, 2023 at 12:46:43PM -0800, Sagi Shahar wrote:
> From: Ackerley Tng
>
> This tests the use of guest memory with explicit MapGPA calls.
>
> Signed-off-by: Ackerley Tng
> Signed-off-by: Ryan Afranji
> Signed-off-by: Sagi Shahar
> ---
> tools/testing/selftests/kvm/Makefile
> +/*
> + * TDG.VP.INFO call from the guest. Verify the right values are returned
> + */
> +void verify_tdcall_vp_info(void)
> +{
> + const int num_vcpus = 2;
> + struct kvm_vcpu *vcpus[num_vcpus];
> + struct kvm_vm *vm;
> +
> + uint64_t rcx, rdx, r8, r9, r10, r11;
> + uint32_t
On Tue, Dec 12, 2023 at 12:46:39PM -0800, Sagi Shahar wrote:
> From: Ackerley Tng
>
> vm_vaddr_alloc always allocates memory in memslot 0. This allows users
> of this function to choose which memslot to allocate virtual memory
> in.
>
> Signed-off-by: Ackerley Tng
> Signed-off-by: Ryan Afranji
On Fri, Mar 01, 2024 at 08:02:43PM +0800, Yan Zhao wrote:
> > +void guest_shared_mem(void)
> > +{
> > + uint32_t *test_mem_shared_gva =
> > + (uint32_t *)TDX_SHARED_MEM_TEST_SHARED_GVA;
> > +
> > + uint64_t placeholder;
> > + uint64
> +int verify_shared_mem(void)
> +{
> + struct kvm_vm *vm;
> + struct kvm_vcpu *vcpu;
> +
> + vm_vaddr_t test_mem_private_gva;
> + uint32_t *test_mem_hva;
> +
> + vm = td_create();
> + td_initialize(vm, VM_MEM_SRC_ANONYMOUS, 0);
> + vcpu = td_vcpu_add(vm, 0, guest_shared
On Tue, Dec 12, 2023 at 12:46:37PM -0800, Sagi Shahar wrote:
> From: Ackerley Tng
>
> Signed-off-by: Ackerley Tng
> Signed-off-by: Ryan Afranji
> Signed-off-by: Sagi Shahar
> ---
> .../selftests/kvm/include/kvm_util_base.h | 24 ++
> tools/testing/selftests/kvm/lib/kvm_util.c
On Tue, Dec 12, 2023 at 12:46:33PM -0800, Sagi Shahar wrote:
> The test verifies MMIO writes of various sizes from the guest to the host.
>
> Signed-off-by: Sagi Shahar
> Signed-off-by: Ackerley Tng
> Signed-off-by: Ryan Afranji
> ---
> .../selftests/kvm/include/x86_64/tdx/tdx.h| 2 +
> .
> +/* Pick any address that was not mapped into the guest to test MMIO */
> +#define TDX_MMIO_TEST_ADDR 0x2
Also need to test below MMIO addresses
(1) GPA with shared bit on.
(2) GPA in memslot
On Sat, Mar 02, 2024 at 03:31:07PM +0800, Binbin Wu wrote:
> On 12/13/2023 4:46 AM, Sagi Shahar wrote:
> > The test verifies that the guest runs TDVMCALL and the
> > guest vCPU enters to the halted state.
> >
> > Signed-off-by: Erdem Aktas
> > Signed-off-by: Sagi Shahar
> > Signed-off-by: Ackerl
> +void verify_guest_msr_writes(void)
> +{
> + struct kvm_vcpu *vcpu;
> + struct kvm_vm *vm;
> +
> + uint64_t data;
> + int ret;
> +
> + vm = td_create();
> + td_initialize(vm, VM_MEM_SRC_ANONYMOUS, 0);
> +
> + /*
> + * Set explicit MSR filter map to control access
On Mon, Mar 04, 2024 at 05:16:53PM +0800, Binbin Wu wrote:
>
>
> On 3/4/2024 10:19 AM, Yan Zhao wrote:
> > On Tue, Dec 12, 2023 at 12:46:25PM -0800, Sagi Shahar wrote:
> > > From: Erdem Aktas
> > >
> > > Verifies TDVMCALL READ and WRITE operation
On Tue, Dec 12, 2023 at 12:46:25PM -0800, Sagi Shahar wrote:
> From: Erdem Aktas
>
> Verifies TDVMCALL READ and WRITE operations.
>
> Signed-off-by: Erdem Aktas
> Signed-off-by: Sagi Shahar
> Signed-off-by: Ackerley Tng
> Signed-off-by: Ryan Afranji
> ---
> .../kvm/include/x86_64/tdx/test_u
...
> diff --git a/tools/testing/selftests/kvm/include/x86_64/tdx/test_util.h
> b/tools/testing/selftests/kvm/include/x86_64/tdx/test_util.h
> index b570b6d978ff..6d69921136bd 100644
> --- a/tools/testing/selftests/kvm/include/x86_64/tdx/test_util.h
> +++ b/tools/testing/selftests/kvm/include/x86_
> +void guest_shared_mem(void)
> +{
> + uint32_t *test_mem_shared_gva =
> + (uint32_t *)TDX_SHARED_MEM_TEST_SHARED_GVA;
> +
> + uint64_t placeholder;
> + uint64_t ret;
> +
> + /* Map gpa as shared */
> + ret = tdg_vp_vmcall_map_gpa(test_mem_shared_gpa, PAGE_SIZE,
> +
> diff --git a/tools/testing/selftests/kvm/lib/x86_64/tdx/tdx_util.c
> b/tools/testing/selftests/kvm/lib/x86_64/tdx/tdx_util.c
> index 063ff486fb86..b302060049d5 100644
> --- a/tools/testing/selftests/kvm/lib/x86_64/tdx/tdx_util.c
> +++ b/tools/testing/selftests/kvm/lib/x86_64/tdx/tdx_util.c
> @@
> diff --git a/tools/testing/selftests/kvm/lib/x86_64/tdx/tdcall.S
> b/tools/testing/selftests/kvm/lib/x86_64/tdx/tdcall.S
> new file mode 100644
> index ..df9c1ed4bb2d
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/lib/x86_64/tdx/tdcall.S
> @@ -0,0 +1,90 @@
> +/* SPDX-License-Ide
On Tue, Dec 12, 2023 at 12:46:20PM -0800, Sagi Shahar wrote:
> From: Erdem Aktas
> +/**
> + * Adds a vCPU to a TD (Trusted Domain) with minimum defaults. It will not
> set
> + * up any general purpose registers as they will be initialized by the TDX.
> In
> + * TDX, vCPUs RIP is set to 0xFFF
On Tue, Dec 12, 2023 at 12:46:22PM -0800, Sagi Shahar wrote:
> From: Ackerley Tng
>
> If guest memory is backed by restricted memfd
>
> + UPM is being used, hence encrypted memory region has to be
> registered
> + Can avoid making a copy of guest memory before getting TDX to
> initialize the
On Mon, Feb 12, 2024 at 07:17:21PM -0800, Sean Christopherson wrote:
> On Wed, Jan 03, 2024, Yan Zhao wrote:
> > Allow mapping of tail pages of compound pages for IO or PFNMAP mapping
> > by trying and getting ref count of its head page.
> >
> > For IO or PFNMAP mappin
On Mon, Feb 12, 2024 at 07:07:25PM -0800, Sean Christopherson wrote:
> On Wed, Jan 03, 2024, Yan Zhao wrote:
> > This is a v2 for previous series [1] to allow mapping for compound tail
> > pages for IO or PFNMAP mapping.
> >
> > Compared to v1, this version
On Wed, Jan 10, 2024 at 02:27:08PM +0800, Yuan Yao wrote:
> > > Do you have plan to allow user to change the bar_size via IOCTL ?
> > > If no "order" and "bar_size" can be removed.
> > >
> > Currently no. But this structure is private to the test driver.
> > What the benefit to remove the two?
>
>
On Fri, Jan 05, 2024 at 02:25:26PM +0800, Yuan Yao wrote:
> On Wed, Jan 03, 2024 at 04:45:35PM +0800, Yan Zhao wrote:
> > Added a selftest set_memory_region_io to test memslots for MMIO BARs.
>
> Emm.. "set_memory_region_io" doesn't represent the real testing pur
On Thu, Jan 04, 2024 at 04:16:04PM +0800, Yuan Yao wrote:
> On Wed, Jan 03, 2024 at 04:44:57PM +0800, Yan Zhao wrote:
> > This driver is for testing KVM memory slots for device MMIO BARs that are
> > mapped to pages serving as device resources.
> >
> > This driver imp
KVM_MOCK_DEVICE=m must be enabled in the kernel.
Currently, this selftest is only compiled for __x86_64__.
Signed-off-by: Yan Zhao
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/set_memory_region_io.c | 188 ++
2 files changed, 189 insertions(+)
mslot add/removal.
Signed-off-by: Yan Zhao
---
lib/Kconfig.debug | 14 ++
lib/Makefile| 1 +
lib/test_kvm_mock_device.c | 281
lib/test_kvm_mock_device_uapi.h | 16 ++
4 files changed, 312 insertions(+)
create mode 10064
of a non-compound
tail page is the same as the page itself.
On the other side, put_page() has already converted page to folio before
putting page ref.
Signed-off-by: Yan Zhao
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/vir
e...@google.com/
v2:
added patch 2 and 3 to do selftest for patch 1 (Sean).
Yan Zhao (3):
KVM: allow mapping of compound tail pages for IO or PFNMAP mapping
KVM: selftests: add selftest driver for KVM to test memory slots for
MMIO BARs
KVM: selftests: Add set_memory_region_io to test memslo
On Mon, Oct 09, 2023 at 12:13:52PM +0800, Yi Liu wrote:
> On 2023/10/7 18:08, Yan Zhao wrote:
> > On Thu, Sep 21, 2023 at 12:51:24AM -0700, Yi Liu wrote:
> > > From: Nicolin Chen
> > >
> > > The struct iommufd_hw_pagetable has been representing a kernel-
On Thu, Sep 21, 2023 at 12:51:24AM -0700, Yi Liu wrote:
> From: Nicolin Chen
>
> The struct iommufd_hw_pagetable has been representing a kernel-managed
> HWPT, yet soon will be reused to represent a user-managed HWPT. These
> two types of HWPTs has the same IOMMUFD object type and an iommu_domain
> @@ -444,10 +465,9 @@ iommufd_device_do_replace(struct iommufd_device *idev,
> }
>
> old_hwpt = igroup->hwpt;
> - if (hwpt->ioas != old_hwpt->ioas) {
> + if (iommufd_hw_pagetable_compare_ioas(old_hwpt, hwpt)) {
> list_for_each_entry(cur, &igroup->device_list, gr
33 matches
Mail list logo