Signed-off-by: Oliver Upton
---
tools/testing/selftests/kvm/.gitignore| 1 +
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/aarch64/user_hypercalls.c | 130 ++
3 files changed, 132 insertions(+)
create mode 100644 tools/testing/selftests/kvm
to mix-and-match between calls handled in userspace vs.
KVM.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_host.h | 5
arch/arm64/include/uapi/asm/kvm.h | 15 ++
arch/arm64/kvm/arm.c | 10 +++
arch/arm64/kvm/hypercalls.c
Avoid the need to introduce yet another accessor for every argument
position with a generalized one instead. Align with the SMCCC
specification and count arguments starting from 1.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_hypercalls.h | 22
ev
Cc: kvmarm@lists.cs.columbia.edu
Oliver Upton (3):
KVM: arm64: Use a generalized accessor for SMCCC args
KVM: arm64: Allow userspace to trap SMCCC sub-ranges
KVM: selftests: Test user hypercalls
arch/arm64/include/asm/kvm_host.h | 5 +
arch/arm64/include/asm/kvm_hypercalls.h |
remaining
residue into the arch-specific include path.
No functional change intended.
Signed-off-by: Oliver Upton
---
The one time I forget to run checkpatch.pl I left the stupid Gerrit
Change-Id in the commit message...
MAINTAINERS | 1 -
.../arm64
remaining
residue into the arch-specific include path.
No functional change intended.
Signed-off-by: Oliver Upton
Change-Id: Iec1caf5a426fba5003abff2dc7f814e0ba398e00
---
MAINTAINERS | 1 -
.../arm64/include/asm/kvm_arch_timer.h | 5
Hi Gavin,
On Thu, Nov 10, 2022 at 08:23:36AM +0800, Gavin Shan wrote:
> On 11/8/22 5:56 AM, Oliver Upton wrote:
> > Passing new arguments by value to the visitor callbacks is extremely
> > inflexible for stuffing new parameters used by only some of the
> > visitors. Us
On Wed, Nov 09, 2022 at 09:53:45PM +, Sean Christopherson wrote:
> On Mon, Nov 07, 2022, Oliver Upton wrote:
> > Use RCU to safely walk the stage-2 page tables in parallel. Acquire and
> > release the RCU read lock when traversing the page tables. Defer the
> > freeing
On Wed, Nov 09, 2022 at 02:26:36PM -0800, Ben Gardon wrote:
> On Mon, Nov 7, 2022 at 1:59 PM Oliver Upton wrote:
> >
> > In order to service stage-2 faults in parallel, stage-2 table walkers
> > must take exclusive ownership of the PTE being worked on. An additional
&
On Wed, Nov 09, 2022 at 02:26:26PM -0800, Ben Gardon wrote:
> On Mon, Nov 7, 2022 at 1:58 PM Oliver Upton wrote:
> >
> > Create a helper to initialize a table and directly call
> > smp_store_release() to install it (for now). Prepare for a subsequent
> > change that ge
On Wed, Nov 09, 2022 at 02:23:33PM -0800, Ben Gardon wrote:
> On Mon, Nov 7, 2022 at 1:57 PM Oliver Upton wrote:
> >
> > A subsequent change to KVM will move the tear down of an unlinked
> > stage-2 subtree out of the critical path of the break-before-make
> > sequen
On Wed, Nov 09, 2022 at 02:23:08PM -0800, Ben Gardon wrote:
> On Mon, Nov 7, 2022 at 1:57 PM Oliver Upton wrote:
> >
> > Passing new arguments by value to the visitor callbacks is extremely
> > inflexible for stuffing new parameters used by only some of the
> > visito
On Tue, Nov 08, 2022 at 08:44:52AM +0800, Gavin Shan wrote:
> Frankly, I don't expect the capability to be disabled. Similar to
> KVM_CAP_DIRTY_LOG_RING
> or KVM_CAP_DIRTY_LOG_RING_ACQ_REL, it would a one-shot capability and only
> enablement is
> allowed. The disablement was suggested by Oliver
().
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 3 ++-
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +-
arch/arm64/kvm/hyp/pgtable.c | 5 +++--
arch/arm64/kvm/mmu.c | 31 ++-
4 files changed, 13 insertions(+), 28 deletions
stead let
stage2_map_walker_try_leaf() deal with it.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 15 +++
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 238f29389617..f814422ef795 1
: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index b9f0d792b8d9..238f29389617 100644
--- a/arch/arm64/kvm/hyp/pgtable.c
+++ b/arch/arm64/kvm/hyp
y shared with another software walker. Elide the DSB + TLBI if
the evicted PTE was invalid (and thus not subject to break-before-make).
All of the atomics do nothing for now, as the stage-2 walker isn't fully
ready to perform parallel walks.
Signed-off-by: Oliver Upton
---
walking in parallel.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 31 ++-
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index d8d963521d4e..a34e2050f931 100644
--- a/arch/arm
n RCU.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 49
arch/arm64/kvm/hyp/pgtable.c | 10 +-
arch/arm64/kvm/mmu.c | 14 +++-
3 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/includ
Create a helper to initialize a table and directly call
smp_store_release() to install it (for now). Prepare for a subsequent
change that generalizes PTE writes with a helper.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 20 ++--
1 file changed, 10 insertions
conditionally annotated with RCU for the stage-2 MMU.
Call the type a 'pteref' to avoid a naming collision with raw pteps. No
functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 9 -
arch/arm64/kvm/hyp/pgtable.c
unlinked stage-2 is indirected
as a subsequent change will use an RCU callback to trigger tear down.
RCU is not available to pKVM, so there is a need to use different
implementations on pKVM and non-pKVM VMs.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 3 +
arch
As a prerequisite for getting visitors off of struct kvm_pgtable, pass
mm_ops through the visitor context.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 1 +
arch/arm64/kvm/hyp/nvhe/setup.c | 3 +-
arch/arm64/kvm/hyp/pgtable.c
__kvm_pgtable_walk() as the subtree is no longer reachable from the
root.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 11 +++
arch/arm64/kvm/hyp/pgtable.c | 23 +++
2 files changed, 34 insertions(+)
diff --git a/arch/arm64/include/asm
In order to tear down page tables from outside the context of
kvm_pgtable (such as an RCU callback), stop passing a pointer through
kvm_pgtable_walk_data.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 18 +-
1 file changed, 5
visitor to contain
the bit indicating the phase of the walk. Pass the entire set of flags
through the context structure such that the walker can communicate
additional state to the visitor callback.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtabl
Rather than reading the ptep all over the shop, read the ptep once from
__kvm_pgtable_visit() and stick it in the visitor context. Reread the
ptep after visiting a leaf in case the callback installed a new table
underneath.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch
p...@linux.dev/
v4:
https://lore.kernel.org/kvmarm/20221103091140.1040433-1-oliver.up...@linux.dev/
Oliver Upton (14):
KVM: arm64: Combine visitor arguments into a context structure
KVM: arm64: Stash observed pte value in visitor context
KVM: arm64: Pass mm_ops through the visitor context
KVM: arm
On Sat, Nov 05, 2022 at 05:57:33AM +0800, Gavin Shan wrote:
> On 11/5/22 4:12 AM, Oliver Upton wrote:
> > I agree that we should address (1) like this, but in (2) requiring that
> > no memslots were created before enabling the existing capabilities would
> > be a change in AB
On Fri, Oct 28, 2022 at 11:53:49AM +0100, Marc Zyngier wrote:
> Align the ID_DFR0_EL1.PerfMon values with ID_AA64DFR0_EL1.PMUver.
>
> Signed-off-by: Marc Zyngier
Reviewed-by: Oliver Upton
FYI, another pile of ID reg changes is on the way that'll move DFR0 to a
generated defi
On Fri, Nov 04, 2022 at 02:57:15PM +0800, Gavin Shan wrote:
> On 11/4/22 9:06 AM, Oliver Upton wrote:
[...]
> > Just to make sure we're on the same page, there's two issues:
> >
> > (1) If DIRTY_LOG_RING is enabled before memslot creation and
> >
On Fri, Nov 04, 2022 at 08:12:21AM +0800, Gavin Shan wrote:
> Hi Oliver,
>
> On 11/4/22 7:32 AM, Oliver Upton wrote:
> > On Mon, Oct 31, 2022 at 08:36:16AM +0800, Gavin Shan wrote:
> > > ARM64 needs to dirty memory outside of a VCPU context when VGIC/ITS is
> > &g
On Mon, Oct 31, 2022 at 08:36:16AM +0800, Gavin Shan wrote:
> ARM64 needs to dirty memory outside of a VCPU context when VGIC/ITS is
> enabled. It's conflicting with that ring-based dirty page tracking always
> requires a running VCPU context.
>
> Introduce a new flavor of dirty ring that requires
On Thu, Nov 03, 2022 at 02:31:00PM -0700, Ricardo Koller wrote:
> On Thu, Nov 03, 2022 at 09:11:33AM +0000, Oliver Upton wrote:
> > The break-before-make sequence is a bit annoying as it opens a window
> > wherein memory is unmapped from the guest. KVM should replace the PTE
&g
().
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 3 ++-
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +-
arch/arm64/kvm/hyp/pgtable.c | 5 +++--
arch/arm64/kvm/mmu.c | 31 ++-
4 files changed, 13 insertions(+), 28 deletions
stead let
stage2_map_walker_try_leaf() deal with it.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 15 +++
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 5ae9ab1ec893..e088d01e6e82 1
: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index ffcb0702034a..5ae9ab1ec893 100644
--- a/arch/arm64/kvm/hyp/pgtable.c
+++ b/arch/arm64/kvm/hyp
y shared with another software walker. Elide the DSB + TLBI if
the evicted PTE was invalid (and thus not subject to break-before-make).
All of the atomics do nothing for now, as the stage-2 walker isn't fully
ready to perform parallel walks.
Signed-off-by: Oliver Upton
---
Create a helper to initialize a table and directly call
smp_store_release() to install it (for now). Prepare for a subsequent
change that generalizes PTE writes with a helper.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 20 ++--
1 file changed, 10 insertions
n RCU.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 49
arch/arm64/kvm/hyp/pgtable.c | 10 +-
arch/arm64/kvm/mmu.c | 14 +++-
3 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/includ
unlinked stage-2 is indirected
as a subsequent change will use an RCU callback to trigger tear down.
RCU is not available to pKVM, so there is a need to use different
implementations on pKVM and non-pKVM VMs.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 3 +
arch
walking in parallel.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 31 ++-
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 156754d87b2a..2950058a2069 100644
--- a/arch/arm
conditionally annotated with RCU for the stage-2 MMU.
Call the type a 'pteref' to avoid a naming collision with raw pteps. No
functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 9 -
arch/arm64/kvm/hyp/pgtable.c
__kvm_pgtable_walk() as the subtree is no longer reachable from the
root.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 11 +++
arch/arm64/kvm/hyp/pgtable.c | 23 +++
2 files changed, 34 insertions(+)
diff --git a/arch/arm64/include/asm
In order to tear down page tables from outside the context of
kvm_pgtable (such as an RCU callback), stop passing a pointer through
kvm_pgtable_walk_data.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 18 +-
1 file changed, 5
As a prerequisite for getting visitors off of struct kvm_pgtable, pass
mm_ops through the visitor context.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 1 +
arch/arm64/kvm/hyp/nvhe/setup.c | 3 +-
arch/arm64/kvm/hyp/pgtable.c
visitor to contain
the bit indicating the phase of the walk. Pass the entire set of flags
through the context structure such that the walker can communicate
additional state to the visitor callback.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtabl
https://lore.kernel.org/kvmarm/20221027221752.1683510-1-oliver.up...@linux.dev/
Oliver Upton (14):
KVM: arm64: Combine visitor arguments into a context structure
KVM: arm64: Stash observed pte value in visitor context
KVM: arm64: Pass mm_ops through the visitor context
KVM: arm64: Don
Rather than reading the ptep all over the shop, read the ptep once from
__kvm_pgtable_visit() and stick it in the visitor context. Reread the
ptep after visiting a leaf in case the callback installed a new table
underneath.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch
On Tue, Nov 01, 2022 at 07:22:49PM -0700, Ricardo Koller wrote:
> On Thu, Oct 27, 2022 at 10:22:47PM +0000, Oliver Upton wrote:
> > In order to service stage-2 faults in parallel, stage-2 table walkers
> > must take exclusive ownership of the PTE being worked on. An additional
>
On Tue, Nov 01, 2022 at 08:28:04PM +, Sean Christopherson wrote:
> On Thu, Oct 27, 2022, Oliver Upton wrote:
> > There is no real urgency to free a stage-2 subtree that was pruned.
> > Nonetheless, KVM does the tear down in the stage-2 fault path while
> > holding the M
bling it. It's rejected to enable the capability if it hasn't been
> advertised.
>
> Fixes: 17601bfed909 ("KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and
> config option")
> Reported-by: Sean Christopherson
> Suggested-by: Sean Christopherson
>
On Mon, Oct 31, 2022 at 08:36:17AM +0800, Gavin Shan wrote:
> KVM_CAP_DIRTY_LOG_RING_WITH_BITMAP should be enabled only when KVM
> device "kvm-arm-vgic-its" is used by userspace. Currently, it's the
> only case where a running VCPU is missed for dirty ring. However,
> there are potentially other de
Quentin,
On Fri, Oct 28, 2022 at 09:57:04AM +, Quentin Perret wrote:
> Hey Oliver,
>
> On Friday 28 Oct 2022 at 08:34:48 (+), Oliver Upton wrote:
> > Perhaps it is just me, but the 'initiator' and 'completer' terms are
> > slightly confusing de
On Thu, Oct 27, 2022 at 10:17:45PM +, Oliver Upton wrote:
> The use of RCU is necessary to safely change the stage-2 page tables in
> parallel. Acquire and release the RCU read lock when traversing the page
> tables.
>
> Use the _raw() flavor of rcu_dereference when changes to
nded.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 68 +--
1 file changed, 34 insertions(+), 34 deletions(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c
b/arch/arm64/kvm/hyp/nvhe/mem_protect.c
index 3636a24e1b34..3ea389a8166f 100644
--- a/arc
erminology (source/target) to describe the
addresses involved in a memory transition
Applies to 6.1-rc2. Politely compile tested, and that's just about it.
Oliver Upton (2):
KVM: arm64: Clean out the odd handling of completer_addr
KVM: arm64: Redefine pKVM memory transitions in terms o
destination address into the
destination context sub-struct. No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 70 ++-
1 file changed, 25 insertions(+), 45 deletions(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c
On Thu, Oct 13, 2022 at 04:09:20PM +0100, Marc Zyngier wrote:
> [Reposting this, as it has been almost two weeks since the initial
> announcement and we're still at sub-10% of the users having
> subscribed to the new list]
>
> Hi all,
>
> As you probably all know, the kvmarm mailing has been h
On Thu, Oct 27, 2022 at 10:17:37PM +, Oliver Upton wrote:
> Presently KVM only takes a read lock for stage 2 faults if it believes
> the fault can be fixed by relaxing permissions on a PTE (write unprotect
> for dirty logging). Otherwise, stage 2 faults grab the write lock, which
>
On Thu, Oct 20, 2022 at 11:32:28AM +0300, Oliver Upton wrote:
> On Wed, Oct 19, 2022 at 11:17:43PM +, Sean Christopherson wrote:
> > On Fri, Oct 07, 2022, Oliver Upton wrote:
[...]
> > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
> &
().
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 3 ++-
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +-
arch/arm64/kvm/hyp/pgtable.c | 5 +++--
arch/arm64/kvm/mmu.c | 31 ++-
4 files changed, 13 insertions(+), 28 deletions
d let
stage2_map_walk_leaf() deal with it.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 15 +++
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 581ba688c6f7..d08e14008bfb 100644
--- a/arch/
: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
index 1df858c21b2e..581ba688c6f7 100644
--- a/arch/arm64/kvm/hyp/pgtable.c
+++ b/arch/arm64/kvm/hyp
y shared with another software walker. Elide the DSB + TLBI if
the evicted PTE was invalid (and thus not subject to break-before-make).
All of the atomics do nothing for now, as the stage-2 walker isn't fully
ready to perform parallel walks.
Signed-off-by: Oliver Upton
---
Create a helper to initialize a table and directly call
smp_store_release() to install it (for now). Prepare for a subsequent
change that generalizes PTE writes with a helper.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 18 +-
1 file changed, 9 insertions
walking in parallel.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 8 +++
arch/arm64/kvm/hyp/pgtable.c | 31
2 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_pgtable.h
b/arch/arm64/i
rcu_barrier() to the flush path.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 2 +-
arch/arm64/kvm/mmu.c | 14 +-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_pgtable.h
b/arch/arm64/include/asm
the
write lock).
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 41
arch/arm64/kvm/hyp/pgtable.c | 10 ++-
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/kvm_pgtable.h
b/arch/arm64/include/asm
conditionally annotated with RCU for the stage-2 MMU.
Call the type a 'pteref' to avoid a naming collision with raw pteps. No
functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 9 -
arch/arm64/kvm/hyp/pgtable.c
unlinked stage-2 is indirected
as a subsequent change will use an RCU callback to trigger tear down.
RCU is not available to pKVM, so there is a need to use different
implementations on pKVM and non-pKVM VMs.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 3 +
arch
__kvm_pgtable_walk() as the subtree is no longer reachable from the
root.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 11 +++
arch/arm64/kvm/hyp/pgtable.c | 23 +++
2 files changed, 34 insertions(+)
diff --git a/arch/arm64/include/asm
In order to tear down page tables from outside the context of
kvm_pgtable (such as an RCU callback), stop passing a pointer through
kvm_pgtable_walk_data.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/kvm/hyp/pgtable.c | 18 +-
1 file changed, 5
As a prerequisite for getting visitors off of struct kvm_pgtable, pass
mm_ops through the visitor context.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 1 +
arch/arm64/kvm/hyp/nvhe/setup.c | 3 +-
arch/arm64/kvm/hyp/pgtable.c
visitor to contain
the bit indicating the phase of the walk. Pass the entire set of flags
through the context structure such that the walker can communicate
additional state to the visitor callback.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtabl
Rather than reading the ptep all over the shop, read the ptep once from
__kvm_pgtable_visit() and stick it in the visitor context. Reread the
ptep after visiting a leaf in case the callback installed a new table
underneath.
No functional change intended.
Signed-off-by: Oliver Upton
---
arch
l.org/kvmarm/20220830194132.962932-1-oliver.up...@linux.dev/
v2:
https://lore.kernel.org/kvmarm/20221007232818.459650-1-oliver.up...@linux.dev/
Oliver Upton (15):
KVM: arm64: Combine visitor arguments into a context structure
KVM: arm64: Stash observed pte value in visitor context
KVM: ar
On Mon, Oct 24, 2022 at 11:50:29PM +, Sean Christopherson wrote:
> On Sat, Oct 22, 2022, Marc Zyngier wrote:
> > On Fri, 21 Oct 2022 17:05:26 +0100, Sean Christopherson
> > wrote:
[...]
> > > Would it be possible to require a dirty bitmap when an ITS is
> > > created? That would allow trea
y are not so useful and are a bit pain to maintain.
>
> Signed-off-by: Reiji Watanabe
Much cleaner!
Reviewed-by: Oliver Upton
--
Thanks,
Oliver
___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
> so that guest_code() can use the function to reset those registers
> even when non-zero {break,watch}points are specified for guest_code().
> Subsequent patches will add test cases for non-zero {break,watch}points.
>
> Signed-off-by: Reiji Watanabe
> Reviewed-by: Ricardo Koller
_FEATURE_MASK(ID_AA64MMFR0_TGRAN4), val) != 0xf;
> + *ps64k = FIELD_GET(ARM64_FEATURE_MASK(ID_AA64MMFR0_TGRAN64), val) == 0;
> + *ps16k = FIELD_GET(ARM64_FEATURE_MASK(ID_AA64MMFR0_TGRAN16), val) != 0;
Not your code, but since we're here...
Should we change the field values to us
On Wed, Oct 19, 2022 at 06:20:32AM +0800, Gavin Shan wrote:
> Hi Peter,
>
> On 10/19/22 12:07 AM, Peter Xu wrote:
> > On Tue, Oct 11, 2022 at 02:14:42PM +0800, Gavin Shan wrote:
[...]
> > IMHO it'll be great to start with something like below to describe the
> > userspace's responsibility to pro
On Wed, Oct 19, 2022 at 11:32:36PM +, Sean Christopherson wrote:
> On Fri, Oct 07, 2022, Oliver Upton wrote:
> > @@ -1534,7 +1517,7 @@ bool kvm_set_spte_gfn(struct kvm *kvm, struct
> > kvm_gfn_range *range)
> > */
> > kvm_pgtable_stage2_map(kvm-
On Wed, Oct 19, 2022 at 11:29:56PM +, Sean Christopherson wrote:
> On Fri, Oct 07, 2022, Oliver Upton wrote:
> > The use of RCU is necessary to safely change the stage-2 page tables in
> > parallel. Acquire and release the RCU read lock when traversing the page
> > tab
On Wed, Oct 19, 2022 at 11:17:43PM +, Sean Christopherson wrote:
> On Fri, Oct 07, 2022, Oliver Upton wrote:
> > Use an opaque type for pteps and require visitors explicitly dereference
> > the pointer before using. Protecting page table memory with RCU requires
> > that
On Mon, Oct 17, 2022 at 10:08:48PM +, Sean Christopherson wrote:
> On Mon, Oct 17, 2022, Maciej S. Szmigiero wrote:
> > > +#define MEM_EXTRA_SIZE 0x1
> >
> > Also, an expression like "(64 << 10)" is more readable than a "1"
> > with a tail of zeroes (it's easy to add one zero too
On Tue, Oct 18, 2022 at 10:38:10AM +0300, Oliver Upton wrote:
> On Fri, Oct 14, 2022 at 12:55:35PM -0400, Peter Xu wrote:
> > On Tue, Oct 11, 2022 at 01:12:43AM +0000, Oliver Upton wrote:
> > > The VMM must know something about the architecture it is running on,
On Fri, Oct 14, 2022 at 12:55:35PM -0400, Peter Xu wrote:
> On Tue, Oct 11, 2022 at 01:12:43AM +0000, Oliver Upton wrote:
> > The VMM must know something about the architecture it is running on, as
> > it calls KVM_DEV_ARM_ITS_SAVE_TABLES after all...
>
> IIUC this is still
On Tue, Oct 11, 2022 at 05:54:00PM +0100, Marc Zyngier wrote:
> The kernel has an awfully complicated boot sequence in order to cope
> with the various EL2 configurations, including those that "enhanced"
> the architecture. We go from EL2 to EL1, then back to EL2, staying
> at EL2 if VHE capable an
On Mon, Oct 10, 2022 at 08:20:29PM -0400, Peter Xu wrote:
> On Mon, Oct 10, 2022 at 11:58:22PM +0000, Oliver Upton wrote:
> > I think this further drives the point home -- there's zero need for the
> > bitmap with dirty ring on x86, so why even support it? The proposal
On Mon, Oct 10, 2022 at 07:49:15PM -0400, Peter Xu wrote:
> On Mon, Oct 10, 2022 at 11:18:55PM +0000, Oliver Upton wrote:
> > On Fri, Oct 07, 2022 at 10:31:49AM -0400, Peter Xu wrote:
> >
> > [...]
> >
> > > > - In kvm_vm_ioctl_enable_dirty_log_ring(), se
On Mon, Oct 10, 2022 at 11:18:55PM +, Oliver Upton wrote:
> On Fri, Oct 07, 2022 at 10:31:49AM -0400, Peter Xu wrote:
>
> [...]
>
> > > - In kvm_vm_ioctl_enable_dirty_log_ring(), set 'dirty_ring_allow_bitmap'
> > > to
> > > true when
On Fri, Oct 07, 2022 at 10:31:49AM -0400, Peter Xu wrote:
[...]
> > - In kvm_vm_ioctl_enable_dirty_log_ring(), set 'dirty_ring_allow_bitmap' to
> > true when the capability is KVM_CAP_DIRTY_LONG_RING_ACQ_REL
>
> What I wanted to do is to decouple the ACQ_REL with ALLOW_BITMAP, so mostly
> as w
n my D05 (which
> supports v2 emulation). Fix it.
>
> Fixes: 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to
> separate helper")
> Signed-off-by: Zenghui Yu
Reviewed-by: Oliver Upton
--
Thanks,
Oliver
> ---
> tools/testing/selftests/kvm/aarch6
Hey Ricardo,
On Tue, Sep 13, 2022 at 05:20:11PM -0700, Ricardo Koller wrote:
[...]
> > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
> > index d8127c25424c..5c0c8028d71c 100644
> > --- a/arch/arm64/kvm/hyp/pgtable.c
> > +++ b/arch/arm64/kvm/hyp/pgtable.c
> > @@ -763,17
On Sat, Oct 08, 2022 at 11:01:44AM +0800, kernel test robot wrote:
[...]
> All warnings (new ones prefixed by >>):
>
>arch/arm64/kvm/hyp/nvhe/mem_protect.c: In function '__host_stage2_idmap':
> >> arch/arm64/kvm/hyp/nvhe/mem_protect.c:260:60: warning: implicit conversion
> >> from 'enum ' t
eed to visit a
leaf only once.
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/stage2_pgtable.h | 20
arch/arm64/kvm/mmu.c| 9 -
2 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/arch/arm64/include/asm/stage2_pgtable.h
b/arch
as the batch size (Marc)
Oliver Upton (2):
KVM: arm64: Work out supported block level at compile time
KVM: arm64: Limit stage2_apply_range() batch size to largest block
arch/arm64/include/asm/kvm_pgtable.h| 18 +-
arch/arm64/include/asm/stage2_pgtable.h |
Work out the minimum page table level where KVM supports block mappings
at compile time. While at it, rewrite the comment around supported block
mappings to directly describe what KVM supports instead of phrasing in
terms of what it does not.
Signed-off-by: Oliver Upton
---
arch/arm64/include
().
Signed-off-by: Oliver Upton
---
arch/arm64/include/asm/kvm_pgtable.h | 3 ++-
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +-
arch/arm64/kvm/hyp/pgtable.c | 5 +++--
arch/arm64/kvm/mmu.c | 31 ++-
4 files changed, 13 insertions(+), 28 deletions
101 - 200 of 623 matches
Mail list logo