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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48A01C76195 for ; Mon, 27 Mar 2023 11:39:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232207AbjC0Lj0 (ORCPT ); Mon, 27 Mar 2023 07:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbjC0LjZ (ORCPT ); Mon, 27 Mar 2023 07:39:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 129F31734 for ; Mon, 27 Mar 2023 04:39:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC72DB810E5 for ; Mon, 27 Mar 2023 11:39:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76031C433D2; Mon, 27 Mar 2023 11:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679917161; bh=Y25JYviuLZUTBazV/m2HTVKKfG+DedRc/wjMYotaZSU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Gf4CaejRU53Zdll4MzHtk+Mayfwxlzbwd9aypwYCL0iFa6tdi7nnUtqc4FXmQZfto o8QvTQxvclWJaop1kB6UFnU4Wqw4DcOt6Snvpy+LdSTT2BoqIH30DNo3DWGvVfB3NF gEQjsqf+L3owpPJr5KYw3unwHgCocUwpCbjkNoVOKSHKhA1KgZhj9iFzOrN0cwvZBB wkrlSwkzbjTUE1ZcPZ1z1w9CYbI4x42bVGn+8jqZTVCA2RdHsvpuvr9MVSduSg2Zeq K1+LMyq7odj0Kfh+lvbXPNn6XAuBw195VAfzzD1DztwGfy9jw1KP7HP1+NLXftqQHW UGZMvZsVKu6HQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pglC3-003Qq0-4D; Mon, 27 Mar 2023 12:39:19 +0100 Date: Mon, 27 Mar 2023 12:39:18 +0100 Message-ID: <86v8imwhi1.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton , Will Deacon , Catalin Marinas Cc: Paolo Bonzini , reijiw@google.com, dmatlack@google.com, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, kvmarm@lists.linux.dev, kvm@vger.kernel.org Subject: Re: [GIT PULL] KVM/arm64 fixes for 6.3, part #2 In-Reply-To: References: 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/28.2 (aarch64-unknown-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: oliver.upton@linux.dev, will@kernel.org, catalin.marinas@arm.com, pbonzini@redhat.com, reijiw@google.com, dmatlack@google.com, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, kvmarm@lists.linux.dev, kvm@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: kvm@vger.kernel.org On Fri, 24 Mar 2023 18:16:30 +0000, Oliver Upton wrote: > > Paolo, > > Pinging this PR in case you missed it, the issues around host page table walks > are particularly urgent as the race on host page table teardown has been > reproduced on some setups. If we don't hear from Paolo shortly, I suggest we route this via the arm64 tree. Thanks, M. > > -- > Thanks, > Oliver > > On Thu, Mar 16, 2023 at 08:09:20PM -0700, Oliver Upton wrote: > > Hi Paolo, > > > > Another week, another set of fixes for KVM/arm64. > > > > Description can be found in the tag, but the teardown race when walking > > host page tables is particularly nasty and currently causing problems > > for folks. The fix is quite simple by disabling interrupts when walking > > host page tables, as the thread must be IPI'ed before the table memory > > can actually be freed. > > > > Please pull, > > > > Oliver > > > > The following changes since commit 47053904e18282af4525a02e3e0f519f014fc7f9: > > > > KVM: arm64: timers: Convert per-vcpu virtual offset to a global value (2023-03-11 02:00:40 -0800) > > > > are available in the Git repository at: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvmarm-fixes-6.3-2 > > > > for you to fetch changes up to 8c2e8ac8ad4be68409e806ce1cc78fc7a04539f3: > > > > KVM: arm64: Check for kvm_vma_mte_allowed in the critical section (2023-03-16 23:42:56 +0000) > > > > ---------------------------------------------------------------- > > KVM/arm64 fixes for 6.3, part #2 > > > > Fixes for a rather interesting set of bugs relating to the MMU: > > > > - Read the MMU notifier seq before dropping the mmap lock to guard > > against reading a potentially stale VMA > > > > - Disable interrupts when walking user page tables to protect against > > the page table being freed > > > > - Read the MTE permissions for the VMA within the mmap lock critical > > section, avoiding the use of a potentally stale VMA pointer > > > > Additionally, some fixes targeting the vPMU: > > > > - Return the sum of the current perf event value and PMC snapshot for > > reads from userspace > > > > - Don't save the value of guest writes to PMCR_EL0.{C,P}, which could > > otherwise lead to userspace erroneously resetting the vPMU during VM > > save/restore > > > > ---------------------------------------------------------------- > > David Matlack (1): > > KVM: arm64: Retry fault if vma_lookup() results become invalid > > > > Marc Zyngier (2): > > KVM: arm64: Disable interrupts while walking userspace PTs > > KVM: arm64: Check for kvm_vma_mte_allowed in the critical section > > > > Reiji Watanabe (2): > > KVM: arm64: PMU: Fix GET_ONE_REG for vPMC regs to return the current value > > KVM: arm64: PMU: Don't save PMCR_EL0.{C,P} for the vCPU > > > > arch/arm64/kvm/mmu.c | 99 ++++++++++++++++++++++++++++++----------------- > > arch/arm64/kvm/pmu-emul.c | 3 +- > > arch/arm64/kvm/sys_regs.c | 21 +++++++++- > > 3 files changed, 85 insertions(+), 38 deletions(-) > > > > -- > Thanks, > Oliver > -- Without deviation from the norm, progress is not possible.