Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7560571ybn; Mon, 30 Sep 2019 16:12:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsaa40dRcUBT3zBSakEZYkHIxcZpb9+aGpTNU+NAb+YtbxmqxMKVBSbVn2EqiFBvfCskT6 X-Received: by 2002:a17:906:6c8:: with SMTP id v8mr21789676ejb.252.1569885158605; Mon, 30 Sep 2019 16:12:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1569885158; cv=pass; d=google.com; s=arc-20160816; b=tY+ZNvcsglTpdHy+p9Y9b/VQV6tpDH8+7HJmhff70Jrzc4EEGc2BwUQ/aGKsGDEWYZ Mlf8ISVA5VSCn1Ibvyds2vloI7FNNPYL4Ty4K9p97NcH1ie7Xwp65UPQFb4B09GvhI6q rP6+LWQslt5v9eCXsMs5QtpmT2GX88HSBRvGEpgQvQ5UuCSyowmF478yMNMACsPAZLlc 1zEWHPBy0oWQgntmwlR5tL2TCH1sf38U65pkb84K0l0UmJGt8QBElH09WsfEzbVZ0Doj FbfPLQV67fK/jMZ3oREsT3p84OQg+BcwBX2m688Iuktv5IxCuMvNTRqR9g7ROz/ZQvJT kjHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=EmlD0QaPvWpPJoRxuK+3Qa+UxcFEj5kWoedu2Uz5ojE=; b=P+52VLWhrmt/GfnnXJSYVhvip/hc+cCBTINjaGnAjbc5tsU+lSy5X4iMhMBPDRGTP5 ByZwxN+9zdZ51UL4XaTLG6OEjwxPUtwAjif1mvZrJl4dFd36G6sz0XHuX6iM82p5Xgbw xJ3IviM92Bxxv1WbXTsSJoRSkvDw6r8d02OaP5toMGw93mykBbLxU4dNxypZCm4R2g/+ IFE86WosQB1gykR17ymylvEP4iWUlZhtKqn4lnwGGOrQtRmbzmc8rGAUxswvAUDoyQtT WPtuJJcI6Sj00x5ddb91FB4zOLPb30Q2zYaG6EnusVKieE0enC7sZgHf37C5/bL1ds+7 ar/g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wavecomp.com header.s=selector2 header.b=n4mHBYL1; arc=pass (i=1 spf=pass spfdomain=wavecomp.com dkim=pass dkdomain=mips.com dmarc=pass fromdomain=mips.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20si7074237ejs.197.2019.09.30.16.12.14; Mon, 30 Sep 2019 16:12:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@wavecomp.com header.s=selector2 header.b=n4mHBYL1; arc=pass (i=1 spf=pass spfdomain=wavecomp.com dkim=pass dkdomain=mips.com dmarc=pass fromdomain=mips.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729857AbfI3XJZ (ORCPT + 99 others); Mon, 30 Sep 2019 19:09:25 -0400 Received: from mail-eopbgr820129.outbound.protection.outlook.com ([40.107.82.129]:60959 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732761AbfI3XJV (ORCPT ); Mon, 30 Sep 2019 19:09:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mOpPVlg8QpAXgekZqwzo2V3veVHeLy8Vz+sJHrDVn85ra7aDQvauZbZZjmTTpliCbb2dHRoSAzJMY8Kx+xBld8mc+VsSuL+pTsgYcmNbjU2KbdIyBhhUtqy8f0s7uZdsBrMgdGN/4vtlS2UpXkIjz+ChIQIbJ3T7V7TKAu3+xFdq1JOS6jwMOuWg3SjSSrKlR9//JFvdiNyYCJPGUieVhi13X1SlXv4euQuYnZBbpDchwFjYfuJDQnBasCcRKhhbTJYpF0qLiK1jvvREpI5qK2titScx58muS9fJtGLeIzA8gEU/E8i6UAXz1z+d7hjRGc3izJOX6d3QsboSURbjPg== 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=EmlD0QaPvWpPJoRxuK+3Qa+UxcFEj5kWoedu2Uz5ojE=; b=blFS1ZIx4YxEoa4f8U3/h014B/1Fwe9pZ9eqYqxWXn7ZY1p+N9+xlvBzUZUwseddImUbOgSUhu0/lfGygqYX2K4ITY9WvVIibh7NeGjcrUk2Mz+TjL7RG6W9COujGTJuFdDEcHJ8rixp8Z5PS+fxgz5hBIhOl6s7x9p9dcOWoYtaurc7NFdJtI8QkfPfqKXM0Y4c4ruQNPe7lNHBCSwsYvZGmW3FHBGC2AkJODr4uqZ6ZYc0ew+Azup8UYQ+F7jHrqxEPZKOsijChzQkYlC0WHIm7k/8DM0G/JJ37UtOh4cIxOXAt66YuAAh+wjaVrOro/W6/kDoX5y39LwMAEBbUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wavecomp.com; dmarc=pass action=none header.from=mips.com; dkim=pass header.d=mips.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavecomp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EmlD0QaPvWpPJoRxuK+3Qa+UxcFEj5kWoedu2Uz5ojE=; b=n4mHBYL1KH8nMUwUgOPpX6GUGUmnoydSTiSZ3ozrnHPOluSm3F33DtOImKfesfKka/ktwij4Dg6pBVUV4uHE41qdbZ9QavRe9sV/4efVsI7rEsCksCnPMc80bwC6v05BH3nHibkZa6qiPjo8TieEgbdvzxOzLTbyqOB0R3emhCs= Received: from MWHPR2201MB1277.namprd22.prod.outlook.com (10.172.60.12) by MWHPR2201MB1022.namprd22.prod.outlook.com (10.174.167.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.17; Mon, 30 Sep 2019 23:09:11 +0000 Received: from MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::498b:c2cd:e816:1481]) by MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::498b:c2cd:e816:1481%2]) with mapi id 15.20.2305.017; Mon, 30 Sep 2019 23:09:11 +0000 From: Paul Burton To: "linux-mips@vger.kernel.org" CC: Huacai Chen , Jiaxun Yang , "linux-kernel@vger.kernel.org" , Paul Burton Subject: [PATCH 32/37] MIPS: syscall: Emit Loongson3 sync workarounds within asm Thread-Topic: [PATCH 32/37] MIPS: syscall: Emit Loongson3 sync workarounds within asm Thread-Index: AQHVd+QAF39mXHIVtk2gNcjfUb4ejw== Date: Mon, 30 Sep 2019 23:08:42 +0000 Message-ID: <20190930230806.2940505-33-paul.burton@mips.com> References: <20190930230806.2940505-1-paul.burton@mips.com> In-Reply-To: <20190930230806.2940505-1-paul.burton@mips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR21CA0006.namprd21.prod.outlook.com (2603:10b6:a03:114::16) To MWHPR2201MB1277.namprd22.prod.outlook.com (2603:10b6:301:18::12) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.23.0 x-originating-ip: [12.94.197.246] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1510cc6c-703b-4df3-bc9c-08d745fb22db x-ms-traffictypediagnostic: MWHPR2201MB1022: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 01762B0D64 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39850400004)(346002)(396003)(376002)(136003)(366004)(189003)(199004)(14454004)(256004)(6512007)(81166006)(316002)(81156014)(44832011)(2351001)(486006)(476003)(6916009)(14444005)(186003)(478600001)(2501003)(6436002)(50226002)(6666004)(8676002)(11346002)(8936002)(2616005)(5640700003)(66946007)(6486002)(42882007)(64756008)(66446008)(66476007)(66556008)(446003)(6506007)(1076003)(305945005)(386003)(52116002)(7736002)(102836004)(2906002)(71190400001)(71200400001)(36756003)(5660300002)(26005)(4326008)(66066001)(54906003)(25786009)(76176011)(107886003)(99286004)(6116002)(3846002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1022;H:MWHPR2201MB1277.namprd22.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dHRk9ulhCtAVY060Ap1PRTGSda90OAY1ED2beqRRDi6PDpXPp4LaMCZCN+JDlUsftiTj1mQPE3TAdwXczBhNdjRVBg6AJ2T/uGh/nQotNACFL80PiR6UEQzUlo2K9ar4UiM4cGcqQGLBMs90bcFFa62gldU8ItmHUXmXd29dpv/4/de8HiufjcIWsRQrXttuJvcpZS6d/bgpZOkBwkK0Cb36UwEnpcKaNHQnaDha2xZidqmBPo4/Mv0ekAwkW48XmVQg2ono3cARNiFzc7OXgIuDAV7vX+rizBb23l3JbNmmLjqWsIS9s5k49ighQ65NonDwFTx6BS2+8W4qTjxSpEGL/8FOQnEyUcF5l3U+0u/4y9KaeQ/jrblHCmpORxnroKxu0QN/PIyxRm/DbCIi2ltqpxI7Rm7K92Zoj51JrXI= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1510cc6c-703b-4df3-bc9c-08d745fb22db X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2019 23:08:42.4416 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CT2GwZ48ThxDKaDCuGWTvN3qzMByq2HPQDyt95iYEBKOlezMb1XHpf4cgJYrpj8k6fxjFq+jF4s/ccOANLl10Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR2201MB1022 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generate the sync instructions required to workaround Loongson3 LL/SC errata within inline asm blocks, which feels a little safer than doing it from C where strictly speaking the compiler would be well within its rights to insert a memory access between the separate asm statements we previously had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- arch/mips/kernel/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index b0e25e913bdb..3ea288ca35f1 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include =20 @@ -132,12 +133,12 @@ static inline int mips_atomic_set(unsigned long addr,= unsigned long new) [efault] "i" (-EFAULT) : "memory"); } else if (cpu_has_llsc) { - loongson_llsc_mb(); __asm__ __volatile__ ( " .set push \n" " .set "MIPS_ISA_ARCH_LEVEL" \n" " li %[err], 0 \n" "1: \n" + " " __SYNC(full, loongson3_war) " \n" user_ll("%[old]", "(%[addr])") " move %[tmp], %[new] \n" "2: \n" --=20 2.23.0