From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7DAFC433EF for ; Wed, 17 Nov 2021 18:13:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A1A4861AFF for ; Wed, 17 Nov 2021 18:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239887AbhKQSQi (ORCPT ); Wed, 17 Nov 2021 13:16:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:53218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238747AbhKQSQi (ORCPT ); Wed, 17 Nov 2021 13:16:38 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D1DA261BC1; Wed, 17 Nov 2021 18:13:39 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mnPRB-0069CQ-WB; Wed, 17 Nov 2021 18:13:38 +0000 Date: Wed, 17 Nov 2021 18:13:37 +0000 Message-ID: <87pmqy7ir2.wl-maz@kernel.org> From: Marc Zyngier To: David Woodhouse Cc: Paolo Bonzini , kvm , Boris Ostrovsky , Joao Martins , "jmattson @ google . com" , "wanpengli @ tencent . com" , "seanjc @ google . com" , "vkuznets @ redhat . com" , "mtosatti @ redhat . com" , "joro @ 8bytes . org" , karahmed@amazon.com, James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , Will Deacon , Huacai Chen , Aleksandar Markovic , Michael Ellerman , Benjamin Herrenschmidt , Anup Patel , Christian Borntraeger , kvmarm@lists.cs.columbia.edu, linux-arm-kernel , linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: Re: [PATCH v3 08/12] KVM: Propagate vcpu explicitly to mark_page_dirty_in_slot() In-Reply-To: <20211117174003.297096-9-dwmw2@infradead.org> References: <20211117174003.297096-1-dwmw2@infradead.org> <20211117174003.297096-9-dwmw2@infradead.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: dwmw2@infradead.org, pbonzini@redhat.com, kvm@vger.kernel.org, boris.ostrovsky@oracle.com, joao.m.martins@oracle.com, jmattson@google.com, wanpengli@tencent.com, seanjc@google.com, vkuznets@redhat.com, mtosatti@redhat.com, joro@8bytes.org, karahmed@amazon.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, chenhuacai@kernel.org, aleksandar.qemu.devel@gmail.com, mpe@ellerman.id.au, benh@kernel.crashing.org, anup.patel@wdc.com, borntraeger@de.ibm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Wed, 17 Nov 2021 17:39:59 +0000, David Woodhouse wrote: > > From: David Woodhouse > > The kvm_dirty_ring_get() function uses kvm_get_running_vcpu() to work out > which dirty ring to use, but there are some use cases where that doesn't > work. > > There's one in setting the Xen shared info page, introduced in commit > 629b5348841a ("KVM: x86/xen: update wallclock region") and reported by > "butt3rflyh4ck" in > https://lore.kernel.org/kvm/CAFcO6XOmoS7EacN_n6v4Txk7xL7iqRa2gABg3F7E3Naf5uG94g@mail.gmail.com/ > > There's also about to be another one when the newly-reintroduced > gfn_to_pfn_cache needs to mark a page as dirty from the MMU notifier > which invalidates the mapping. In that case, we will *know* the vcpu > that can be 'blamed' for dirtying the page, and we just need to be > able to pass it in as an explicit argument when doing so. > > This patch preemptively resolves the second issue, and paves the way > for resolving the first. A complete fix for the first issue will need > us to switch the Xen shinfo to be owned by a particular vCPU, which > will happen in a separate patch. > > Signed-off-by: David Woodhouse > --- > arch/arm64/kvm/mmu.c | 2 +- > arch/x86/kvm/mmu/mmu.c | 2 +- > arch/x86/kvm/mmu/spte.c | 2 +- > arch/x86/kvm/mmu/tdp_mmu.c | 2 +- > arch/x86/kvm/x86.c | 4 ++-- > include/linux/kvm_dirty_ring.h | 6 ++++-- > include/linux/kvm_host.h | 3 ++- > virt/kvm/dirty_ring.c | 8 ++++++-- > virt/kvm/kvm_main.c | 18 +++++++++--------- > 9 files changed, 27 insertions(+), 20 deletions(-) What's the base for this series? This patch fails to compile for me (at least on arm64), and the following patch doesn't apply on -rc1. Thanks, M. -- Without deviation from the norm, progress is not possible.