From nobody Fri Dec 19 20:13:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1673604723; cv=none; d=zohomail.com; s=zohoarc; b=dW4b93keIUhkUiJKPrDPXrcQfO56TACvf1nVP2+nvo1fXPh0R3RBG0hqVYlZJifxUC6NuWF6xSl5921nTsXkzN5JzH50RcdukL8Rn3B0Fdb5Bng1y/H36iIrv/ERReqOaOHJgoe+uu3R+w62+jsce85qGuewDc3H9u8HXmTRVoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673604723; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AlqTneJ4LSbMwjz1i6xFwfom8gh69DQnrqOXDMM4PVs=; b=UjVEQubYk2ZzR0zX7qhY/y7hAFPs332TIiI3SoCAwfXb5XYEzGDWUZ3fZaJ0kKdvY09xAvsDa9+Sq0Kvxml/SbvxAQS/hEzxUQamePkgY9okwypQQebGE7EmxIp3P2cH3w4ZgzeQiMHayiMneMN47F1Jo3BenIBBIeFRCA8TJ/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1673604723302475.9629954870121; Fri, 13 Jan 2023 02:12:03 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.477050.739601 (Exim 4.92) (envelope-from ) id 1pGH2H-0004eY-Ll; Fri, 13 Jan 2023 10:11:45 +0000 Received: by outflank-mailman (output) from mailman id 477050.739601; Fri, 13 Jan 2023 10:11:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pGH2H-0004dF-E5; Fri, 13 Jan 2023 10:11:45 +0000 Received: by outflank-mailman (input) for mailman id 477050; Fri, 13 Jan 2023 10:11:44 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pGH2G-0004RI-OW for xen-devel@lists.xenproject.org; Fri, 13 Jan 2023 10:11:44 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pGH2G-0006dU-Lr; Fri, 13 Jan 2023 10:11:44 +0000 Received: from 54-240-197-224.amazon.com ([54.240.197.224] helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pGH2G-0005Ty-Dp; Fri, 13 Jan 2023 10:11:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=AlqTneJ4LSbMwjz1i6xFwfom8gh69DQnrqOXDMM4PVs=; b=0hhPFhOI2/yxluEn6Ulv0PJ20B bgPfex6S69Ngb71ds7CfOllSilwOFxXnG3J9b3nzTPOvxApEMOcQ1sHDxwVpmIdhm5rN1bwdOoPNW 0TDJMTs17niug8uO9ojs6Ey8OdwyNwxHcCSt6cjoc9sG5skH3AdCaHWlvjsn+9j5SSKM=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: Luca.Fancellu@arm.com, Julien Grall , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Michal Orzel Subject: [PATCH v4 04/14] xen/arm: flushtlb: Reduce scope of barrier for the TLB range flush Date: Fri, 13 Jan 2023 10:11:26 +0000 Message-Id: <20230113101136.479-5-julien@xen.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230113101136.479-1-julien@xen.org> References: <20230113101136.479-1-julien@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1673604723848100005 Content-Type: text/plain; charset="utf-8" From: Julien Grall At the moment, flush_xen_tlb_range_va{,_local}() are using system wide memory barrier. This is quite expensive and unnecessary. For the local version, a non-shareable barrier is sufficient. For the SMP version, an inner-shareable barrier is sufficient. Furthermore, the initial barrier only needs to a store barrier. For the full explanation of the sequence see asm/arm{32,64}/flushtlb.h. Signed-off-by: Julien Grall Reviewed-by: Michal Orzel Reviewed-by: Henry Wang ---- Changes in v4: - Add Michal's reviewed-by tag Changes in v3: - Patch added --- xen/arch/arm/include/asm/flushtlb.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/include/asm/flushtlb.h b/xen/arch/arm/include/asm= /flushtlb.h index 125a141975e0..e45fb6d97b02 100644 --- a/xen/arch/arm/include/asm/flushtlb.h +++ b/xen/arch/arm/include/asm/flushtlb.h @@ -37,13 +37,14 @@ static inline void flush_xen_tlb_range_va_local(vaddr_t= va, { vaddr_t end =3D va + size; =20 - dsb(sy); /* Ensure preceding are visible */ + /* See asm/arm{32,64}/flushtlb.h for the explanation of the sequence. = */ + dsb(nshst); /* Ensure prior page-tables updates have completed */ while ( va < end ) { __flush_xen_tlb_one_local(va); va +=3D PAGE_SIZE; } - dsb(sy); /* Ensure completion of the TLB flush */ + dsb(nsh); /* Ensure the TLB invalidation has completed */ isb(); } =20 @@ -56,13 +57,14 @@ static inline void flush_xen_tlb_range_va(vaddr_t va, { vaddr_t end =3D va + size; =20 - dsb(sy); /* Ensure preceding are visible */ + /* See asm/arm{32,64}/flushtlb.h for the explanation of the sequence. = */ + dsb(ishst); /* Ensure prior page-tables updates have completed */ while ( va < end ) { __flush_xen_tlb_one(va); va +=3D PAGE_SIZE; } - dsb(sy); /* Ensure completion of the TLB flush */ + dsb(ish); /* Ensure the TLB invalidation has completed */ isb(); } =20 --=20 2.38.1