Re: [PATCH 00/21] hrtimers: Switch to new hrtimer interface functions (1/5)

2024-10-28 Thread Sean Christopherson
On Mon, Oct 28, 2024, Nam Cao wrote: > This is the first part of a 5-part series (split for convenience). All 5 > parts are: > > Part 1: https://lore.kernel.org/lkml/cover.1729864615.git.nam...@linutronix.de > Part 2: https://lore.kernel.org/lkml/cover.1729864823.git.nam...@linutronix.de > Part 3:

Re: [PATCH] i915: fix DRM_I915_GVT_KVMGT dependencies

2024-10-16 Thread Sean Christopherson
On Tue, Oct 15, 2024, Arnd Bergmann wrote: > From: Arnd Bergmann > > Depending on x86 and KVM is not enough, as the kvm helper functions > that get called here are controlled by CONFIG_KVM_X86, which is > disabled if both KVM_INTEL and KVM_AMD are turned off. > > ERROR: modpost: "kvm_write_track

Re: [Intel-gfx] [PATCH v4 16/29] KVM: x86: Reject memslot MOVE operations if KVMGT is attached

2023-08-31 Thread Sean Christopherson
On Thu, Aug 31, 2023, Like Xu wrote: > On 31/8/2023 4:50 am, Sean Christopherson wrote: > > On Wed, Aug 30, 2023, Like Xu wrote: > > > On 2023/7/29 09:35, Sean Christopherson wrote: > > > > Disallow moving memslots if the VM has external page-track users, i.e. >

Re: [Intel-gfx] [PATCH v4 16/29] KVM: x86: Reject memslot MOVE operations if KVMGT is attached

2023-08-30 Thread Sean Christopherson
On Wed, Aug 30, 2023, Like Xu wrote: > On 2023/7/29 09:35, Sean Christopherson wrote: > > Disallow moving memslots if the VM has external page-track users, i.e. if > > KVMGT is being used to expose a virtual GPU to the guest, as KVMGT doesn't > > correctly ha

Re: [Intel-gfx] [PATCH 19/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-08-10 Thread Sean Christopherson
On Thu, Aug 10, 2023, Yan Zhao wrote: > On Thu, Aug 10, 2023 at 07:21:03AM +0800, Yan Zhao wrote: > > > Reading the value after acquiring mmu_lock ensures that both vCPUs will > > > see whatever > > > value "loses" the race, i.e. whatever written value is processed second > > > ('Y' in the > > >

Re: [Intel-gfx] [PATCH 19/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-08-09 Thread Sean Christopherson
On Wed, Aug 09, 2023, Yan Zhao wrote: > On Mon, Aug 07, 2023 at 10:19:07AM -0700, Sean Christopherson wrote: > > On Mon, Aug 07, 2023, Like Xu wrote: > > > On 23/12/2022 8:57 am, Sean Christopherson wrote: > > > > +static inline void kvm_page_track_write(struct kvm_

Re: [Intel-gfx] [PATCH 19/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-08-07 Thread Sean Christopherson
On Mon, Aug 07, 2023, Like Xu wrote: > On 23/12/2022 8:57 am, Sean Christopherson wrote: > > +static inline void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, > > + const u8 *new, int bytes) > > +{ > > + __kvm_page_track_

Re: [Intel-gfx] [PATCH v4 00/29] drm/i915/gvt: KVM: KVMGT fixes and page-track cleanups

2023-08-03 Thread Sean Christopherson
On Fri, 28 Jul 2023 18:35:06 -0700, Sean Christopherson wrote: > Fix a handful of minor bugs in KVMGT, and overhaul KVM's page-track APIs > to provide a leaner and cleaner interface. The motivation for this > series is to (significantly) reduce the number of KVM APIs that KVMGT

Re: [Intel-gfx] [PATCH v4 06/29] drm/i915/gvt: Explicitly check that vGPU is attached before shadowing

2023-08-01 Thread Sean Christopherson
On Tue, Aug 01, 2023, Yan Zhao wrote: > On Fri, Jul 28, 2023 at 06:35:12PM -0700, Sean Christopherson wrote: > > Move the check that a vGPU is attacked from is_2MB_gtt_possible() all the > typo: "attacked" --> "attached" > > > way up to shadow_ppgtt_mm

[Intel-gfx] [PATCH v4.1] drm/i915/gvt: Explicitly check that vGPU is attached before shadowing

2023-08-01 Thread Sean Christopherson
TEL_VGPU_STATUS_ATTACHED | |-> intel_vgpu_page_track_handler() | |-> ppgtt_write_protection_handler() | |-> ppgtt_handle_guest_write_page_table_bytes() | |-> ppgtt_handle_guest_write_page_table() [see 1] Signed-off-by: Sean Christopherson --- v4.1: - Actually ma

[Intel-gfx] [PATCH v4 27/29] KVM: x86/mmu: Drop @slot param from exported/external page-track APIs

2023-07-28 Thread Sean Christopherson
ended. Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 7 +-- arch/x86/kvm/mmu/mmu.c| 4 +- arch/x86/kvm/mmu/page_track.c | 85 --- arch/x86/kvm/mmu/page_track.h

[Intel-gfx] [PATCH v4 25/29] KVM: x86/mmu: Assert that correct locks are held for page write-tracking

2023-07-28 Thread Sean Christopherson
Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/page_track.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c index b835ba7f325c..29ae61f1e303 100644 --- a/

[Intel-gfx] [PATCH v4 26/29] KVM: x86/mmu: Bug the VM if write-tracking is used but not enabled

2023-07-28 Thread Sean Christopherson
Bug the VM if something attempts to write-track a gfn, but write-tracking isn't enabled. The VM is doomed (and KVM has an egregious bug) if KVM or KVMGT wants to shadow guest page tables but can't because write-tracking isn't enabled. Tested-by: Yongwei Ma Signed-off-by: Sean

[Intel-gfx] [PATCH v4 24/29] KVM: x86/mmu: Rename page-track APIs to reflect the new reality

2023-07-28 Thread Sean Christopherson
ange intended. Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 8 arch/x86/kvm/mmu/mmu.c| 8 arch/x86/kvm/mmu/page_track.c | 21 + arch/x86/kvm/mmu/page_track.h | 4 ++-- drivers

[Intel-gfx] [PATCH v4 28/29] KVM: x86/mmu: Handle KVM bookkeeping in page-track APIs, not callers

2023-07-28 Thread Sean Christopherson
M iff attachment to VM is successful"). Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 11 +-- arch/x86/kvm/mmu/page_track.c | 18 -- drivers/gpu/drm/i915/gvt/kvmgt.c | 17 +++---

[Intel-gfx] [PATCH v4 29/29] drm/i915/gvt: Drop final dependencies on KVM internal details

2023-07-28 Thread Sean Christopherson
7;s no reason to use KVM's helper for this one case. No functional change intended. Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gvt.h | 3 ++- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 2 files changed, 3 insertions(+), 2 del

[Intel-gfx] [PATCH v4 21/29] KVM: x86/mmu: Move KVM-only page-track declarations to internal header

2023-07-28 Thread Sean Christopherson
r memslots. This is a baby step toward making kvm_host.h a KVM-internal header in the very distant future. Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 21 ++--- arch/x86/kvm/mmu/mmu.c| 3 ++- arch/x

[Intel-gfx] [PATCH v4 22/29] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-07-28 Thread Sean Christopherson
t; so that including headers directly from the command line, e.g. for testing include guards, doesn't fail due to a struct having an incomplete type. Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/

[Intel-gfx] [PATCH v4 20/29] KVM: x86: Remove the unused page-track hook track_flush_slot()

2023-07-28 Thread Sean Christopherson
From: Yan Zhao Remove ->track_remove_slot(), there are no longer any users and it's unlikely a "flush" hook will ever be the correct API to provide to an external page-track user. Cc: Zhenyu Wang Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao Tested-by: Yongwei

[Intel-gfx] [PATCH v4 19/29] drm/i915/gvt: switch from ->track_flush_slot() to ->track_remove_region()

2023-07-28 Thread Sean Christopherson
0% certain the memory region will be removed, i.e. is invoked slightly later in KVM's memslot modification flow. Cc: Zhenyu Wang Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao [sean: handle name change, massage changelog, rebase] Tested-by: Yan Zhao Tested-by: Yongwei Ma

[Intel-gfx] [PATCH v4 18/29] KVM: x86: Add a new page-track hook to handle memslot deletion

2023-07-28 Thread Sean Christopherson
Tested-by: Yongwei Ma Signed-off-by: Yan Zhao Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 12 arch/x86/kvm/mmu/page_track.c | 27 +-- arch/x86/kvm/x86.c| 3 +++

[Intel-gfx] [PATCH v4 23/29] KVM: x86/mmu: Drop infrastructure for multiple page-track modes

2023-07-28 Thread Sean Christopherson
en Gardon Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 12 +-- arch/x86/include/asm/kvm_page_track.h | 11 +-- arch/x86/kvm/mmu/mmu.c| 14 ++-- arch/x86/kvm/mmu/page_track.c | 111 -- arch/x86/

[Intel-gfx] [PATCH v4 16/29] KVM: x86: Reject memslot MOVE operations if KVMGT is attached

2023-07-28 Thread Sean Christopherson
commit edd4fa37baa6 ("KVM: x86: Allocate new rmap and large page tracking when moving memslot"). Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 3 +++ arch/x86/kvm/mmu/page_track.c

[Intel-gfx] [PATCH v4 15/29] KVM: drm/i915/gvt: Drop @vcpu from KVM's ->track_write() hook

2023-07-28 Thread Sean Christopherson
Drop @vcpu from KVM's ->track_write() hook provided for external users of the page-track APIs now that KVM itself doesn't use the page-track mechanism. Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 5 ++

[Intel-gfx] [PATCH v4 17/29] drm/i915/gvt: Don't bother removing write-protection on to-be-deleted slot

2023-07-28 Thread Sean Christopherson
its write-tracking metadata is about to be deleted. Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/

[Intel-gfx] [PATCH v4 14/29] KVM: x86/mmu: Don't bounce through page-track mechanism for guest PTEs

2023-07-28 Thread Sean Christopherson
viewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/mmu.h | 2 ++ arch/x86/kvm/mmu/mmu.c | 13 ++--- arch/x86/kvm/mmu/page_track.c | 2 ++ 4 files changed, 6 insertions(+), 12 delet

[Intel-gfx] [PATCH v4 12/29] KVM: x86/mmu: Move kvm_arch_flush_shadow_{all, memslot}() to mmu.c

2023-07-28 Thread Sean Christopherson
xpose kvm_mmu_zap_all_fast() outside of mmu.c. Keeping everything in mmu.c will also likely simplify supporting TDX, which intends to do zap only relevant SPTEs on memslot updates. No functional change intended. Suggested-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christoph

[Intel-gfx] [PATCH v4 11/29] drm/i915/gvt: Protect gfn hash table with vgpu_lock

2023-07-28 Thread Sean Christopherson
|-> mutex_lock(&vgpu->cache_lock); Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 55 +++ drivers/gpu/drm/i915/gvt/page_track.c | 10 + 2 files changed, 33 inser

[Intel-gfx] [PATCH v4 10/29] drm/i915/gvt: Drop unused helper intel_vgpu_reset_gtt()

2023-07-28 Thread Sean Christopherson
allow a protecting the gfn hash with vgpu_lock without too much fuss. No functional change intended. Fixes: ba25d977571e ("drm/i915/gvt: Do not destroy ppgtt_mm during vGPU D3->D0.") Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu

[Intel-gfx] [PATCH v4 13/29] KVM: x86/mmu: Don't rely on page-track mechanism to flush on memslot change

2023-07-28 Thread Sean Christopherson
/20221110014821.1548347-2-sea...@google.com Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index c6dee659d592

[Intel-gfx] [PATCH v4 08/29] drm/i915/gvt: Don't rely on KVM's gfn_to_pfn() to query possible 2M GTT

2023-07-28 Thread Sean Christopherson
;t backed by a compatible hugepage in the host. Dropping the pre-check on a THP makes it much more likely that the "error" will be encountered in normal operation. Reviewed-by: Yan Zhao Tested-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/

[Intel-gfx] [PATCH v4 09/29] drm/i915/gvt: Use an "unsigned long" to iterate over memslot gfns

2023-07-28 Thread Sean Christopherson
: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 97c6d3c53710..6f52886c4051 100644 --- a/drivers/

[Intel-gfx] [PATCH v4 07/29] drm/i915/gvt: Error out on an attempt to shadowing an unknown GTT entry type

2023-07-28 Thread Sean Christopherson
) into the case statements so that the 2MiB case can try intel_gvt_dma_map_guest_page() and fallback to splitting the entry on failure. Reviewed-by: Zhi Wang Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/

[Intel-gfx] [PATCH v4 05/29] drm/i915/gvt: Put the page reference obtained by KVM's gfn_to_pfn()

2023-07-28 Thread Sean Christopherson
m/i915/gvt: Add 2M huge gtt support") Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c ind

[Intel-gfx] [PATCH v4 06/29] drm/i915/gvt: Explicitly check that vGPU is attached before shadowing

2023-07-28 Thread Sean Christopherson
TEL_VGPU_STATUS_ATTACHED | |-> intel_vgpu_page_track_handler() | |-> ppgtt_write_protection_handler() | |-> ppgtt_handle_guest_write_page_table_bytes() | |-> ppgtt_handle_guest_write_page_table() [see 1] Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/

[Intel-gfx] [PATCH v4 04/29] drm/i915/gvt: Don't try to unpin an empty page range

2023-07-28 Thread Sean Christopherson
ff-by: Yan Zhao [sean: write changelog] Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 429f0f993a13..0366a699baf5 100644 --- a/dr

[Intel-gfx] [PATCH v4 03/29] drm/i915/gvt: Verify hugepages are contiguous in physical address space

2023-07-28 Thread Sean Christopherson
with discontiguous pfns. Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index de675d799c7d..429f0f993a13 1006

[Intel-gfx] [PATCH v4 01/29] drm/i915/gvt: Verify pfn is "valid" before dereferencing "struct page"

2023-07-28 Thread Sean Christopherson
t page". Fixes: b901b252b6cf ("drm/i915/gvt: Add 2M huge gtt support") Reviewed-by: Yan Zhao Tested-by: Yongwei Ma Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/driver

[Intel-gfx] [PATCH v4 02/29] drm/i915/gvt: remove interface intel_gvt_is_valid_gfn

2023-07-28 Thread Sean Christopherson
intel_gvt_is_valid_gfn() to do GFN validity check from KVM side while later mapping the GFN through VFIO interface is unnecessarily fragile and confusing for unaware readers. Signed-off-by: Yan Zhao [sean: remove now-unused local variables] Acked-by: Zhi Wang Tested-by: Yongwei Ma Signed-of

[Intel-gfx] [PATCH v4 00/29] drm/i915/gvt: KVM: KVMGT fixes and page-track cleanups

2023-07-28 Thread Sean Christopherson
@kvm directly in the inner __kvm_page_track_write(). [Yan] - Delete the gfn sanity check that relies on kvm_is_visible_gfn() instead of providing a dedicated interface. [Yan] v1: https://lore.kernel.org/lkml/20221223005739.1295925-1-sea...@google.com Sean Christopherson (24): drm/i915/gvt: V

Re: [Intel-gfx] [PATCH 2/2] eventfd: simplify eventfd_signal_mask()

2023-07-13 Thread Sean Christopherson
On Thu, Jul 13, 2023, Christian Brauner wrote: > diff --git a/fs/eventfd.c b/fs/eventfd.c > index dc9e01053235..077be5da72bd 100644 > --- a/fs/eventfd.c > +++ b/fs/eventfd.c > @@ -43,9 +43,10 @@ struct eventfd_ctx { > int id; > }; > > -__u64 eventfd_signal_mask(struct eventfd_ctx *ctx, __u

Re: [Intel-gfx] [PATCH v3 03/28] drm/i915/gvt: Verify hugepages are contiguous in physical address space

2023-05-18 Thread Sean Christopherson
On Thu, May 18, 2023, Yan Zhao wrote: > On Wed, May 17, 2023 at 07:50:26AM -0700, Sean Christopherson wrote: > > On Tue, May 16, 2023, Yan Zhao wrote: > > > hi Sean > > > > > > Do you think it's necessary to double check that struct page pointers &g

Re: [Intel-gfx] [PATCH v3 03/28] drm/i915/gvt: Verify hugepages are contiguous in physical address space

2023-05-17 Thread Sean Christopherson
On Tue, May 16, 2023, Yan Zhao wrote: > hi Sean > > Do you think it's necessary to double check that struct page pointers > are also contiguous? No, the virtual address space should be irrelevant. The only way it would be problematic is if something in dma_map_page() expected to be able to acces

Re: [Intel-gfx] [PATCH v3 05/28] drm/i915/gvt: Explicitly check that vGPU is attached before shadowing

2023-05-15 Thread Sean Christopherson
On Mon, May 15, 2023, Zhi A Wang wrote: > On 5/13/2023 8:35 AM, Sean Christopherson wrote: > > Move the check that a vGPU is attacked from is_2MB_gtt_possible() to its > > sole caller, ppgtt_populate_shadow_entry(). All of the paths in > > ppgtt_populate_shadow_entry()

[Intel-gfx] [PATCH v3 27/28] KVM: x86/mmu: Handle KVM bookkeeping in page-track APIs, not callers

2023-05-12 Thread Sean Christopherson
M iff attachment to VM is successful"). Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 11 +-- arch/x86/kvm/mmu/page_track.c | 18 -- drivers/gpu/drm/i915/gvt/kvmgt.c | 17 +++-- 3 files c

[Intel-gfx] [PATCH v3 25/28] KVM: x86/mmu: Bug the VM if write-tracking is used but not enabled

2023-05-12 Thread Sean Christopherson
Bug the VM if something attempts to write-track a gfn, but write-tracking isn't enabled. The VM is doomed (and KVM has an egregious bug) if KVM or KVMGT wants to shadow guest page tables but can't because write-tracking isn't enabled. Signed-off-by: Sean Christopherson --- a

[Intel-gfx] [PATCH v3 22/28] KVM: x86/mmu: Drop infrastructure for multiple page-track modes

2023-05-12 Thread Sean Christopherson
ardon Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 12 +-- arch/x86/include/asm/kvm_page_track.h | 11 +-- arch/x86/kvm/mmu/mmu.c| 14 ++-- arch/x86/kvm/mmu/page_track.c | 111 -- arch/x86/kvm/mmu/page_t

[Intel-gfx] [PATCH v3 28/28] drm/i915/gvt: Drop final dependencies on KVM internal details

2023-05-12 Thread Sean Christopherson
7;s no reason to use KVM's helper for this one case. No functional change intended. Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gvt.h | 3 ++- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/d

[Intel-gfx] [PATCH v3 26/28] KVM: x86/mmu: Drop @slot param from exported/external page-track APIs

2023-05-12 Thread Sean Christopherson
ended. Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 7 +-- arch/x86/kvm/mmu/mmu.c| 4 +- arch/x86/kvm/mmu/page_track.c | 85 --- arch/x86/kvm/mmu/page_track.h | 5 ++ drivers/gpu/drm

[Intel-gfx] [PATCH v3 21/28] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-05-12 Thread Sean Christopherson
t; so that including headers directly from the command line, e.g. for testing include guards, doesn't fail due to a struct having an incomplete type. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/include/asm/kvm_page_track.h | 22 +--

[Intel-gfx] [PATCH v3 24/28] KVM: x86/mmu: Assert that correct locks are held for page write-tracking

2023-05-12 Thread Sean Christopherson
Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/page_track.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/mmu/page_track.c b/arch/x86/kvm/mmu/page_track.c index b835ba7f325c..29ae61f1e303 100644 --- a/arch/x86/kvm/mmu/page

[Intel-gfx] [PATCH v3 20/28] KVM: x86/mmu: Move KVM-only page-track declarations to internal header

2023-05-12 Thread Sean Christopherson
r memslots. This is a baby step toward making kvm_host.h a KVM-internal header in the very distant future. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 21 ++--- arch/x86/kvm/mmu/mmu.c| 3 ++- arch/x86/kvm/mmu/page_track.c

[Intel-gfx] [PATCH v3 23/28] KVM: x86/mmu: Rename page-track APIs to reflect the new reality

2023-05-12 Thread Sean Christopherson
intended. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 8 arch/x86/kvm/mmu/mmu.c| 8 arch/x86/kvm/mmu/page_track.c | 21 + arch/x86/kvm/mmu/page_track.h | 4 ++-- drivers/gpu/drm/i915/gvt/

[Intel-gfx] [PATCH v3 17/28] KVM: x86: Add a new page-track hook to handle memslot deletion

2023-05-12 Thread Sean Christopherson
nternals (memslots). This will help set the stage for additional cleanups to the page-track APIs. Opportunistically align the existing srcu_read_lock_held() usage so that the new case doesn't stand out like a sore thumb (and not aligning the new code makes bots unhappy). Cc: Zhenyu Wang Sig

[Intel-gfx] [PATCH v3 15/28] KVM: x86: Reject memslot MOVE operations if KVMGT is attached

2023-05-12 Thread Sean Christopherson
commit edd4fa37baa6 ("KVM: x86: Allocate new rmap and large page tracking when moving memslot"). Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 3 +++ arch/x86/kvm/mmu/page_track.c | 5 + arch/x86/kvm/x86.c

[Intel-gfx] [PATCH v3 19/28] KVM: x86: Remove the unused page-track hook track_flush_slot()

2023-05-12 Thread Sean Christopherson
From: Yan Zhao Remove ->track_remove_slot(), there are no longer any users and it's unlikely a "flush" hook will ever be the correct API to provide to an external page-track user. Cc: Zhenyu Wang Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao Signed-off-by: S

[Intel-gfx] [PATCH v3 18/28] drm/i915/gvt: switch from ->track_flush_slot() to ->track_remove_region()

2023-05-12 Thread Sean Christopherson
0% certain the memory region will be removed, i.e. is invoked slightly later in KVM's memslot modification flow. Cc: Zhenyu Wang Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao [sean: handle name change, massage changelog, rebase] Tested-by: Yan Zhao Signed-off-by: Sean Christoph

[Intel-gfx] [PATCH v3 16/28] drm/i915/gvt: Don't bother removing write-protection on to-be-deleted slot

2023-05-12 Thread Sean Christopherson
its write-tracking metadata is about to be deleted. Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index aae

[Intel-gfx] [PATCH v3 13/28] KVM: x86/mmu: Don't bounce through page-track mechanism for guest PTEs

2023-05-12 Thread Sean Christopherson
iewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/mmu.h | 2 ++ arch/x86/kvm/mmu/mmu.c | 13 ++--- arch/x86/kvm/mmu/page_track.c | 2 ++ 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/arc

[Intel-gfx] [PATCH v3 14/28] KVM: drm/i915/gvt: Drop @vcpu from KVM's ->track_write() hook

2023-05-12 Thread Sean Christopherson
Drop @vcpu from KVM's ->track_write() hook provided for external users of the page-track APIs now that KVM itself doesn't use the page-track mechanism. Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 5 ++--- arch/x86/kvm/mmu

[Intel-gfx] [PATCH v3 09/28] drm/i915/gvt: Drop unused helper intel_vgpu_reset_gtt()

2023-05-12 Thread Sean Christopherson
allow a protecting the gfn hash with vgpu_lock without too much fuss. No functional change intended. Fixes: ba25d977571e ("drm/i915/gvt: Do not destroy ppgtt_mm during vGPU D3->D0.") Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/g

[Intel-gfx] [PATCH v3 12/28] KVM: x86/mmu: Don't rely on page-track mechanism to flush on memslot change

2023-05-12 Thread Sean Christopherson
/20221110014821.1548347-2-sea...@google.com Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 2e4476d38377..23a79723031b 100644 --- a/arch/x86/kvm/mmu

[Intel-gfx] [PATCH v3 10/28] drm/i915/gvt: Protect gfn hash table with vgpu_lock

2023-05-12 Thread Sean Christopherson
|-> mutex_lock(&vgpu->cache_lock); Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 55 +++ drivers/gpu/drm/i915/gvt/page_track.c | 10 + 2 files changed, 33 insertions(+), 32 deleti

[Intel-gfx] [PATCH v3 11/28] KVM: x86/mmu: Move kvm_arch_flush_shadow_{all, memslot}() to mmu.c

2023-05-12 Thread Sean Christopherson
xpose kvm_mmu_zap_all_fast() outside of mmu.c. Keeping everything in mmu.c will also likely simplify supporting TDX, which intends to do zap only relevant SPTEs on memslot updates. No functional change intended. Suggested-by: Yan Zhao Signed-off-by: Sean Christopherson --- arch/x86/includ

[Intel-gfx] [PATCH v3 07/28] drm/i915/gvt: Don't rely on KVM's gfn_to_pfn() to query possible 2M GTT

2023-05-12 Thread Sean Christopherson
;t backed by a compatible hugepage in the host. Dropping the pre-check on a THP makes it much more likely that the "error" will be encountered in normal operation. Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 49 ++-- dr

[Intel-gfx] [PATCH v3 08/28] drm/i915/gvt: Use an "unsigned long" to iterate over memslot gfns

2023-05-12 Thread Sean Christopherson
ed-by: Yan Zhao Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 92ceefe1e6fb..117bac85ac2c 100644 --- a/drivers/gpu/drm/i915/gvt/kvmg

[Intel-gfx] [PATCH v3 06/28] drm/i915/gvt: Error out on an attempt to shadowing an unknown GTT entry type

2023-05-12 Thread Sean Christopherson
) into the case statements so that the 2MiB case can try intel_gvt_dma_map_guest_page() and fallback to splitting the entry on failure. Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/g

[Intel-gfx] [PATCH v3 05/28] drm/i915/gvt: Explicitly check that vGPU is attached before shadowing

2023-05-12 Thread Sean Christopherson
will make it more obvious that a future cleanup of is_2MB_gtt_possible() isn't introducing a bug. Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i91

[Intel-gfx] [PATCH v3 04/28] drm/i915/gvt: Put the page reference obtained by KVM's gfn_to_pfn()

2023-05-12 Thread Sean Christopherson
m/i915/gvt: Add 2M huge gtt support") Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index f30922c55a0c..5426

[Intel-gfx] [PATCH v3 03/28] drm/i915/gvt: Verify hugepages are contiguous in physical address space

2023-05-12 Thread Sean Christopherson
with discontiguous pfns. Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index de675d799c7d..429f0f993a13 100644 --- a/drivers/gpu/drm/i

[Intel-gfx] [PATCH v3 02/28] drm/i915/gvt: remove interface intel_gvt_is_valid_gfn

2023-05-12 Thread Sean Christopherson
intel_gvt_is_valid_gfn() to do GFN validity check from KVM side while later mapping the GFN through VFIO interface is unnecessarily fragile and confusing for unaware readers. Signed-off-by: Yan Zhao [sean: remove now-unused local variables] Signed-off-by: Sean Christopherso

[Intel-gfx] [PATCH v3 01/28] drm/i915/gvt: Verify pfn is "valid" before dereferencing "struct page"

2023-05-12 Thread Sean Christopherson
t page". Fixes: b901b252b6cf ("drm/i915/gvt: Add 2M huge gtt support") Reviewed-by: Yan Zhao Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gtt.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i91

[Intel-gfx] [PATCH v3 00/28] drm/i915/gvt: KVM: KVMGT fixes and page-track cleanups

2023-05-12 Thread Sean Christopherson
k_write(). [Yan] - Delete the gfn sanity check that relies on kvm_is_visible_gfn() instead of providing a dedicated interface. [Yan] v1: https://lore.kernel.org/lkml/20221223005739.1295925-1-sea...@google.com Sean Christopherson (24): drm/i915/gvt: Verify pfn is "valid" before derefere

Re: [Intel-gfx] [PATCH v2 25/27] KVM: x86/mmu: Drop @slot param from exported/external page-track APIs

2023-05-11 Thread Sean Christopherson
On Mon, May 08, 2023, Yan Zhao wrote: > On Thu, May 04, 2023 at 10:17:20AM +0800, Yan Zhao wrote: > > On Wed, May 03, 2023 at 04:16:10PM -0700, Sean Christopherson wrote: > > > Finally getting back to this series... > > > > > > On Thu, Mar 23, 2023, Yan Zhao wr

Re: [Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-05-08 Thread Sean Christopherson
On Sat, May 06, 2023, Yan Zhao wrote: > On Sat, May 06, 2023 at 02:35:41PM +0800, Yan Zhao wrote: > > > > Maybe the checking of PageTransHuge(cur_page) and bailing out is not > > > > necessary. > > > > If a page is not transparent huge, but there are 512 contigous 4K > > > > pages, I think it's st

Re: [Intel-gfx] [PATCH v2 05/27] drm/i915/gvt: Verify VFIO-pinned page is THP when shadowing 2M gtt entry

2023-05-04 Thread Sean Christopherson
On Fri, Mar 17, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:36PM -0800, Sean Christopherson wrote: > > When shadowing a GTT entry with a 2M page, explicitly verify that the > > first page pinned by VFIO is a transparent hugepage instead of assuming > >

Re: [Intel-gfx] [PATCH v2 20/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-05-04 Thread Sean Christopherson
On Wed, Mar 15, 2023, Sean Christopherson wrote: > On Wed, Mar 15, 2023, Yan Zhao wrote: > > On Fri, Mar 10, 2023 at 04:22:51PM -0800, Sean Christopherson wrote: > > > Disable the page-track notifier code at compile time if there are no > > &

Re: [Intel-gfx] [PATCH v2 25/27] KVM: x86/mmu: Drop @slot param from exported/external page-track APIs

2023-05-03 Thread Sean Christopherson
Finally getting back to this series... On Thu, Mar 23, 2023, Yan Zhao wrote: > On Fri, Mar 17, 2023 at 04:28:56PM +0800, Yan Zhao wrote: > > On Fri, Mar 10, 2023 at 04:22:56PM -0800, Sean Christopherson wrote: > > ... > > > +int kvm_write_track_add_gfn(st

Re: [Intel-gfx] [PATCH v2 16/27] KVM: x86: Add a new page-track hook to handle memslot deletion

2023-03-17 Thread Sean Christopherson
On Fri, Mar 17, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:47PM -0800, Sean Christopherson wrote: > > From: Yan Zhao > > > > Add a new page-track hook, track_remove_region(), that is called when a > > memslot DELETE operation is about to be committed. Th

Re: [Intel-gfx] [PATCH v2 01/27] drm/i915/gvt: Verify pfn is "valid" before dereferencing "struct page"

2023-03-15 Thread Sean Christopherson
On Wed, Mar 15, 2023, Andrzej Hajda wrote: > On 13.03.2023 16:37, Wang, Wei W wrote: > > On Saturday, March 11, 2023 8:23 AM, Sean Christopherson wrote: > > > diff --git a/drivers/gpu/drm/i915/gvt/gtt.c > > > b/drivers/gpu/drm/i915/gvt/gtt.c > > > ind

Re: [Intel-gfx] [PATCH v2 20/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-03-15 Thread Sean Christopherson
On Wed, Mar 15, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:51PM -0800, Sean Christopherson wrote: > > Disable the page-track notifier code at compile time if there are no > > external users, i.e. if CONFIG_KVM_EXTERNAL_WRITE_TRACKING=n. KVM itself > > now hooks emu

Re: [Intel-gfx] [PATCH v2 20/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-03-15 Thread Sean Christopherson
On Wed, Mar 15, 2023, Yan Zhao wrote: > Nit: there is a typo in the commit header: "iff" -> "if" > > > -void kvm_page_track_write(struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new, > > - int bytes) > > +void __kvm_page_track_write(struct kvm *kvm, gpa_t gpa, const u8 *new, int >

Re: [Intel-gfx] [PATCH v2 14/27] KVM: x86: Reject memslot MOVE operations if KVMGT is attached

2023-03-15 Thread Sean Christopherson
On Wed, Mar 15, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:45PM -0800, Sean Christopherson wrote: > > Disallow moving memslots if the VM has external page-track users, i.e. if > > KVMGT is being used to expose a virtual GPU to the guest, as KVM doesn't > > corr

Re: [Intel-gfx] [PATCH v2 11/27] KVM: x86/mmu: Don't rely on page-track mechanism to flush on memslot change

2023-03-15 Thread Sean Christopherson
On Wed, Mar 15, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:42PM -0800, Sean Christopherson wrote: > ... > > -static void kvm_mmu_invalidate_zap_pages_in_memslot(struct kvm *kvm, > > - struct kvm_memory_slot *slot, > > -

Re: [Intel-gfx] [PATCH v2 19/27] KVM: x86/mmu: Move KVM-only page-track declarations to internal header

2023-03-15 Thread Sean Christopherson
On Wed, Mar 15, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:50PM -0800, Sean Christopherson wrote: > > Bury the declaration of the page-track helpers that are intended only for > > internal KVM use in a "private" header. In addition to guarding against > >

Re: [Intel-gfx] [PATCH v2 04/27] drm/i915/gvt: Incorporate KVM memslot info into check for 2MiB GTT entry

2023-03-14 Thread Sean Christopherson
On Tue, Mar 14, 2023, Yan Zhao wrote: > On Fri, Mar 10, 2023 at 04:22:35PM -0800, Sean Christopherson wrote: > > Honor KVM's max allowed page size when determining whether or not a 2MiB > > GTT shadow page can be created for the guest. Querying KVM's max allowed &g

[Intel-gfx] [PATCH v2 27/27] drm/i915/gvt: Drop final dependencies on KVM internal details

2023-03-10 Thread Sean Christopherson
7;s no reason to use KVM's helper for this one case. No functional change intended. Signed-off-by: Sean Christopherson --- drivers/gpu/drm/i915/gvt/gvt.h | 3 ++- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/g

[Intel-gfx] [PATCH v2 26/27] KVM: x86/mmu: Handle KVM bookkeeping in page-track APIs, not callers

2023-03-10 Thread Sean Christopherson
M iff attachment to VM is successful"). Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 10 -- arch/x86/kvm/mmu/page_track.c | 18 -- drivers/gpu/drm/i915/gvt/kvmgt.c | 17 +++-- 3 files changed, 23 insertions(+), 22

[Intel-gfx] [PATCH v2 20/27] KVM: x86/mmu: Use page-track notifiers iff there are external users

2023-03-10 Thread Sean Christopherson
Disable the page-track notifier code at compile time if there are no external users, i.e. if CONFIG_KVM_EXTERNAL_WRITE_TRACKING=n. KVM itself now hooks emulated writes directly instead of relying on the page-track mechanism. Signed-off-by: Sean Christopherson --- arch/x86/include/asm

[Intel-gfx] [PATCH v2 25/27] KVM: x86/mmu: Drop @slot param from exported/external page-track APIs

2023-03-10 Thread Sean Christopherson
ended. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 8 +-- arch/x86/kvm/mmu/mmu.c| 4 +- arch/x86/kvm/mmu/page_track.c | 86 --- arch/x86/kvm/mmu/page_track.h | 5 ++ drivers/gpu/drm/i915/gvt/kvmgt.c

[Intel-gfx] [PATCH v2 22/27] KVM: x86/mmu: Rename page-track APIs to reflect the new reality

2023-03-10 Thread Sean Christopherson
intended. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 8 arch/x86/kvm/mmu/mmu.c| 8 arch/x86/kvm/mmu/page_track.c | 21 + arch/x86/kvm/mmu/page_track.h | 4 ++-- drivers/gpu/drm/i915/gvt/

[Intel-gfx] [PATCH v2 24/27] KVM: x86/mmu: Bug the VM if write-tracking is used but not enabled

2023-03-10 Thread Sean Christopherson
Bug the VM if something attempts to write-track a gfn, but write-tracking isn't enabled. The VM is doomed (and KVM has an egregious bug) if KVM or KVMGT wants to shadow guest page tables but can't because write-tracking isn't enabled. Signed-off-by: Sean Christopherson --- a

[Intel-gfx] [PATCH v2 23/27] KVM: x86/mmu: Assert that correct locks are held for page write-tracking

2023-03-10 Thread Sean Christopherson
When adding/removing gfns to/from write-tracking, assert that mmu_lock is held for write, and that either slots_lock or kvm->srcu is held. mmu_lock must be held for write to protect gfn_write_track's refcount, and SRCU or slots_lock must be held to protect the memslot itself. Signed-off-

[Intel-gfx] [PATCH v2 18/27] KVM: x86: Remove the unused page-track hook track_flush_slot()

2023-03-10 Thread Sean Christopherson
From: Yan Zhao Remove ->track_remove_slot(), there are no longer any users and it's unlikely a "flush" hook will ever be the correct API to provide to an external page-track user. Cc: Zhenyu Wang Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao Signed-off-by: S

[Intel-gfx] [PATCH v2 21/27] KVM: x86/mmu: Drop infrastructure for multiple page-track modes

2023-03-10 Thread Sean Christopherson
ardon Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 12 +-- arch/x86/include/asm/kvm_page_track.h | 11 +-- arch/x86/kvm/mmu/mmu.c| 14 ++-- arch/x86/kvm/mmu/page_track.c | 111 -- arch/x86/kvm/mmu/page_t

[Intel-gfx] [PATCH v2 19/27] KVM: x86/mmu: Move KVM-only page-track declarations to internal header

2023-03-10 Thread Sean Christopherson
r memslots. This is a baby step toward making kvm_host.h a KVM-internal header in the very distant future. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 26 - arch/x86/kvm/mmu/mmu.c| 3 ++- arch/x86/kvm/mmu/page_track.c

[Intel-gfx] [PATCH v2 17/27] drm/i915/gvt: switch from ->track_flush_slot() to ->track_remove_region()

2023-03-10 Thread Sean Christopherson
0% certain the memory region will be removed, i.e. is invoked slightly later in KVM's memslot modification flow. Cc: Zhenyu Wang Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao [sean: handle name change, massage changelog, rebase] Signed-off-by: Sean Christopherson --- drive

[Intel-gfx] [PATCH v2 12/27] KVM: x86/mmu: Don't bounce through page-track mechanism for guest PTEs

2023-03-10 Thread Sean Christopherson
e, whereas external users, i.e. KVMGT, have no ties to the current vCPU and so should never need the vCPU. Moving away from the page-track mechanism will allow dropping use of the page-track mechanism for KVM's own MMU, and will also allow simplifying and cleaning up the page-track APIs. Sign

[Intel-gfx] [PATCH v2 16/27] KVM: x86: Add a new page-track hook to handle memslot deletion

2023-03-10 Thread Sean Christopherson
nternals (memslots). This will help set the stage for additional cleanups to the page-track APIs. Cc: Zhenyu Wang Signed-off-by: Yan Zhao Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 12 arch/x86/kvm/mmu/page

[Intel-gfx] [PATCH v2 14/27] KVM: x86: Reject memslot MOVE operations if KVMGT is attached

2023-03-10 Thread Sean Christopherson
commit edd4fa37baa6 ("KVM: x86: Allocate new rmap and large page tracking when moving memslot"). Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_page_track.h | 3 +++ arch/x86/kvm/mmu/page_track.c | 5 + arch/x86/kvm/x86.c| 7 +++

  1   2   >