From patchwork Thu Apr 9 15:17:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Belits X-Patchwork-Id: 221312 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78914C2BBC7 for ; Thu, 9 Apr 2020 15:18:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E7582074F for ; Thu, 9 Apr 2020 15:18:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="Kc94aWrl"; dkim=pass (1024-bit key) header.d=marvell.onmicrosoft.com header.i=@marvell.onmicrosoft.com header.b="sfGOb5qo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728119AbgDIPSY (ORCPT ); Thu, 9 Apr 2020 11:18:24 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:17022 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727919AbgDIPSY (ORCPT ); Thu, 9 Apr 2020 11:18:24 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 039FGrOm019691; Thu, 9 Apr 2020 08:17:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0818; bh=kZ2+j0FCzkWqNio6rCPrs7enWlq6NYbcuZo1CoUS2GQ=; b=Kc94aWrlfz0KrcCajAThCRyZax+qV77EhqG68kHApX4VYvxR1OH0ggcZ+PG5M7NUxIbX 8urkkm0P4aUVxNSQe9/ZihHSL+8vGXISDj5+sd/mbtbHSPjMFCVXSTd3hJJI518Vtd7x OxAlZPN2zBFvaUnlZq/fcCmPp041n/W7gCN1DzZHQIBqJleVebwDr67XsWH9QaA3n0lA 2fi7z5V5BqvTTQ1IN5OEmqmFGQh0vX+F69amx+5eRVnBDmeB/hR5cHXZlY35GhwFKI00 Mlo5I5pgnpgTVrsYE8Hxrz5Y8lSIIJqtQi0ZnMz7V1A8TDDU1ODyudRKHXTdya+GMbdb cA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3091me8y58-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 09 Apr 2020 08:17:43 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 9 Apr 2020 08:17:41 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 9 Apr 2020 08:17:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gSuTPqzcO3FdRszOiqJFCb4/R46kRs0DMNgNyQpex3GiSEPdKhBcDVmByOO1zUsrXtdklh80sW/9fg/wEZR41a9j6s2zjMo2JNxOmrCsaOrzV6gW1sB2oGJoR53u3Mn6EwlQIz851wGIuHiIb9utVqGqMubNoTy0yK+rEj2D64Ie5qcRM5VB5IAci0pLL+rbhrNWCB4+92pyC+5stXLknJMk6uDO5H8Add7XiWnVJI1HTkDpR6Di0yVn4H0lyNSLJVdA4PDwyvPrzaj5pwm1swV4Q4c3HgYpTFxHtCtILkvnFkyhETjuSJGI1AkgtiiQgui139ackrS5wYgd317CQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kZ2+j0FCzkWqNio6rCPrs7enWlq6NYbcuZo1CoUS2GQ=; b=WvoNSrliSluATuBJ18+QokXB0i9FyBDAaa0Z8uK6hzyif/kUU1iBYoYvKZwObAz0wim/M2aMbXtTgx/pX8l6jOAxUq4LVB/Vo4FuTEmDdE8Uxvfr8gUQsj+/zWUJ2kfQ98YyChrPdLdNaWwxPagySk+cWoQaDefMricmqav2IL9ghTLwgDjZEjnWeXwNAZ9ogQ8CHR6WPkmzCvx+q9T0pMzcZrHEoyjVO85FTgnkGD7h8Y07u2PlIXAby+ojp+T917as1OfInkZ5QJl6BgNDSsJh2DO0sur201fIlQMowyDHZd7bbM2vfGEzi/KIhOq6Tf/U4Rzle3mX0kbueZ5oyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kZ2+j0FCzkWqNio6rCPrs7enWlq6NYbcuZo1CoUS2GQ=; b=sfGOb5qoCEnzYa/fCbPmRauBX/6FCvd5fpADnmDvfey0HttKvHsQSh03dspYFBiOSKj+VD4PG/b4xESCs8p9iMlsq61N/5NScabJPtb+fUw4Z9GSPh2p9+7E5SYOCqUEPr9Gacko9d1QVWbpHV+3PYdVk4Ja64C6/rochgDZ8+Q= Received: from BYAPR18MB2535.namprd18.prod.outlook.com (2603:10b6:a03:137::17) by BYAPR18MB2758.namprd18.prod.outlook.com (2603:10b6:a03:112::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.18; Thu, 9 Apr 2020 15:17:40 +0000 Received: from BYAPR18MB2535.namprd18.prod.outlook.com ([fe80::65f8:9bfe:5fa5:1280]) by BYAPR18MB2535.namprd18.prod.outlook.com ([fe80::65f8:9bfe:5fa5:1280%3]) with mapi id 15.20.2878.022; Thu, 9 Apr 2020 15:17:40 +0000 From: Alex Belits To: "frederic@kernel.org" , "rostedt@goodmis.org" CC: Prasun Kapoor , "mingo@kernel.org" , "davem@davemloft.net" , "linux-api@vger.kernel.org" , "peterz@infradead.org" , "linux-arch@vger.kernel.org" , "catalin.marinas@arm.com" , "tglx@linutronix.de" , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" Subject: [PATCH v3 03/13] task_isolation: add instruction synchronization memory barrier Thread-Topic: [PATCH v3 03/13] task_isolation: add instruction synchronization memory barrier Thread-Index: AQHWDoICUCw40vC9nkuNpTFu2Vf0Xg== Date: Thu, 9 Apr 2020 15:17:40 +0000 Message-ID: References: <4473787e1b6bc3cc226067e8d122092a678b63de.camel@marvell.com> <07c25c246c55012981ec0296eee23e68c719333a.camel@marvell.com> In-Reply-To: <07c25c246c55012981ec0296eee23e68c719333a.camel@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [173.228.7.197] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f48ac113-0493-42dc-d74a-08d7dc992507 x-ms-traffictypediagnostic: BYAPR18MB2758: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1303; x-forefront-prvs: 0368E78B5B x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2535.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(39860400002)(366004)(396003)(136003)(376002)(346002)(478600001)(36756003)(7416002)(71200400001)(2906002)(186003)(26005)(86362001)(2616005)(316002)(6506007)(110136005)(54906003)(64756008)(66556008)(6486002)(8936002)(66946007)(66476007)(4326008)(5660300002)(66446008)(6512007)(8676002)(81166007)(76116006)(81156014); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1UPrewe9j5MkY+wG/WKajqXFVDTnUiTHFMhogoclXy0Rw/5moqUaZ5jCOSkPCfSINsK3k73LcFWKobQkCbjbeA4KiB3hndNDDdwWaG7BYshR5Tz0Sv0pE/bJ5C0wAh3lfckuoQzrzwwrj2JSdSXOvYlfzYzI2InWyr8EjNsR+0unUv4EaGF33fciOSoRJ0VmxdBwBn4mOnFv3YBl8dN8cOTrsYteihDjkgQyOTFuRBYqwVA4Z+lZCkdBBiSGVxZPmUemwQ2Angf925SJZzAuDrPs5Jn8q0FPlQNC4wp/vjMIuS7aiRx6gJm2r+SDn3CF0nsw19oQ5tEL8MN/E58qHfAO2EPiuvlaXox3sY9mEhtcM1V4BEejq4uGdTwdb1POruFSZh1mUo2cZN8lD8S+MeLZIQ4YowWhuPqR60d/lA+KaxKajNivYISa61ZsdJwt x-ms-exchange-antispam-messagedata: 0o8qkoLBk/b1R3YpNyeGdgB8rpVkEHsucY6QTU9XECOwnAeKLsjq8jDAc6JLtVm4nvujBXjDG8aq3nREQ8bzgbZne5itngwLnDTxI5ES16p+BQQyhoG1Wy+RY9fRcQtht6AgPU2eTIYUfRGYugibOg== Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f48ac113-0493-42dc-d74a-08d7dc992507 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2020 15:17:40.4002 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: W3KXvRHORmUTmHCt1fRAQvcViE7LPxCbEhHIEFOke9o+mCnnWbZxxGws1+KrZHRdhNqBTtPQy7og592j5gd6Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2758 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-09_05:2020-04-07,2020-04-09 signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some architectures implement memory synchronization instructions for instruction cache. Make a separate kind of barrier that calls them. Signed-off-by: Alex Belits --- arch/arm/include/asm/barrier.h | 2 ++ arch/arm64/include/asm/barrier.h | 2 ++ include/asm-generic/barrier.h | 4 ++++ 3 files changed, 8 insertions(+) -- 2.20.1 diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h index 83ae97c049d9..6def62c95937 100644 --- a/arch/arm/include/asm/barrier.h +++ b/arch/arm/include/asm/barrier.h @@ -64,12 +64,14 @@ extern void arm_heavy_mb(void); #define mb() __arm_heavy_mb() #define rmb() dsb() #define wmb() __arm_heavy_mb(st) +#define imb() isb() #define dma_rmb() dmb(osh) #define dma_wmb() dmb(oshst) #else #define mb() barrier() #define rmb() barrier() #define wmb() barrier() +#define imb() barrier() #define dma_rmb() barrier() #define dma_wmb() barrier() #endif diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h index 7d9cc5ec4971..12a7dbd68bed 100644 --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h @@ -45,6 +45,8 @@ #define rmb() dsb(ld) #define wmb() dsb(st) +#define imb() isb() + #define dma_rmb() dmb(oshld) #define dma_wmb() dmb(oshst) diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h index 85b28eb80b11..d5a822fb3e92 100644 --- a/include/asm-generic/barrier.h +++ b/include/asm-generic/barrier.h @@ -46,6 +46,10 @@ #define dma_wmb() wmb() #endif +#ifndef imb +#define imb barrier() +#endif + #ifndef read_barrier_depends #define read_barrier_depends() do { } while (0) #endif