Re: [PATCH] KVM: arm64, x86: make kvm_arch_has_irq_bypass() inline

2025-04-18 Thread Oliver Upton
kvm-intel.ko and kvm-amd.ko, since the function is not currently exported. > > Suggested-by: Linus Torvalds > Signed-off-by: Paolo Bonzini LOL, surprised this wasn't the case already. Acked-by: Oliver Upton > --- > arch/arm64/include/asm/kvm_host.h | 5 + >

Re: [PATCH v6 4/5] x86: perf: Refactor misc flag assignments

2024-11-06 Thread Oliver Upton
On Wed, Nov 06, 2024 at 03:33:30PM -0500, Liang, Kan wrote: > On 2024-11-06 3:02 p.m., Oliver Upton wrote: > > On Wed, Nov 06, 2024 at 11:03:10AM -0500, Liang, Kan wrote: > >>> +static unsigned long common_misc_flags(struct pt_regs *regs) > >>> +{ > >&

Re: [PATCH v6 4/5] x86: perf: Refactor misc flag assignments

2024-11-06 Thread Oliver Upton
On Wed, Nov 06, 2024 at 11:03:10AM -0500, Liang, Kan wrote: > > +static unsigned long common_misc_flags(struct pt_regs *regs) > > +{ > > + if (regs->flags & PERF_EFLAGS_EXACT) > > + return PERF_RECORD_MISC_EXACT_IP; > > + > > + return 0; > > +} > > + > > +unsigned long perf_arch_guest

Re: [PATCH v6 5/5] perf: Correct perf sampling with guest VMs

2024-11-06 Thread Oliver Upton
On Wed, Nov 06, 2024 at 11:07:53AM -0500, Liang, Kan wrote: > > +#ifndef perf_arch_guest_misc_flags > > +static inline unsigned long perf_arch_guest_misc_flags(struct pt_regs > > *regs) > > +{ > > + unsigned long guest_state = perf_guest_state(); > > + > > + if (guest_state & PERF_GUEST_USER)

Re: [PATCH v3 0/5] Correct perf sampling with Guest VMs

2024-09-19 Thread Oliver Upton
With that corrected, for the series: Reviewed-by: Oliver Upton A nice follow-up on the arm64 side would be to further constrain kvm_arch_pmi_in_guest() to return true iff we exited the guest due to an IRQ. -- Thanks, Oliver

Re: [PATCH v12 54/84] KVM: arm64: Mark "struct page" pfns accessed/dirty before dropping mmu_lock

2024-08-05 Thread Oliver Upton
On Mon, Aug 05, 2024 at 04:53:01PM -0700, Sean Christopherson wrote: > On Mon, Aug 05, 2024, Oliver Upton wrote: > > > > --- > > > > arch/arm64/kvm/mmu.c | 10 ++ > > > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > > &g

Re: [PATCH v12 54/84] KVM: arm64: Mark "struct page" pfns accessed/dirty before dropping mmu_lock

2024-08-05 Thread Oliver Upton
On Mon, Aug 05, 2024 at 11:26:03PM +, Oliver Upton wrote: > [+cc Fuad] Take 2! > Fuad, you mentioned in commit 9c30fc615daa ("KVM: arm64: Move setting > the page as dirty out of the critical section") that restructuring > around the MMU lock was helpful for reuse (presu

Re: [PATCH v12 54/84] KVM: arm64: Mark "struct page" pfns accessed/dirty before dropping mmu_lock

2024-08-05 Thread Oliver Upton
[+cc Fuad] Fuad, you mentioned in commit 9c30fc615daa ("KVM: arm64: Move setting the page as dirty out of the critical section") that restructuring around the MMU lock was helpful for reuse (presumably for pKVM), but I lack the context there. On Fri, Jul 26, 2024 at 04:52:03PM -0700, Sean Christo

Re: [PATCH v4 6/7] KVM: arm64: Relax locking for kvm_test_age_gfn and kvm_age_gfn

2024-06-04 Thread Oliver Upton
On Tue, Jun 04, 2024 at 03:20:20PM -0700, James Houghton wrote: > On Fri, May 31, 2024 at 12:18 PM Oliver Upton wrote: > > > > On Fri, May 31, 2024 at 12:11:33PM -0700, Oliver Upton wrote: > > > On Wed, May 29, 2024 at 06:05:09PM +, James Houghton wrote: > > &g

Re: [PATCH v4 2/7] mm: multi-gen LRU: Have secondary MMUs participate in aging

2024-05-31 Thread Oliver Upton
On Fri, May 31, 2024 at 02:31:17PM -0600, Yu Zhao wrote: > On Fri, May 31, 2024 at 1:24 AM Oliver Upton wrote: [...] > > Grabbing the MMU lock for write to scan sucks, no argument there. But > > can you please be specific about the impact of read lock v. RCU in the > >

Re: [PATCH v4 6/7] KVM: arm64: Relax locking for kvm_test_age_gfn and kvm_age_gfn

2024-05-31 Thread Oliver Upton
On Fri, May 31, 2024 at 12:11:33PM -0700, Oliver Upton wrote: > On Wed, May 29, 2024 at 06:05:09PM +, James Houghton wrote: > > [...] > > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > > index 9e2bbee77491..eabb07c66a07 100644 >

Re: [PATCH v4 6/7] KVM: arm64: Relax locking for kvm_test_age_gfn and kvm_age_gfn

2024-05-31 Thread Oliver Upton
On Wed, May 29, 2024 at 06:05:09PM +, James Houghton wrote: [...] > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > index 9e2bbee77491..eabb07c66a07 100644 > --- a/arch/arm64/kvm/hyp/pgtable.c > +++ b/arch/arm64/kvm/hyp/pgtable.c > @@ -1319,10 +1319,8 @@ static int

Re: [PATCH v4 2/7] mm: multi-gen LRU: Have secondary MMUs participate in aging

2024-05-31 Thread Oliver Upton
On Fri, May 31, 2024 at 10:45:04AM -0600, Yu Zhao wrote: > On Fri, May 31, 2024 at 1:03 AM Oliver Upton wrote: > > > > On Fri, May 31, 2024 at 12:05:48AM -0600, Yu Zhao wrote: > > Let me add back what I said earlier: > > I'm not convinced, but it doesn't m

Re: [PATCH v4 2/7] mm: multi-gen LRU: Have secondary MMUs participate in aging

2024-05-31 Thread Oliver Upton
On Wed, May 29, 2024 at 03:03:21PM -0600, Yu Zhao wrote: > On Wed, May 29, 2024 at 12:05 PM James Houghton wrote: > > > > Secondary MMUs are currently consulted for access/age information at > > eviction time, but before then, we don't get accurate age information. > > That is, pages that are most

Re: [PATCH v4 2/7] mm: multi-gen LRU: Have secondary MMUs participate in aging

2024-05-31 Thread Oliver Upton
On Fri, May 31, 2024 at 12:05:48AM -0600, Yu Zhao wrote: [...] > All optimizations in v2 were measured step by step. Even that bitmap, > which might be considered overengineered, brought a readily > measuarable 4% improvement in memcached throughput on Altra Max > swapping to Optane: That's grea

Re: [PATCH v2 1/6] KVM: Add a flag to track if a loaded vCPU is scheduled out

2024-05-22 Thread Oliver Upton
_arch_sched_in(), just being able to remove all of the arch stubs makes > it worth adding the flag. > > Link: https://lore.kernel.org/all/20240430224431.490139-1-sea...@google.com > Cc: Oliver Upton > Signed-off-by: Sean Christopherson Reviewed-by: Oliver Upton -- Thanks, Oliver

Re: [PATCH 0/4] KVM: Fold kvm_arch_sched_in() into kvm_arch_vcpu_load()

2024-05-01 Thread Oliver Upton
On Wed, May 01, 2024 at 07:28:21AM -0700, Sean Christopherson wrote: > On Wed, May 01, 2024, Oliver Upton wrote: > > On Tue, Apr 30, 2024 at 12:31:53PM -0700, Sean Christopherson wrote: > > > Drop kvm_arch_sched_in() and instead pass a @sched_in boolean to > &

Re: [PATCH 0/4] KVM: Fold kvm_arch_sched_in() into kvm_arch_vcpu_load()

2024-04-30 Thread Oliver Upton
On Tue, Apr 30, 2024 at 12:31:53PM -0700, Sean Christopherson wrote: > Drop kvm_arch_sched_in() and instead pass a @sched_in boolean to > kvm_arch_vcpu_load(). > > While fiddling with an idea for optimizing state management on AMD CPUs, > I wanted to skip re-saving certain host state when a vCPU i

Re: [PATCH] KVM: Get rid of return value from kvm_arch_create_vm_debugfs()

2024-02-23 Thread Oliver Upton
On Fri, 16 Feb 2024 15:59:41 +, Oliver Upton wrote: > The general expectation with debugfs is that any initialization failure > is nonfatal. Nevertheless, kvm_arch_create_vm_debugfs() allows > implementations to return an error and kvm_create_vm_debugfs() allows > that to fail

[PATCH] KVM: Get rid of return value from kvm_arch_create_vm_debugfs()

2024-02-16 Thread Oliver Upton
debugfs failures fatal for the VM. Seems like everyone already had the right idea, as all implementations already return 0 unconditionally. Signed-off-by: Oliver Upton --- Compile-tested on arm64, powerpc, and x86 since I don't trust myself to even get this simple patch right. arch/powerp

Re: [PATCH RESEND v2] KVM: move KVM_CAP_DEVICE_CTRL to the generic check

2023-06-14 Thread Oliver Upton
r = vgic_present; > > break; > > case KVM_CAP_IOEVENTFD: > > - case KVM_CAP_DEVICE_CTRL: > > case KVM_CAP_USER_MEMORY: > > case KVM_CAP_SYNC_MMU: > > case KVM_CAP_DESTROY_MEMORY_REGION_WORKS: for arm64: Reviewed-by: Oliver Upton -- Thanks, Oliver

Re: [PATCH mm-unstable v2 04/10] kvm/arm64: make stage2 page tables RCU safe

2023-05-31 Thread Oliver Upton
On Wed, May 31, 2023 at 05:10:52PM -0600, Yu Zhao wrote: > On Wed, May 31, 2023 at 1:28 PM Oliver Upton wrote: > > On Tue, May 30, 2023 at 02:06:55PM -0600, Yu Zhao wrote: > > > On Tue, May 30, 2023 at 1:37 PM Oliver Upton > > > wrote: > > > > As it is c

Re: [PATCH mm-unstable v2 05/10] kvm/arm64: add kvm_arch_test_clear_young()

2023-05-31 Thread Oliver Upton
Hi Yu, On Fri, May 26, 2023 at 05:44:30PM -0600, Yu Zhao wrote: > Implement kvm_arch_test_clear_young() to support the fast path in > mmu_notifier_ops->test_clear_young(). > > It focuses on a simple case, i.e., hardware sets the accessed bit in > KVM PTEs and VMs are not protected, where it can r

Re: [PATCH mm-unstable v2 04/10] kvm/arm64: make stage2 page tables RCU safe

2023-05-31 Thread Oliver Upton
On Tue, May 30, 2023 at 02:06:55PM -0600, Yu Zhao wrote: > On Tue, May 30, 2023 at 1:37 PM Oliver Upton wrote: > > > > Hi Yu, > > > > On Sat, May 27, 2023 at 02:13:07PM -0600, Yu Zhao wrote: > > > On Sat, May 27, 2023 at 12:08 PM Oliver Upton > > > w

Re: [PATCH mm-unstable v2 04/10] kvm/arm64: make stage2 page tables RCU safe

2023-05-30 Thread Oliver Upton
Hi Yu, On Sat, May 27, 2023 at 02:13:07PM -0600, Yu Zhao wrote: > On Sat, May 27, 2023 at 12:08 PM Oliver Upton wrote: > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > > index 3d61bd3e591d..bfbebdcb4ef0 100644 > > --- a/arch/arm64/kvm/hyp/pgt

Re: [PATCH mm-unstable v2 04/10] kvm/arm64: make stage2 page tables RCU safe

2023-05-27 Thread Oliver Upton
automatically > * freed. > + * @put_page_rcu:RCU variant of the above. You don't need to add yet another hook to implement this. I was working on lock-free walks in a separate context and arrived at the following: commit f82d264a37745e07ee28e116

Re: [PATCH v2 0/4] KVM: Refactor KVM stats macros and enable custom stat names

2023-04-26 Thread Oliver Upton
l out-of-tree stats that use arrays. Custom name > support is something we added internally and it reduces our technical > debt to get the support merged upstream. For the series: Reviewed-by: Oliver Upton -- Thanks, Oliver

Re: [PATCH mm-unstable v1 3/5] kvm/arm64: add kvm_arch_test_clear_young()

2023-02-17 Thread Oliver Upton
Hi Yu, scripts/get_maintainers.pl is your friend for getting the right set of emails for a series :) Don't know about others, but generally I would prefer to be Cc'ed on an entire series (to gather context) than just an individual patch. On Thu, Feb 16, 2023 at 09:12:28PM -0700, Yu Zhao wrote: >