Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2269836rwd; Fri, 9 Jun 2023 08:53:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45KdmzZTF2ffBah7IHGzO6ELbqAnp3BtKnyM+jniOPy0dk2muFNW+eu9dnaIqXsomEKsI6 X-Received: by 2002:a17:90a:bf0f:b0:259:3d01:c151 with SMTP id c15-20020a17090abf0f00b002593d01c151mr1251054pjs.21.1686326028143; Fri, 09 Jun 2023 08:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686326028; cv=none; d=google.com; s=arc-20160816; b=YOsYCCtN0h+4FhOtHzX44rJxztYQSY0d/fMubzJNMHsxrf7nSistHydIYyQcQKIi56 NuRPXkz59vUgZzD2rmDuh64WDe5/HHEBMuLccYO6KQyS4dFqPyZwLTchJ3Q9SfU7y9Lg iI4Dmvi0dPizwvl993fLyPqRkX8mmxhWcJRkm8NgqroqZ7RXLUHBATY9yTmwlfWTUnY6 8jV7yNewTMpw92RN9w+c+cYW6PIZ5+DpOoYI6yT9C/3A6+LE0XiU7ejerZQ4bLrkHMPT tlWq+mWPGatkGk4EwDuux9ZuxiSS/FN6rAPPR2plI3g60LATa1XqZ7bxPHOh1yye+U64 RseA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=vPnlIRVGxj8AeQiaq3bAFwvGduBuAp2E7TLGSfDQuEY=; b=GBH4L1UwAKrvxGECdzjoIj+xyPB4eys8FVX6Q/LRQHGBc30xSnTwlOv6Lk9J9rEnfw EkWjN/g5AWsJqirZZ8hw4vuz22NEOOJPGop7Yzwm5gUXNO8n6TxnYqkMBQZvR27SBBh/ HCRP0jNm23PvBG1w+j/xSPBKkAaUCZA7DsBuBSZPtetnvT4PF71MzTDxT055gyp/7drz YOfRQ7Tbl7SSD8Lm2NnJQM79ZZP6lp1kttW75iehcMk5UIOoRqKciqzZwVUhnz/p2cv2 HNmwNBXxvnlhLPTB6pYJ6HoJUCCeoofi0TZba8j+PysBHwaCClUhob55JtugfTCvMKvm X7Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kCvdF6x5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lk3-20020a17090b33c300b0025690b76c95si3016185pjb.10.2023.06.09.08.53.33; Fri, 09 Jun 2023 08:53:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kCvdF6x5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241747AbjFIPp1 (ORCPT + 99 others); Fri, 9 Jun 2023 11:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239209AbjFIPo5 (ORCPT ); Fri, 9 Jun 2023 11:44:57 -0400 Received: from out-51.mta1.migadu.com (out-51.mta1.migadu.com [95.215.58.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 018AD358B for ; Fri, 9 Jun 2023 08:44:55 -0700 (PDT) Date: Fri, 9 Jun 2023 08:44:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1686325494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vPnlIRVGxj8AeQiaq3bAFwvGduBuAp2E7TLGSfDQuEY=; b=kCvdF6x5Ui7p2uYuAw8e0+ZOCZ9jdiuTfejEV/+f9FynBFrrivqpYS+WgpldF4ADxknz7n EnUpapJPqGOr4cWrWST9aM/SroIqLJ7rNerE/Kv1NsLUi4P0U9F92hSfAzcjdykt0K8vtP MSOED852Q/+yMxfDpf0O/bS5SQ8UZ34= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Colton Lewis Cc: kvm@vger.kernel.org, Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH 2/3] KVM: arm64: Clear possible conflict aborts Message-ID: References: <20230602170147.1541355-1-coltonlewis@google.com> <20230602170147.1541355-3-coltonlewis@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230602170147.1541355-3-coltonlewis@google.com> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 02, 2023 at 05:01:46PM +0000, Colton Lewis wrote: > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index 7a68398517c95..96b950f20c8d0 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -1591,6 +1591,12 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu) > return 1; > } > > + if (fault_status == ESR_ELx_FSC_CONFLICT) { > + /* We could be at any level. 0 covers all levels. */ > + __kvm_tlb_flush_vmid_ipa(vcpu->arch.hw_mmu, fault_ipa, 0); > + return 1; > + } > + This does not match the architecture. Please read DDI0487J D8.14.3 "TLB maintenance due to TLB conflict", which tells you exactly how to resolve the conflict. TL; DR: TLBI by address is _not_ guaranteed to invalidate duplicate TLB entries. vmalls12e1 is your friend. The conflicting TLB entries are local to the CPU that took the abort, so you don't need to do any broadcast. -- Thanks, Oliver