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
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&
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
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
> > &g
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 long
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
>
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,
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(>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
Signed-off-by: Greg Kurz
> ---
Dang, I see where I went wrong. Sorry :-(
Reviewed-by: Sean Christopherson
On Thu, Jun 24, 2021, Paolo Bonzini wrote:
> On 24/06/21 10:43, Nicholas Piggin wrote:
> > Excerpts from David Stevens's message of June 24, 2021 1:57 pm:
> > > From: David Stevens
> >
> > Changelog? This looks like a bug, should it have a Fixes: tag?
>
> Probably has been there forever... The
kvm_unmap_rmapp().
>
> Fixes: 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU
> notifier callbacks")
> Signed-off-by: Michael Ellerman
> ---
> arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
On Thu, Aug 19, 2021, Mathieu Desnoyers wrote:
> - On Aug 17, 2021, at 8:12 PM, Sean Christopherson sea...@google.com
> wrote:
>
> > Add a test to verify an rseq's CPU ID is updated correctly if the task is
> > migrated while the kernel is handling KVM_RUN. This
On Thu, Aug 19, 2021, Mathieu Desnoyers wrote:
> - On Aug 17, 2021, at 8:12 PM, Sean Christopherson sea...@google.com
> wrote:
> > @@ -250,7 +250,7 @@ static int rseq_ip_fixup(struct pt_regs *regs)
> > * If not nested over a rseq critical section, restart is useless
ume() back in 2012. Punt cleaning that
mess up to future patches.
No functional change intended.
Signed-off-by: Sean Christopherson
---
arch/arm/kernel/signal.c | 1 -
arch/arm64/kernel/signal.c | 1 -
arch/csky/kernel/signal.c| 4 +---
arch/mips/kernel/signal.c| 4 +---
arch/powe
. due to the CPU ID being stale after task migration.
Fixes: 72c3c0fe54a3 ("x86/kvm: Use generic xfer to guest work function")
Reported-by: Peter Foley
Bisected-by: Doug Evans
Cc: Shakeel Butt
Cc: Thomas Gleixner
Cc: sta...@vger.kernel.org
Signed-off-by: Sean Christopherson
---
ke
that
mirror kernel code, e.g. linux/types.h. This allows the new test in
patch 4 to reference __NR_rseq without having to manually define it.
Patch 4 is a regression test for the KVM+rseq bug.
Patch 5 is a cleanup made possible by patch 3.
Sean Christopherson (5):
KVM: rseq: Update rseq when
red by KVM
without updating rseq, leading to a stale CPU ID and other badness.
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/.gitignore | 1 +
tools/testing/selftests/kvm/Makefile| 3 +
tools/testing/selftests/kvm/rseq_test.c | 131
3 files ch
Signed-off-by: Sean Christopherson
---
tools/arch/x86/include/uapi/asm/unistd_64.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tools/arch/x86/include/uapi/asm/unistd_64.h
b/tools/arch/x86/include/uapi/asm/unistd_64.h
index 4205ed4158bf..cb52a3a8b8fc 100644
--- a/tools/arch/x86/include
/kvm's control.
Prior to commit cec07f53c398 ("perf tools: Move syscall number fallbacks
from perf-sys.h to tools/arch/x86/include/asm/"), the handcoded numbers
were actual fallbacks, i.e. overriding unistd_{32,64}.h from the kernel
headers was unintentional.
Signed-off-by: Sean Chri
On Thu, Aug 26, 2021, Mathieu Desnoyers wrote:
> - On Aug 25, 2021, at 8:51 PM, Sean Christopherson sea...@google.com
> wrote:
> >> >> + r = sched_setaffinity(0, sizeof(allowed_mask),
> >> >> _mask);
> >> >> + TE
On Mon, Aug 23, 2021, Mathieu Desnoyers wrote:
> [ re-send to Darren Hart ]
>
> - On Aug 23, 2021, at 11:18 AM, Mathieu Desnoyers
> mathieu.desnoy...@efficios.com wrote:
>
> > - On Aug 20, 2021, at 6:50 PM, Sean Christopherson sea...@google.com
> > wrote:
>
]
- Add Mathieu's ack for patch 2.
- Add more comments in the test.
v1: https://lkml.kernel.org/r/20210818001210.4073390-1-sea...@google.com
Sean Christopherson (5):
KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM
guest
entry: rseq: Call rseq_handle_notify_resume
with KVM,
e.g. due to the CPU ID being stale after task migration.
Fixes: 72c3c0fe54a3 ("x86/kvm: Use generic xfer to guest work function")
Reported-by: Peter Foley
Bisected-by: Doug Evans
Cc: Shakeel Butt
Cc: Thomas Gleixner
Cc: sta...@vger.kernel.org
Signed-off-by: Sean Christopherson
-
ume() back in 2012. Punt cleaning that
mess up to future patches.
No functional change intended.
Acked-by: Mathieu Desnoyers
Signed-off-by: Sean Christopherson
---
arch/arm/kernel/signal.c | 1 -
arch/arm64/kernel/signal.c | 1 -
arch/csky/kernel/signal.c| 4 +---
arch/mips/kernel/signa
red by KVM
without updating rseq, leading to a stale CPU ID and other badness.
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/.gitignore | 1 +
tools/testing/selftests/kvm/Makefile| 3 +
tools/testing/selftests/kvm/rseq_test.c | 154
3 files ch
/kvm's control.
Prior to commit cec07f53c398 ("perf tools: Move syscall number fallbacks
from perf-sys.h to tools/arch/x86/include/asm/"), the handcoded numbers
were actual fallbacks, i.e. overriding unistd_{32,64}.h from the kernel
headers was unintentional.
Signed-off-by: Sean Chri
Signed-off-by: Sean Christopherson
---
tools/arch/x86/include/uapi/asm/unistd_64.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tools/arch/x86/include/uapi/asm/unistd_64.h
b/tools/arch/x86/include/uapi/asm/unistd_64.h
index 4205ed4158bf..cb52a3a8b8fc 100644
--- a/tools/arch/x86/include
On Fri, Aug 20, 2021, Mathieu Desnoyers wrote:
> Without the lazy clear scheme, a rseq c.s. would look like:
>
> * init(rseq_cs)
> * cpu = TLS->rseq::cpu_id_start
> * [1] TLS->rseq::rseq_cs = rseq_cs
> * [start_ip]
On Fri, Aug 20, 2021, Mathieu Desnoyers wrote:
> I still really hate flakiness in tests, because then people stop caring when
> they
> fail once in a while. And with the nature of rseq, a once-in-a-while failure
> is a
> big deal. Let's see if we can use other tricks to ensure stability of the
Gardon
Signed-off-by: Sean Christopherson
---
tools/arch/x86/include/uapi/asm/unistd_64.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tools/arch/x86/include/uapi/asm/unistd_64.h
b/tools/arch/x86/include/uapi/asm/unistd_64.h
index 4205ed4158bf..cb52a3a8b8fc 100644
--- a/tools/arch/x86
red by KVM
without updating rseq, leading to a stale CPU ID and other badness.
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/.gitignore | 1 +
tools/testing/selftests/kvm/Makefile| 3 +
tools/testing/selftests/kvm/rseq_test.c | 236
3 files ch
ume() back in 2012. Punt cleaning that
mess up to future patches.
No functional change intended.
Acked-by: Mathieu Desnoyers
Signed-off-by: Sean Christopherson
---
arch/arm/kernel/signal.c | 1 -
arch/arm64/kernel/signal.c | 1 -
arch/csky/kernel/signal.c| 4 +---
arch/mips/kernel/signa
/kvm's control.
Prior to commit cec07f53c398 ("perf tools: Move syscall number fallbacks
from perf-sys.h to tools/arch/x86/include/asm/"), the handcoded numbers
were actual fallbacks, i.e. overriding unistd_{32,64}.h from the kernel
headers was unintentional.
Signed-off-by: Sean Chri
Signed-off-by: Sean Christopherson
---
kernel/entry/kvm.c | 4 +++-
kernel/rseq.c | 14 +++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/kernel/entry/kvm.c b/kernel/entry/kvm.c
index 49972ee99aff..049fd06b4c3d 100644
--- a/kernel/entry/kvm.c
+++ b/kernel/entry/kvm.
. [Mathieu]
- Add Mathieu's ack for patch 2.
- Add more comments in the test.
v1: https://lkml.kernel.org/r/20210818001210.4073390-1-sea...@google.com
Sean Christopherson (5):
KVM: rseq: Update rseq when processing NOTIFY_RESUME on xfer to KVM
guest
entry: rseq: Call rseq_handle_not
On Mon, Sep 06, 2021, Paolo Bonzini wrote:
> On 20/08/21 20:51, Mathieu Desnoyers wrote:
> > > Ah, or is it the case that rseq_cs is non-NULL if and only if userspace
> > > is in an
> > > rseq critical section, and because syscalls in critical sections are
> > > illegal, by
> > > definition
On Mon, Sep 13, 2021, Juergen Gross wrote:
> KVM_MAX_VCPU_ID is not specifying the highest allowed vcpu-id, but the
> number of allowed vcpu-ids. This has already led to confusion, so
> rename KVM_MAX_VCPU_ID to KVM_MAX_VCPU_IDS to make its semantics more
> clear
My hesitation with this rename is
On Mon, Sep 13, 2021, Eduardo Habkost wrote:
> On Mon, Sep 13, 2021 at 12:24 PM Sean Christopherson
> wrote:
> >
> > On Mon, Sep 13, 2021, Juergen Gross wrote:
> > > KVM_MAX_VCPU_ID is not specifying the highest allowed vcpu-id, but the
> > > number of al
On Tue, Jul 27, 2021, Tom Lendacky wrote:
> @@ -451,7 +450,7 @@ void __init mem_encrypt_free_decrypted_mem(void)
>* The unused memory range was mapped decrypted, change the encryption
>* attribute from decrypted to encrypted before freeing it.
>*/
> - if
On Fri, Aug 27, 2021, Mathieu Desnoyers wrote:
> > So there are effectively three reasons we want a delay:
> >
> > 1. To allow sched_setaffinity() to coincide with ioctl(KVM_RUN) before KVM
> > can
> > enter the guest so that the guest doesn't need an arch-specific VM-Exit
> > source.
> >
On Fri, Sep 01, 2023, 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 for
On Tue, Sep 05, 2023, David Stevens wrote:
> On Wed, Jul 12, 2023 at 7:00 AM Sean Christopherson wrote:
> >
> > On Tue, Jul 11, 2023, Zhi Wang wrote:
> > > On Thu, 6 Jul 2023 15:49:39 +0900
> > > David Stevens wrote:
> > >
> > > > On W
On Wed, Sep 06, 2023, David Stevens wrote:
> On Wed, Sep 6, 2023 at 9:45 AM Sean Christopherson wrote:
> >
> > On Tue, Sep 05, 2023, David Stevens wrote:
> > > For property 2, FOLL_GET is also important. If guarded_by_mmu_notifier
> > > is set, then we're all good
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
Cc: Anish Moorthy
Suggested-by: S
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
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 insertions(+), 5 deletions(-)
diff
serspace
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 helper
KVM: selftests: Expand set_memory_region_test to validate
e 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
ly
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/virt/
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/powerpc.c
@@ -635,11
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 --git a/arch/pow
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
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: 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
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/private_mem_conversi
-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
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
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 Christopherson
Signed-off
diate_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 b/arch/x86/kvm/x86.c
inde
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/powerpc/kvm/Kconfig
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
bit 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
---
.
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
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
ly 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 insertions(+)
create m
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
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 | 60
o 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_main.
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-off-by: Sean
(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
index
estroy 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
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/selftests
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 Christopherson
: 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
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
> >
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 i
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
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 changed, 45
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
-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/vfio.h b
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-off-by: Sean
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
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
---
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 bb3cb005873e.
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_emulate.h | 3 +++
arch/arm64/include/
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]
Signed-of
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
tails 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 72fee202d3ec..ea
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 either).
Signed-of
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..89b40c34f0af 100
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
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/events/in
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
1 - 100 of 467 matches
Mail list logo