Hi,
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index d2d913acf0df..f8642ff2eb9d 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -1227,6 +1227,7 @@ struct kvm_ppc_resize_hpt {
> #define KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE 228
> #define KVM_CA
Hi Sean,
On Tue, Oct 3, 2023 at 4:59 PM Sean Christopherson wrote:
>
> On Tue, Oct 03, 2023, Fuad Tabba wrote:
> > Hi,
> >
> > > diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> > > index d2d913acf0df..f8642ff2eb9d 100644
> > &g
Hi Sean,
On Tue, Oct 3, 2023 at 9:51 PM Sean Christopherson wrote:
>
> On Tue, Oct 03, 2023, Fuad Tabba wrote:
> > On Tue, Oct 3, 2023 at 4:59 PM Sean Christopherson
> > wrote:
> > > On Tue, Oct 03, 2023, Fuad Tabba wrote:
> > > > > +#define KVM_MEM
Hi Sean,
On Fri, Oct 6, 2023 at 4:21 AM Sean Christopherson wrote:
>
> On Thu, Oct 05, 2023, Fuad Tabba wrote:
> > Hi Sean,
> >
> > On Tue, Oct 3, 2023 at 9:51 PM Sean Christopherson
> > wrote:
> > > > Like I said, pKVM doesn't need a use
Hi,
On Fri, Oct 27, 2023 at 7:23 PM Sean Christopherson wrote:
...
> diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
> index e2252c748fd6..e82c69d5e755 100644
> --- a/Documentation/virt/kvm/api.rst
> +++ b/Documentation/virt/kvm/api.rst
> @@ -6079,6 +6079,15 @@ appl
Hi Sean,
On Tue, Oct 31, 2023 at 10:13 PM Sean Christopherson wrote:
>
> On Tue, Oct 31, 2023, Fuad Tabba wrote:
> > Hi,
> >
> > On Fri, Oct 27, 2023 at 7:23 PM Sean Christopherson
> > wrote:
> >
> > ...
> >
> > > diff --git a/Docum
nzini
> Reviewed-by: Xiaoyao Li
> Signed-off-by: Sean Christopherson
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> virt/kvm/kvm_main.c | 34 +++---
> 1 file changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/virt/kv
t; invalidation, i.e. a potential use-after-free, would manifest as no
> notification whatsoever, not an end() without a start().
>
> Signed-off-by: Sean Christopherson
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> virt/kvm/kvm_main.c | 3 +--
> 1 file ch
https://lore.kernel.org/all/e397d30c-c6af-e68f-d18e-b4e3739c5...@linux.intel.com
> Signed-off-by: Sean Christopherson
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> virt/kvm/kvm_main.c | 9 -
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> dif
ill allow combining all of the
>
> #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
>
> checks into a single
>
> #ifdef CONFIG_KVM_GENERIC_MMU_NOTIFIER
>
> without having to worry about PPC's "bare" usage of
> KVM_ARCH
m *kvm, struct kvm_gfn_range *range);
>
> Alternatively, PPC could forward declare kvm_gfn_range, but there's no
> good reason not to define it in common KVM.
>
> Acked-by: Anup Patel
> Signed-off-by: Sean Christopherson
> ---
Reviewed-by: Fuad Tabba
Tested-by
instead of an
> -EINVAL error.
>
> Cc: Jarkko Sakkinen
> Reviewed-by: Paolo Bonzini
> Reviewed-by: Xiaoyao Li
> Signed-off-by: Sean Christopherson
> ---
With the missing pad in api.rst fixed:
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> D
On Wed, Nov 1, 2023 at 9:55 PM Sean Christopherson wrote:
>
> On Wed, Nov 01, 2023, Fuad Tabba wrote:
> > > > > @@ -1034,6 +1034,9 @@ static void kvm_destroy_dirty_bitmap(struct
> > > > > kvm_memory_slot *memslot)
> > > > > /* This doe
> __always_inlined, practically speaking, the struct will never actually be
> returned from a function call (not to mention the size of the struct will
> be two bytes in practice).
>
> Signed-off-by: Sean Christopherson
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad T
stically add a lockdep assertion in kvm_mmu_invalidate_end() to
> guard against future bugs of this nature.
>
> Reported-by: Isaku Yamahata
> Link:
> https://lore.kernel.org/all/20230802203119.gb2021...@ls.amr.corp.intel.com
> Signed-off-by: Sean Christopherson
> ---
Reviewed-by: Fuad T
Hi,
On Fri, Oct 27, 2023 at 7:22 PM Sean Christopherson wrote:
>
> Add flags to "struct kvm_gfn_range" to let notifier events target only
> shared and only private mappings, and write up the existing mmu_notifier
> events to be shared-only (private memory is never associated with a
> userspace vi
ote, KVM must wait until after run->immediate_exit is serviced to
> sanitize run->exit_reason as KVM's ABI is that run->exit_reason is
> preserved across KVM_RUN when run->immediate_exit is true.
>
> Link: https://lore.kernel.org/all/20230908222905.1321305-1-amoor...@googl
d-off-by: Yu Zhang
> Signed-off-by: Chao Peng
> Co-developed-by: Sean Christopherson
> Signed-off-by: Sean Christopherson
> ---
With my limited understanding of kvm-x86 mmu code:
Reviewed-by: Fuad Tabba
Tested the x86 code (as part of this patch series) on qemu. The x86
fault handlin
On Fri, Oct 27, 2023 at 7:23 PM Sean Christopherson wrote:
>
> Drop __KVM_VCPU_MULTIPLE_ADDRESS_SPACE and instead check the value of
> KVM_ADDRESS_SPACE_NUM.
>
> No functional change intended.
>
> Reviewed-by: Paolo Bonzini
> Signed-off-by: Sean Christopherson
> -
On Thu, Nov 2, 2023 at 2:41 PM Sean Christopherson wrote:
>
> On Thu, Nov 02, 2023, Fuad Tabba wrote:
> > Hi,
> >
> > On Fri, Oct 27, 2023 at 7:22 PM Sean Christopherson
> > wrote:
> > >
> > > Add flags to "struct kvm_gfn_range" to let
ress space across all
> architectures).
>
> Signed-off-by: Sean Christopherson
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> arch/powerpc/kvm/book3s_hv.c| 2 +-
> arch/x86/include/asm/kvm_host.h | 8 +++-
> arch/x86/kvm/debugfs.c | 2
Hi,
...
> diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
> index e2252c748fd6..e82c69d5e755 100644
> --- a/Documentation/virt/kvm/api.rst
> +++ b/Documentation/virt/kvm/api.rst
...
> +4.141 KVM_CREATE_GUEST_MEMFD
> +
> +
> +:Capability:
; Co-developed-by: Sean Christopherson
> Signed-off-by: Sean Christopherson
> Reviewed-by: Paolo Bonzini
> Message-Id: <20231027182217.3615211-10-sea...@google.com>
> Signed-off-by: Paolo Bonzini
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
notifier_block pm_notifier;
> +#endif
> +#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES
> + /* Protected by slots_locks (for writes) and RCU (for reads) */
slots_locks -> slots_lock
Otherwise,
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> + struct xarray mem_attr_array;
> #endi
-
> +
> +:Capability: KVM_CAP_GUEST_MEMFD
> +:Architectures: none
> +:Type: vm ioctl
> +:Parameters: struct kvm_create_guest_memfd(in)
nit: space before (in)
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> +:Returns: 0 on success, <0 on error
> +
> +K
stance.
>
> Co-developed-by: Yu Zhang
> Signed-off-by: Yu Zhang
> Signed-off-by: Chao Peng
> Co-developed-by: Sean Christopherson
> Signed-off-by: Sean Christopherson
> Reviewed-by: Fuad Tabba
> Tested-by: Fuad Tabba
> Message-Id:
iversally accessible. I.e. relying SEV-SNP or TDX
nit: "that isn't"
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> for maintaining guest private memory isn't a realistic option.
>
> At the very least, KVM_X86_SW_PROTECTED_VM will enable a variety of
are that's isn't universally accessible. I.e. relying SEV-SNP or TDX
(replied to v13 earlier, sorry)
nit: "that isn't"
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> for maintaining guest private memory isn't a realistic option.
>
> At
region_find() can be exposed to give
> others full access to all memory region/slot information.
>
> Signed-off-by: Sean Christopherson
> Message-Id: <20231027182217.3615211-25-sea...@google.com>
> Signed-off-by: Paolo Bonzini
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad
t; Note, this obviously makes selftests backwards-incompatible with older KVM
> versions from this point forward.
>
> Signed-off-by: Sean Christopherson
> Message-Id: <20231027182217.3615211-26-sea...@google.com>
> Signed-off-by: Paolo Bonzini
> ---
Reviewed-
ory region flags (e.g. KVM_MEM_LOG_DIRTY_PAGES)
> - *
> - * Output Args: None
> - *
> - * Return: None
> - *
> - * Allocates a memory area of the number of pages specified by npages
> - * and maps it to the VM specified by vm, at a starting physical address
> - * given by guest_paddr. Th
+
> + ret = fallocate(region->region.guest_memfd, mode, fd_offset,
> len);
> + TEST_ASSERT(!ret, "fallocate() failed to %s at %lx (len =
> %lu), fd = %d, mode = %x, offset = %lx\n",
> + punch_hole ? "punch hole" : "allocate", gpa, len,
> + region->region.guest_memfd, mode, fd_offset);
> + }
> +}
> +
> /* Returns the size of a vCPU's kvm_run structure. */
> static int vcpu_mmap_sz(void)
> {
Nits aside:
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> --
> 2.39.1
>
>
arentheses?
> + fd_offset = region->region.guest_memfd_offset + offset;
> + len = min_t(uint64_t, end - gpa, region->region.memory_size -
> offset);
> +
> + ret = fallocate(region->region.guest_memfd, mode, fd_offset,
> len);
> +
ey can just use
> anon_inode_create_getfile(), which will be exported very soon for use
> in KVM.
>
> Suggested-by: Christian Brauner
> Signed-off-by: Paolo Bonzini
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> fs/anon_inodes.c|
ween host userspace code and
> guest code.
>
> Signed-off-by: Vishal Annapurve
> [sean: drop shared/private helpers (let tests specify flags)]
> Signed-off-by: Sean Christopherson
> Message-Id: <20231027182217.3615211-29-sea...@google.com>
> Signed-off-by: Paolo Bonzi
stopherson
> Message-Id: <20231027182217.3615211-31-sea...@google.com>
> Signed-off-by: Paolo Bonzini
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> tools/testing/selftests/kvm/include/ucall_common.h | 11 +++
> 1 file changed, 11 insertions(+)
1-30-sea...@google.com>
> Signed-off-by: Paolo Bonzini
> ---
nit: as in a prior selftest commit messages, references in the commit
message to guest _private_ memory. Should these be changed to just
guest memory?
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/f
On Mon, Nov 6, 2023 at 4:04 PM Sean Christopherson wrote:
>
> On Mon, Nov 06, 2023, Fuad Tabba wrote:
> > On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote:
> > >
> > > From: Sean Christopherson
> > >
> > > Add a "vm_shape" structur
On Mon, Nov 6, 2023 at 4:13 PM Sean Christopherson wrote:
>
> On Mon, Nov 06, 2023, Fuad Tabba wrote:
> > On Sun, Nov 5, 2023 at 4:34 PM Paolo Bonzini wrote:
> > > +void vm_guest_mem_fallocate(struct kvm_vm *vm, uint64_t base, uint64_t
> > > size,
> >
<20231027182217.3615211-33-sea...@google.com>
> Signed-off-by: Paolo Bonzini
> ---
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> .../selftests/kvm/include/kvm_util_base.h | 7 +
> tools/testing/selftests/kvm/lib/kvm_util.c| 29 +++
&
+
> +#define _GNU_SOURCE
> +#include "test_util.h"
> +#include "kvm_util_base.h"
> +#include
> +#include
> +#include
> +#include
> +#include
> +
> +#include
> +#include
> +#include
> +#include
> +#include
> +#include
The inclu
482
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/x86_64/private_mem_kvm_exits_test.c
> @@ -0,0 +1,120 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2022, Google LLC.
nit: 2023
Nits aside:
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
Cheers,
/fuad
> +
Hi Anish,
On Thu, Nov 9, 2023 at 1:08 AM Anish Moorthy wrote:
>
> Applying [1] and [2] reveals that this also breaks non-x86 builds- the
> MEM_REGION_GPA/SLOT definitions are guarded behind an #ifdef
> __x86_64__, while the usages introduced here aren't.
>
> Should
>
> On Sun, Nov 5, 2023 at 8:35
Hi Sean,
...
> @@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp,
> case KVM_GET_STATS_FD:
> r = kvm_vm_ioctl_get_stats_fd(kvm);
> break;
> + case KVM_CREATE_GUEST_MEMFD: {
> + struct kvm_create_guest_memfd guest_memfd;
Hi Sean,
On Thu, Jul 27, 2023 at 6:13 PM Sean Christopherson wrote:
>
> On Thu, Jul 27, 2023, Fuad Tabba wrote:
> > Hi Sean,
> >
> >
> > ...
> >
> > > @@ -5134,6 +5167,16 @@ static long kvm_vm_ioctl(struct file *filp,
> > >
Hi Sean,
On Tue, Jul 25, 2023 at 5:04 PM Sean Christopherson wrote:
>
> On Tue, Jul 25, 2023, Wei W Wang wrote:
> > On Wednesday, July 19, 2023 7:45 AM, Sean Christopherson wrote:
> > > +int kvm_gmem_get_pfn(struct kvm *kvm, struct kvm_memory_slot *slot,
> > > +gfn_t gfn, kvm_pfn_
Hi Oliver,
On Tue, 6 Aug 2024 at 00:26, Oliver Upton wrote:
>
> [+cc Fuad]
>
> Fuad, you mentioned in commit 9c30fc615daa ("KVM: arm64: Move setting
> the page as dirty out of the critical section") that restructuring
> around the MMU lock was helpful for reuse (presumably for pKVM), but I
> lack
47 matches
Mail list logo