Signed-off-by: Greg Kurz
> ---
Dang, I see where I went wrong. Sorry :-(
Reviewed-by: Sean Christopherson
On Tue, Nov 05, 2019 at 11:02:46AM +0100, David Hildenbrand wrote:
> On 05.11.19 10:49, David Hildenbrand wrote:
> >On 05.11.19 10:17, David Hildenbrand wrote:
> >>On 05.11.19 05:38, Dan Williams wrote:
> >>>On Thu, Oct 24, 2019 at 5:11 AM David Hildenbrand wrote:
>
> Right now, ZONE_DEVI
On Tue, Nov 05, 2019 at 09:30:53PM +0100, David Hildenbrand wrote:
> >>>I think I know what's going wrong:
> >>>
> >>>Pages that are pinned via gfn_to_pfn() and friends take a references,
> >>>however are often released via
> >>>kvm_release_pfn_clean()/kvm_release_pfn_dirty()/kvm_release_page_clean
On Tue, Nov 05, 2019 at 03:02:40PM -0800, Dan Williams wrote:
> On Tue, Nov 5, 2019 at 12:31 PM David Hildenbrand wrote:
> > > The scarier code (for me) is transparent_hugepage_adjust() and
> > > kvm_mmu_zap_collapsible_spte(), as I don't at all understand the
> > > interaction between THP and _PA
On Tue, Nov 05, 2019 at 03:30:00PM -0800, Dan Williams wrote:
> On Tue, Nov 5, 2019 at 3:13 PM Sean Christopherson
> wrote:
> >
> > On Tue, Nov 05, 2019 at 03:02:40PM -0800, Dan Williams wrote:
> > > On Tue, Nov 5, 2019 at 12:31 PM David Hildenbrand
> > > wr
On Tue, Nov 05, 2019 at 03:43:29PM -0800, Dan Williams wrote:
> On Tue, Nov 5, 2019 at 3:30 PM Dan Williams wrote:
> >
> > On Tue, Nov 5, 2019 at 3:13 PM Sean Christopherson
> > wrote:
> > >
> > > On Tue, Nov 05, 2019 at 03:02:40PM -0800, Dan Williams wrot
On Wed, Nov 06, 2019 at 07:56:34AM +0100, David Hildenbrand wrote:
> On 06.11.19 01:08, Dan Williams wrote:
> >On Tue, Nov 5, 2019 at 4:03 PM Sean Christopherson
> >>But David's proposed fix for the above refcount bug is to omit the patch
> >>so that KVM no lo
On Tue, Nov 26, 2019 at 02:52:12PM -0300, Leonardo Bras wrote:
> Fixes a possible 'use after free' of kvm variable.
> It does use mutex_unlock(&kvm->lock) after possible freeing a variable
> with kvm_put_kvm(kvm).
Moving the calls to kvm_put_kvm() to the end of the functions doesn't
actually fix a
On Fri, Jan 04, 2019 at 04:54:01PM +0800, lantianyu1...@gmail.com wrote:
> From: Lan Tianyu
>
> The dirty bits have already been checked in the previous check of
> "dirty_bitmap" and mask must be non-zero value at this point.
>
> Signed-off-by: Lan Tianyu
> ---
> virt/kvm/kvm_main.c | 8 +++---
On Fri, Jan 04, 2019 at 04:54:00PM +0800, lantianyu1...@gmail.com wrote:
> From: Lan Tianyu
>
> This patch is to flush tlb via flush list function.
More explanation of why this is beneficial would be nice. Without the
context of the overall series it's not immediately obvious what
kvm_flush_rem
On Fri, Jan 04, 2019 at 07:50:36AM -0800, Sean Christopherson wrote:
> On Fri, Jan 04, 2019 at 04:54:01PM +0800, lantianyu1...@gmail.com wrote:
> > From: Lan Tianyu
> >
> > The dirty bits have already been checked in the previous check of
> > "dirty_bitmap&quo
On Fri, 08 Sep 2023 09:42:23 +0200, Vlastimil Babka wrote:
> As Kirill pointed out, mapping can be removed under us due to
> truncation. Test it under folio lock as already done for the async
> compaction / dirty folio case. To prevent locking every folio with
> mapping to do the test, do it only f
fier_retry
KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace
KVM: Introduce per-page memory attributes
KVM: x86: Disallow hugepages when memory attributes are mixed
KVM: x86/mmu: Handle page fault for private memory
KVM: selftests: Add KVM_SET_USER_MEMORY_REGION2 helpe
y
meaningful change is to store start+end as u64s instead of unsigned longs.
Reviewed-by: Paolo Bonzini
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 34 +++---
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/
small.
Suggested-by: Sean Christopherson
Signed-off-by: Chao Peng
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
[sean: convert vmx_set_apic_access_page_addr() to gfn-based API]
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/mmu/mmu.c | 10 ++
arch/x86/kvm/vmx/vmx.c | 11
ER)
checks into a single
#ifdef CONFIG_KVM_GENERIC_MMU_NOTIFIER
without having to worry about PPC's "bare" usage of
KVM_ARCH_WANT_MMU_NOTIFIER.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/powerpc.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff -
: Paolo Bonzini
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/powerpc.c | 4
1 file changed, 4 deletions(-)
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index b0a512ede764..8d3ec483bc2b 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/power
define it in common KVM.
Signed-off-by: Sean Christopherson
---
arch/arm64/include/asm/kvm_host.h | 2 --
arch/arm64/kvm/Kconfig | 2 +-
arch/mips/include/asm/kvm_host.h| 2 --
arch/mips/kvm/Kconfig | 2 +-
arch/powerpc/include/asm/kvm_host.h | 2 --
arch
more robust, e.g. if the new fd field
is guarded only by a flag and not a new ioctl(), then a userspace bug
(setting a "bad" flag) would generate out-of-bounds access instead of an
-EINVAL error.
Cc: Jarkko Sakkinen
Reviewed-by: Paolo Bonzini
Signed-off-by: Sean Christopherson
---
stacks, e.g. in emulation paths, is
infeasible as doing so would require a near-complete overhaul of KVM,
whereas KVM already propagates -errno return codes to userspace even when
the -errno originated in a low level helper.
Link: https://lore.kernel.org/all/20230908222905.1321305-5-amoor...@google.com
(not to mention the size of the struct will
be two bytes in practice).
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 53 +++--
1 file changed, 37 insertions(+), 16 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
dd two flags so that KVM can handle the three possibilities (shared,
private, and shared+private) without needing something like a tri-state
enum.
Link: https://lore.kernel.org/all/zjx0hk+kpqp0k...@google.com
Signed-off-by: Sean Christopherson
---
include/linux/kvm_host.h | 2 ++
virt/kvm/kvm_
tions to
if/when they are needed.
Suggested-by: Sean Christopherson
Link: https://lore.kernel.org/all/y2wb48kd0j4vg...@google.com
Cc: Fuad Tabba
Cc: Xu Yilun
Signed-off-by: Chao Peng
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
---
Documentation/virt/kvm/api.rst
Wilcox
Co-developed-by: Vlastimil Babka
Signed-off-by: Vlastimil Babka
Signed-off-by: Sean Christopherson
---
include/linux/pagemap.h | 19 +-
mm/compaction.c | 43 +
mm/migrate.c| 2 ++
3 files changed, 51 inserti
TODO: Throw this away, assuming KVM drops its dedicated file system.
Acked-by: Paul Moore
Signed-off-by: Sean Christopherson
---
security/security.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/security/security.c b/security/security.c
index 23b129d482a7..0024156f867a 100644
--- a
. Shutemov
Co-developed-by: Yu Zhang
Signed-off-by: Yu Zhang
Co-developed-by: Chao Peng
Signed-off-by: Chao Peng
Co-developed-by: Ackerley Tng
Signed-off-by: Ackerley Tng
Co-developed-by: Isaku Yamahata
Signed-off-by: Isaku Yamahata
Signed-off-by: Sean Christopherson
---
include/linux
TODO: writeme
Signed-off-by: Sean Christopherson
---
include/uapi/linux/kvm.h | 2 ++
virt/kvm/guest_mem.c | 54
2 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index b6f90a273e2e
KVM_RUN when run->immediate_exit is true.
Link: https://lore.kernel.org/all/20230908222905.1321305-1-amoor...@google.com
Link: https://lore.kernel.org/all/zffbwoxz5ui%2fg...@google.com
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/x86.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/x86.c
that info into the refcount is
unnecessarily complex as it would require knowing the previous state of
the mixed count when updating attributes. Using a flag means KVM just
needs to ensure the current status is reflected in the memslots.
Signed-off-by: Chao Peng
Co-developed-by: Sean Christopher
lt.
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
---
arch/x86/kvm/mmu/mmu.c | 94 +++--
arch/x86/kvm/mmu/mmu_internal.h | 1 +
2 files changed, 90 inser
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
---
arch/x86/include/asm/kvm_host.h | 1 -
include/linux/kvm_host.h| 2 +-
2 files changed, 1
.
Disallowing SMM will simplify support for guest private memory, as KVM
will not need to worry about tracking memory attributes for multiple
address spaces (SMM is the only "non-default" address space across all
architectures).
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/book3s_hv
Signed-off-by: Sean Christopherson
---
Documentation/virt/kvm/api.rst | 32
arch/x86/include/asm/kvm_host.h | 15 +--
arch/x86/include/uapi/asm/kvm.h | 3 +++
arch/x86/kvm/Kconfig| 12
arch/x86/kvm/mmu/mmu_internal.h | 1
Drop kvm_userspace_memory_region_find(), it's unused and a terrible API
(probably why it's unused). If anything outside of kvm_util.c needs to
get at the memslot, userspace_mem_region_find() can be exposed to give
others full access to all memory region/slot information.
Signed-of
Use KVM_SET_USER_MEMORY_REGION2 throughough KVM's selftests library so
that support for guest private memory can be added without needing an
entirely separate set of helpers.
Signed-off-by: Sean Christopherson
---
.../selftests/kvm/include/kvm_util_base.h | 2 +-
tools/testing/self
rst
destroy memslots.
Co-developed-by: Ackerley Tng
Signed-off-by: Ackerley Tng
Signed-off-by: Sean Christopherson
---
.../selftests/kvm/include/kvm_util_base.h | 23 +
.../testing/selftests/kvm/include/test_util.h | 5 ++
tools/testing/selftests/kvm/lib/kvm_util.c| 85 +++
ingle source of true.
The fallocate() helpers are provided so that tests can mimic a userspace
that frees private memory on conversion, e.g. to prioritize memory usage
over performance.
Signed-off-by: Vishal Annapurve
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christoph
: drop shared/private helpers (let tests specify flags)]
Signed-off-by: Sean Christopherson
---
.../selftests/kvm/include/x86_64/processor.h | 15 +++
1 file changed, 15 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h
b/tools/testing/selftes
double down and require unique
VM types for TDX and SNP guests.
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/dirty_log_test.c | 2 +-
.../selftests/kvm/include/kvm_util_base.h | 54 +++
.../selftests/kvm/kvm_page_table_test.c | 2
Add GUEST_SYNC[1-6]() so that tests can pass the maximum amount of
information supported via ucall(), without needing to resort to shared
memory.
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/include/ucall_common.h | 11 +++
1 file changed, 11 insertions(+)
diff
ikely open a can
of worms, i.e. delay things even further.
Signed-off-by: Vishal Annapurve
Co-developed-by: Ackerley Tng
Signed-off-by: Ackerley Tng
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/Makefile | 1 +
.../kvm/x86_64/
From: Chao Peng
Add helpers to invoke KVM_SET_USER_MEMORY_REGION2 directly so that tests
can validate of features that are unique to "version 2" of "set user
memory region", e.g. do negative testing on gmem_fd and gmem_offset.
Provide a raw version as well as an assert-success version to reduce
-by: Ackerley Tng
Signed-off-by: Ackerley Tng
[sean: trim the testcases to remove duplicate coverage]
Signed-off-by: Sean Christopherson
---
.../selftests/kvm/include/kvm_util_base.h | 10 ++
.../selftests/kvm/set_memory_region_test.c| 100 ++
2 files changed, 110
on
fallocate(FALLOC_FL_PUNCH_HOLE) should be page aligned
+ invalid inputs (misaligned size, invalid flags) are rejected
Signed-off-by: Chao Peng
Co-developed-by: Ackerley Tng
Signed-off-by: Ackerley Tng
Co-developed-by: Sean Christopherson
Signed-off-by: Sean Christopherson
---
tools
U is actually running and accessing memory when converting and
deleting.
Signed-off-by: Ackerley Tng
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/Makefile | 1 +
.../kvm/x86_64/private_mem_kvm_exits_test.c | 121 ++
2 files changed, 122 insertio
On Thu, Sep 14, 2023, Binbin Wu wrote:
>
> On 9/14/2023 9:55 AM, Sean Christopherson wrote:
> > +void kvm_mmu_invalidate_end(struct kvm *kvm)
> > {
> > /*
> > * This sequence increase will notify the kvm page fault that
> > @@ -833,6 +848,13 @@ vo
On Mon, Aug 28, 2023, Ackerley Tng wrote:
> Sean Christopherson writes:
> >> If we track struct kvm with the inode, then I think (a), (b) and (c) can
> >> be independent of the refcounting method. What do you think?
> >
> > No go. Because again, the inode (p
On Mon, Aug 28, 2023, Elliot Berman wrote:
> I had a 3rd question that's related to how to wire the gmem up to a virtual
> machine:
>
> I learned of a usecase to implement copy-on-write for gmem. The premise
> would be to have a "golden copy" of the memory that multiple virtual
> machines can map
On Thu, Sep 14, 2023, Ackerley Tng wrote:
> Sean Christopherson writes:
>
> > On Mon, Aug 28, 2023, Ackerley Tng wrote:
> >> Sean Christopherson writes:
> >> >> If we track struct kvm with the inode, then I think (a), (b) and (c) can
> >> >> be
On Fri, Sep 15, 2023, Yan Zhao wrote:
> On Wed, Sep 13, 2023 at 06:55:16PM -0700, Sean Christopherson wrote:
>
> > +static void kvm_mmu_prepare_memory_fault_exit(struct kvm_vcpu *vcpu,
> > + struct kvm
On Fri, Sep 15, 2023, Xiaoyao Li wrote:
> On 9/14/2023 9:54 AM, Sean Christopherson wrote:
> > Rework and rename "struct kvm_hva_range" into "kvm_mmu_notifier_range" so
> > that the structure can be used to handle notifications that operate on gfn
> >
slowly clean
things up so that some day KVM only exposes a handful of APIs to the rest
of the kernel (probably a pipe dream).
Anish Ghulati (1):
KVM: arm64: Move arm_{psci,hypercalls}.h to an internal KVM path
Sean Christopherson (25):
vfio: Wrap KVM helpers with CONFIG_KVM instead of CONFI
is nonsensical.
Drop the guard around linux/kvm_host.h entirely, conditionally including a
generic headers is completely unnecessary.
Signed-off-by: Sean Christopherson
---
drivers/vfio/vfio.h | 2 +-
drivers/vfio/vfio_main.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
diff
Move the definitions of vfio_device_get_kvm_safe() and vfio_device_put_kvm()
down in vfio_main.c to colocate them with other KVM-specific functions,
e.g. to allow wrapping them all with a single CONFIG_KVM check.
Signed-off-by: Sean Christopherson
---
drivers/vfio/vfio_main.c | 104
Hide vfio_file_set_kvm() and its unique helpers if KVM is not enabled,
nothing else in the kernel (or out of the kernel) should be using a
KVM specific helper.
Signed-off-by: Sean Christopherson
---
drivers/vfio/vfio_main.c | 2 +-
include/linux/vfio.h | 2 ++
2 files changed, 3 insertions
t/put helpers from KVM.
Signed-off-by: Sean Christopherson
---
drivers/vfio/device_cdev.c | 9 +---
drivers/vfio/group.c | 18 ++--
drivers/vfio/vfio.h| 22 +--
drivers/vfio/vfio_main.c | 43 +++---
4 files change
igned-off-by: Sean Christopherson
---
drivers/vfio/vfio.h | 2 ++
drivers/vfio/vfio_main.c | 74 +++-
include/linux/vfio.h | 4 ++-
virt/kvm/vfio.c | 9 +++--
4 files changed, 47 insertions(+), 42 deletions(-)
diff --git a/drivers/vfio/vfi
where RISC-V doesn't select KVM_VFIO, i.e. would silently
fail to do connect KVM and VFIO, even though RISC-V supports VFIO. The
bug is benign as the only driver in all of Linux that actually uses the
KVM reference provided by VFIO is KVM-GT, which is x86/Intel specific.
Signed-of
rupts that end up being
handled by the host, everything else is completely dead code when KVM is
disabled. And if KVM is disabled, there should not be any posted
interrupts, i.e. NOT wiring up the "dummy" handlers and treating IRQs on
those vectors as spurious is the right thing to do.
Now that nothing in x86 or architecture agnostic code consumes HAVE_KVM,
stop selecting it in x86. This is one of several steps towards deleting
HAVE_KVM from the common KVM Kconfig.
Signed-off-by: Sean Christopherson
---
arch/x86/Kconfig | 1 -
arch/x86/kvm/Kconfig | 2 --
2 files changed
Now that nothing in arm64 or architecture agnostic code consumes HAVE_KVM,
stop selecting it in arm64. This is one of several steps towards deleting
HAVE_KVM from the common KVM Kconfig.
Signed-off-by: Sean Christopherson
---
arch/arm64/Kconfig | 1 -
arch/arm64/kvm/Kconfig | 1 -
2 files
Now that nothing in s390 or architecture agnostic code consumes HAVE_KVM,
stop selecting it in s390. This is one of several steps towards deleting
HAVE_KVM from the common KVM Kconfig.
Signed-off-by: Sean Christopherson
---
arch/s390/Kconfig | 1 -
arch/s390/kvm/Kconfig | 1 -
2 files
Now that MIPS is the sole remaining user of HAVE_KVM, make HAVE_KVM a
MIPS-only Kconfig. Because most architectures unconditionally support
virtualization, advertising to the kernel at-large that an arch has KVM
just led to a bunch of useless and misguided #ifdefs.
Signed-off-by: Sean
From: Anish Ghulati
Move arm_hypercalls.h and arm_psci.h into arch/arm64/kvm now that KVM
no longer supports 32-bit ARM, i.e. now that there's no reason to make
the hypercall and PSCI APIs "public".
Signed-off-by: Anish Ghulati
[sean: squash into one patch, write changelog]
Sign
o maintain
alphabetic ordering.
Reported-by: kernel test robot
Signed-off-by: Sean Christopherson
---
include/kvm/arm_arch_timer.h | 2 ++
include/kvm/arm_pmu.h| 2 ++
2 files changed, 4 insertions(+)
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index bb3
Move kvm/arm_{arch_timer,pmu,vgic}.h to arch/arm64/include/asm and drop
the "arm" prefix from all file names. Now that KVM no longer supports
32-bit ARM, there is no reason to expose ARM specific headers to other
architectures beyond arm64.
Signed-off-by: Sean Christopherson
---
Move iodev.h, the last remaining holdout in include/kvm, to the standard
include/linux directory as kvm_iodev.h and delete include/kvm.
Signed-off-by: Sean Christopherson
---
MAINTAINERS| 1 -
arch/arm64/include/asm/kvm_vgic.h | 2 +-
arch/arm64/kvm/vgic
m" was copied from a different
architecture's Makefile when MIPS support was first added.
Signed-off-by: Sean Christopherson
---
arch/mips/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/kvm/Makefile b/arch/mips/kvm/Makefile
index 805aeea2166e.
m" was copied from a different
architecture's Makefile when PPC support was first added.
Signed-off-by: Sean Christopherson
---
arch/powerpc/kvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 5319
t/kvm" was copied from a x86's
Makefile when s390 support was first added.
The only headers in virt/kvm at the time were the x86 specific ioapic.h,
and iodev.h, neither of which shows up as an #include in the diff for the
commit range 37817f2982d0f..e976a2b997fc4.
Signed-off-by: Sean Christo
laced with ccflags-y (commit c73028a02887
("s390: change to new flag variable") and commit 4108d9ba9091
("powerpc/Makefiles: Change to new flag variables")).
Signed-off-by: Sean Christopherson
---
arch/arm64/kvm/Makefile | 2 --
arch/mips/kvm/Makefile| 2 --
arch/powerpc/kvm/
i.e. isn't
used by KVM.
Perf should also own its APIs, i.e. define what fields/data it needs, not
rely on KVM to throw fields into data structures that effectively hold
KVM-internal state.
Signed-off-by: Sean Christopherson
---
arch/x86/events/core.c| 5 +++--
arch/x86/even
Drop the "struct kvm_vcpu" parameter from
arch_xfer_to_guest_mode_handle_work() as a preparatory step towards
removing the vCPU parameter from xfer_to_guest_mode_work() as well.
Signed-off-by: Sean Christopherson
---
include/linux/entry-kvm.h | 7 ++-
kernel/entry/kvm.c
said API and the definition of "struct kvm_vcpu" from the kernel.
Alternatively, entry/kvm.c could be treated as part of KVM, i.e. be given
access to KVM internals, but that's not obviously better than having KVM
react to -EINTR (though it's not obviously worse eith
imal amount of #ifdeffery.
Signed-off-by: Sean Christopherson
---
arch/arm64/include/asm/kvm_host.h | 48 ++-
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_host.h
b/arch/arm64/include/asm/kvm_host.h
index 90cfbf420545..89b40c34f0a
xics_wake_cpu() is provided by core PPC code, not by KVM. Move its
declaration out of kvm_ppc.h and into xics.h.
Signed-off-by: Sean Christopherson
---
arch/powerpc/include/asm/kvm_ppc.h | 2 --
arch/powerpc/include/asm/xics.h| 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)
diff
etails from
the kernel at-large.
Signed-off-by: Sean Christopherson
---
arch/powerpc/include/asm/kvm_ppc.h | 302 +++--
1 file changed, 153 insertions(+), 149 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm_ppc.h
b/arch/powerpc/include/asm/kvm_ppc.h
index 72fee202d3e
s and an s390 declaration as needed, and
opportunistically include kvm_host.h in trace/events.kvm.h instead of
relying on the parent to provide the right includes.
Cc: Anish Ghulati
Cc: Venkatesh Srinivas
Cc: Andrew Thornton
Signed-off-by: Sean Christopherson
---
arch/arm64/include/asm/kvm_em
On Mon, Sep 18, 2023, Jason Gunthorpe wrote:
> On Fri, Sep 15, 2023 at 05:30:57PM -0700, Sean Christopherson wrote:
> > Explicitly pass KVM's get/put helpers to VFIO when attaching a VM to
> > VFIO instead of having VFIO do a symbol lookup back into KVM. Having both
> &
On Mon, Sep 18, 2023, Jason Gunthorpe wrote:
> On Fri, Sep 15, 2023 at 05:30:58PM -0700, Sean Christopherson wrote:
> > Drop KVM's KVM_VFIO Kconfig, and instead compile in VFIO support if
> > and only if VFIO itself is enabled. Similar to the recent change to have
>
On Mon, Sep 18, 2023, Binbin Wu wrote:
>
>
> On 9/14/2023 9:55 AM, 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
On Mon, Sep 18, 2023, Michael Roth wrote:
> On Wed, Sep 13, 2023 at 06:55:08PM -0700, 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
>
On Wed, Sep 20, 2023, Xu Yilun wrote:
> On 2023-09-13 at 18:55:00 -0700, Sean Christopherson wrote:
> > +void kvm_mmu_invalidate_range_add(struct kvm *kvm, gfn_t start, gfn_t end)
> > +{
> > + lockdep_assert_held_write(&kvm->mmu_lock);
> > +
> > + WARN_
On Tue, Sep 19, 2023, Binbin Wu wrote:
>
>
> On 9/14/2023 9:55 AM, Sean Christopherson wrote:
> [...]
> > +
> > +static void kvm_gmem_invalidate_begin(struct kvm_gmem *gmem, pgoff_t start,
> > + pgoff_t end)
> > +{
On Fri, Sep 15, 2023, Yan Zhao wrote:
> On Wed, Sep 13, 2023 at 06:55:09PM -0700, Sean Christopherson wrote:
> > From: Chao Peng
> >
> > In confidential computing usages, whether a page is private or shared is
> > necessary information for KVM to perform operations l
On Mon, Sep 18, 2023, Binbin Wu wrote:
>
>
> On 9/14/2023 9:55 AM, Sean Christopherson wrote:
> > From: Chao Peng
> [...]
> > +#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES
> > +/*
> > + * Returns true if _all_ gfns in the range [@start, @end) hav
On Mon, Sep 18, 2023, Michael Roth wrote:
> > +static long kvm_gmem_punch_hole(struct inode *inode, loff_t offset, loff_t
> > len)
> > +{
> > + struct list_head *gmem_list = &inode->i_mapping->private_list;
> > + pgoff_t start = offset >> PAGE_SHIFT;
> > + pgoff_t end = (offset + len) >> PAG
On Thu, Sep 21, 2023, Xu Yilun wrote:
> When the invalidation acrosses multiple slots, I'm not sure if the
> contiguous HVA range must correspond to contiguous GFN range. If not,
> are we producing a larger range than required?
Multiple invalidations are all but guaranteed to yield a range that co
On Mon, Sep 18, 2023, Yan Zhao wrote:
> On Fri, Sep 15, 2023 at 07:26:16AM -0700, Sean Christopherson wrote:
> > On Fri, Sep 15, 2023, Yan Zhao wrote:
> > > > static int __kvm_faultin_pfn(struct kvm_vcpu *vcpu, struct
> > > > kvm_page_fault *fault)
On Wed, Sep 13, 2023, Sean Christopherson wrote:
> virt/kvm/guest_mem.c | 593 +
Getting to the really important stuff...
Anyone object to naming the new file guest_memfd.c instead of guest_mem.c? Just
the file, i.e. still keep the gmem namesp
On Fri, Sep 22, 2023, Xiaoyao Li wrote:
> On 9/14/2023 9:55 AM, Sean Christopherson wrote:
> > From: Chao Peng
> >
> > Add a new KVM exit type to allow userspace to handle memory faults that
> > KVM cannot resolve, but that userspace *may* be able to handle (withou
On Thu, Sep 21, 2023, Yan Zhao wrote:
> On Wed, Sep 20, 2023 at 02:00:22PM -0700, Sean Christopherson wrote:
> > On Fri, Sep 15, 2023, Yan Zhao wrote:
> > > On Wed, Sep 13, 2023 at 06:55:09PM -0700, Sean Christopherson wrote:
> > > > +/* Set @attributes f
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
> > --- a/include/uapi/linux/kvm.h
> > +++ b/include/uapi/linux/kvm.h
> > @@ -1227,6 +1227,7 @@ struct kvm_ppc_resize_hpt {
> > #define
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_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3)
> > > > +
> > >
> > >
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 userspace ABI for managing
> > > PRIVATE/SHARED,
> > > just a way of tracking in the host kernel o
s have been gfn_handler_t).
Practically speaking, this is a nop for 64-bit kernels as the only
meaningful change is to store start+end as u64s instead of unsigned longs.
Reviewed-by: Paolo Bonzini
Reviewed-by: Xiaoyao Li
Signed-off-by: Sean Christopherson
---
virt/kvm/kvm_main.c | 34 +
M: x86/mmu: Handle page fault for private memory
KVM: selftests: Add KVM_SET_USER_MEMORY_REGION2 helper
KVM: selftests: Expand set_memory_region_test to validate
guest_memfd()
KVM: selftests: Add basic selftest for guest_memfd()
Sean Christopherson (23):
KVM: Tweak kvm_hva_range and hva
or even problematic to
anything other than the target VM, e.g. the underlying bug could simply be
a duplicate call to end(). And it's much more likely that a missed
invalidation, i.e. a potential use-after-free, would manifest as no
notification whatsoever, not an end() without a star
small.
Suggested-by: Sean Christopherson
Cc: Xu Yilun
Signed-off-by: Chao Peng
Reviewed-by: Fuad Tabba
Tested-by: Fuad Tabba
[sean: convert vmx_set_apic_access_page_addr() to gfn-based API]
Signed-off-by: Sean Christopherson
---
arch/x86/kvm/mmu/mmu.c | 10 ++
arch/x86/kvm/vmx/vmx.c
from the mmu_notifier due to the above
exception waiver, but the assertion can detect KVM bugs, e.g. such as the
bug that *almost* escaped initial guest_memfd development.
Link:
https://lore.kernel.org/all/e397d30c-c6af-e68f-d18e-b4e3739c5...@linux.intel.com
Signed-off-by: Sean Christopherson
---
1 - 100 of 717 matches
Mail list logo