Re: disabling halt polling broken? (was Re: [PATCH 00/14] KVM: Halt-polling fixes, cleanups and a new stat)

2022-11-14 Thread wangyanan (Y)
Hi Sean, Paolo, I recently also notice the behavior change of param halt_poll_ns. Now it loses the ability to: 1) dynamically disable halt polling for all the running VMs by `echo 0 > /sys` 2) dynamically adjust the halt polling interval for all the running VMs by `echo * > /sys` While in our ca

Re: [PATCH 1/2] KVM: selftests: Allow >1 guest mode in access_tracking_perf_test

2022-11-14 Thread Oliver Upton
On Mon, Nov 14, 2022 at 05:12:48PM +, Sean Christopherson wrote: > On Fri, Nov 11, 2022, Oliver Upton wrote: > > As the name implies, for_each_guest_mode() will run the test case for > > all supported guest addressing modes. On x86 that doesn't amount to > > anything, but arm64 can handle 4K, 1

Re: [RFC PATCH 01/12] KVM: arm64: Relax WARN check in stage2_make_pte()

2022-11-14 Thread Oliver Upton
Hi Ricardo, On Sat, Nov 12, 2022 at 08:17:03AM +, Ricardo Koller wrote: > stage2_make_pte() throws a warning when used in a non-shared walk, as PTEs > are not "locked" when walking non-shared. Add a check so it can be used > non-shared. > > Signed-off-by: Ricardo Koller I would very much pr

Re: [RFC PATCH 04/12] KVM: arm64: Add kvm_pgtable_stage2_split()

2022-11-14 Thread Oliver Upton
Hi Ricardo, On Sat, Nov 12, 2022 at 08:17:06AM +, Ricardo Koller wrote: [...] > +/** > + * kvm_pgtable_stage2_split() - Split a range of huge pages into leaf PTEs > pointing > + * to PAGE_SIZE guest pages. > + * @pgt: Page-table structure initialised by kvm_pgt

[PATCH 1/1] KVM: arm64: Use a separate function for hyp stage-1 walks

2022-11-14 Thread Oliver Upton
A subsequent change to the page table walkers adds RCU protection for walking stage-2 page tables. KVM uses a global lock to serialize hyp stage-1 walks, meaning RCU protection is quite meaningless for protecting hyp stage-1 walkers. Add a new helper, kvm_pgtable_hyp_walk(), for use when walking h

[PATCH 0/1] KVM: arm64: Skip RCU protection for hyp stage-1

2022-11-14 Thread Oliver Upton
Whelp, that was quick. Marek reports [1] that the parallel faults series leads to a kernel BUG when initializing the hyp stage-1 page tables. Work around the issue by never acquiring the RCU read lock when walking hyp stage-1. This is safe because hyp stage-1 is protected by a spinlock (pKVM) or m

Re: [RFC PATCH 06/12] KVM: arm64: Split block PTEs without using break-before-make

2022-11-14 Thread Oliver Upton
On Sat, Nov 12, 2022 at 08:17:08AM +, Ricardo Koller wrote: > Breaking a huge-page block PTE into an equivalent table of smaller PTEs > does not require using break-before-make (BBM) when FEAT_BBM level 2 is > implemented. Add the respective check for eager page splitting and avoid > using BBM.

Re: [RFC PATCH 02/12] KVM: arm64: Allow visiting block PTEs in post-order

2022-11-14 Thread Oliver Upton
On Sat, Nov 12, 2022 at 08:17:04AM +, Ricardo Koller wrote: > The page table walker does not visit block PTEs in post-order. But there > are some cases where doing so would be beneficial, for example: breaking a > 1G block PTE into a full tree in post-order avoids visiting the new tree. > > Al

Re: [RFC PATCH 00/12] KVM: arm64: Eager huge-page splitting for dirty-logging

2022-11-14 Thread Oliver Upton
Hi Ricardo, On Sat, Nov 12, 2022 at 08:17:02AM +, Ricardo Koller wrote: > Hi, > > I'm sending this RFC mainly to get some early feedback on the approach used > for implementing "Eager Page Splitting" on ARM. "Eager Page Splitting" > improves the performance of dirty-logging (used in live mig

Re: [PATCH v5 08/14] KVM: arm64: Protect stage-2 traversal with RCU

2022-11-14 Thread Oliver Upton
Hi Marek, On Mon, Nov 14, 2022 at 03:29:14PM +0100, Marek Szyprowski wrote: > This patch landed in today's linux-next (20221114) as commit > c3119ae45dfb ("KVM: arm64: Protect stage-2 traversal with RCU"). > Unfortunately it introduces a following warning: Thanks for

Re: [PATCH 1/2] KVM: selftests: Allow >1 guest mode in access_tracking_perf_test

2022-11-14 Thread Sean Christopherson
On Fri, Nov 11, 2022, Oliver Upton wrote: > As the name implies, for_each_guest_mode() will run the test case for > all supported guest addressing modes. On x86 that doesn't amount to > anything, but arm64 can handle 4K, 16K, and 64K page sizes on supporting > hardware. > > Blindly attempting to r

Re: [PATCH v5 08/14] KVM: arm64: Protect stage-2 traversal with RCU

2022-11-14 Thread Marek Szyprowski
t change will > futher relax the locking requirements around the stage-2 MMU, thereby > depending on RCU. > > Signed-off-by: Oliver Upton This patch landed in today's linux-next (20221114) as commit c3119ae45dfb ("KVM: arm64: Protect stage-2 traversal with RCU"). Unfortu

Re: [RFC PATCH 2/3] KVM: arm64: Allow userspace to trap SMCCC sub-ranges

2022-11-14 Thread Marc Zyngier
On Fri, 11 Nov 2022 23:39:09 +, Oliver Upton wrote: > > On Fri, Nov 11, 2022 at 08:26:02AM +, Marc Zyngier wrote: > > On Thu, 10 Nov 2022 21:13:54 +, Oliver Upton > > wrote: > > > The goal of what I was trying to get at is that either the kernel or > > > userspace takes ownership of