Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp311998ybv; Thu, 13 Feb 2020 00:45:28 -0800 (PST) X-Google-Smtp-Source: APXvYqznHA5J6yuhvixV9cbqkGTM/AjMLttvO8+TXsRgvKkscQHk4OtDjrp3WtAs5E4lpWokglcJ X-Received: by 2002:aca:db56:: with SMTP id s83mr2170365oig.171.1581583528422; Thu, 13 Feb 2020 00:45:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581583528; cv=pass; d=google.com; s=arc-20160816; b=hUIyQ3bEVVuUEEnys7ug04k6x5jMWVsxBZZUNLsrOgOfiXQB+6HfkrFE/in/hIvH1E 4p1Htm8r6A+Yde5fm3lm5mGn50YmRfT72WwYN7ohMyWKpaCCs9K94HeDP9eF39/a2+L0 rPuoNmx49gaz9D2nS7Nku0RQAFwClAU4QngbxO90JqBkVYc7YtAE9aqELlDKXdLlLgVE hl9S+fh0ZZkDY31aD00p8xlcx66ajiHb3K47CXnDve1Z/8T1SxBFucjAc7TN5iUDgL8l T0GKe4IPn7To5HwaySwJkbu40QT9vNGQ1GL1iauuHnwxGggShtkUQccdUuxYAr4onTOM 1hSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=pXNhmnWF48lYQU6Klqv7Ry1mzvTlKQ5idXWAfRD1C7A=; b=Tn77HJXh4T4v1WEtZgeKTf0mDa77qN24sNvxqg2rhwwNReObqiPKsm5R9uW6F1h19P KEsqEAku62+GKJ5erJqmzJn3+TnL8sqfQoKFO6X6cSwWplpR4R9xxSNRpZYXI69VTwOw LuaeI/ZHXkUOQeX7TeR5ej5YduLs0UmzKEeCgY44RgQ9fcsXkOgqMt9chm8gd30KAhMW /K4BxARUj5ANzaKuLVNknX6+h270/EmPOw7YSFgrfKgh35bho4lUfKRdFzLGpmeHgNtI B2vkBJPSinIQGixUevgkOclWagC9uI2LaYKKIXPcdfwr3jVHJPH+6IhtVOB+1UUwQOth fE8Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=be4yle3Y; arc=pass (i=1 spf=pass spfdomain=xilinx.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 v23si754384oto.81.2020.02.13.00.45.15; Thu, 13 Feb 2020 00:45:28 -0800 (PST) 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=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=be4yle3Y; arc=pass (i=1 spf=pass spfdomain=xilinx.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 S1729648AbgBMInr (ORCPT + 99 others); Thu, 13 Feb 2020 03:43:47 -0500 Received: from mail-bn8nam11on2068.outbound.protection.outlook.com ([40.107.236.68]:51710 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726232AbgBMInr (ORCPT ); Thu, 13 Feb 2020 03:43:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V0SaHEqw5z3+8UrtA/LoHDrIZIydAGvblq4Igpl9DRHafkhMec0CVHJvRwzsrIbOjaZ8SX0waqk35Q6d5H/99bSQCXZo7Y5xwwwD62IOwb8eOLqqfDZ7binXNGUpIw+5G8moBXzfTS2SGnjVl6jBvGybMdxUXzF3173fLnB2KJOIQzQZG4LLF1gVpGtfQS3APyTIwkitpBbMRYRG6pRa21FrOJ1uZYrnCAg33Xd24Iu/i2Kgl/kzVc3pyyprSyMVw/FMWhC1Vi6OfPmuTf6vNdnX//0TNOTQOJUzkEaSAzT2yPMgw2sk9CbMJT3R1jagVwrePVKSRc5xsL2rvV/tIQ== 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=pXNhmnWF48lYQU6Klqv7Ry1mzvTlKQ5idXWAfRD1C7A=; b=UyxH5x7eeR4OBeUyfMIxgTcw2meRU0ombUdcImk8FFfTUVKo1LIxrSDlxJruoI67uiTqGoCvpCYNtlo78RqDvKyjJBzkQrdeKDFyXxGmR6hhDEQz7KNxDRVwe3UU0s8DwjjvF+APp+NERDyOttNUV6xd6wWPdd1bH55qUTCJ1pAKIdmhg0Odd/YVCzCrmS85BPmA9dq1EgLnAPMRa/EnXwCh0SES+2FOto5ZbZFG5H3P2KbdVOAXENM1ouULiq+vtsNH//nEK36Hzt56SHmqV7uAEtKHgJJsTOHTIWZ7WrAw0vlqSM+3v0E/3FYl5G7oZufcYrUTSGKchRK/OWv7iA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=infradead.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pXNhmnWF48lYQU6Klqv7Ry1mzvTlKQ5idXWAfRD1C7A=; b=be4yle3YuujAw6SDm2v3aMQj8WGIh5qrLE5wSfJJ++wEnuTaeH1ib+P6AxNZW8q+b4a6T2DbD+ryxpwec/4E+zG5Z6BaiO9ZpOAhJMpvYUEMdc8ltayEuHjfpV+1MzAcnH4FKRhCkIeULJ827n+/tFcqKurBvHm+q9kBLOxWJhw= Received: from BN6PR02CA0039.namprd02.prod.outlook.com (2603:10b6:404:5f::25) by DM6PR02MB7035.namprd02.prod.outlook.com (2603:10b6:5:25b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.23; Thu, 13 Feb 2020 08:43:03 +0000 Received: from SN1NAM02FT021.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by BN6PR02CA0039.outlook.office365.com (2603:10b6:404:5f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.22 via Frontend Transport; Thu, 13 Feb 2020 08:43:03 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT021.mail.protection.outlook.com (10.152.72.144) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2729.22 via Frontend Transport; Thu, 13 Feb 2020 08:43:03 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1j2A5O-0002iu-Uf; Thu, 13 Feb 2020 00:43:02 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1j2A5J-0008WC-RI; Thu, 13 Feb 2020 00:42:57 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 01D8gqlV020865; Thu, 13 Feb 2020 00:42:52 -0800 Received: from [172.30.17.107] by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1j2A5E-0008Uv-1d; Thu, 13 Feb 2020 00:42:52 -0800 Subject: Re: [PATCH 3/7] microblaze: Define SMP safe bit operations To: Peter Zijlstra , Michal Simek Cc: linux-kernel@vger.kernel.org, monstr@monstr.eu, git@xilinx.com, arnd@arndb.de, Stefan Asserhall , Greg Kroah-Hartman , Masahiro Yamada , Will Deacon References: <6a052c943197ed33db09ad42877e8a2b7dad6b96.1581522136.git.michal.simek@xilinx.com> <20200212155309.GA14973@hirez.programming.kicks-ass.net> From: Michal Simek Message-ID: Date: Thu, 13 Feb 2020 09:42:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200212155309.GA14973@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(136003)(396003)(346002)(39860400002)(376002)(189003)(199004)(186003)(26005)(110136005)(356004)(54906003)(316002)(6666004)(4326008)(36756003)(426003)(5660300002)(2616005)(336012)(44832011)(478600001)(31696002)(81166006)(81156014)(8676002)(9786002)(8936002)(2906002)(31686004)(70586007)(70206006);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB7035;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;LANG:en;PTR:unknown-60-83.xilinx.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8312dd5d-d76c-4095-4ec7-08d7b060bd3c X-MS-TrafficTypeDiagnostic: DM6PR02MB7035: X-LD-Processed: 657af505-d5df-48d0-8300-c31994686c5c,ExtAddr X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 031257FE13 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WoKtdMFz82wT/WNthEgTpJKW0vUCcy3KGgRh8+VclBVQtmVer5iZWRWWCwMpY07CaYa1PthuPW16iybXKl3qwsy4pFSZ4S1jRzy25zgoAgKyD2Jax+MWVaIOcOvpSVLyrR8eVwcGpHZZcJeZabmeCgQS+MJYX0zM2Kjjg/h5IrQK8yLdtm9bZdL+BffCr3jeXuGrHU1BI/q1OC/2p1bHu4QnqLNDue5ymJ8BN5qBxEjoxfRjl6Z7ww23EEtLpBiGM8o1L+ROLhQX4dM4a6MkaJn6sqLfHESc1WF530oxU4RJwkDf6GygzcMUgQzMqKKLb1tM13RbZljou11kgyx8UbmI4ucHQU8PQg1cl9dLXe+uwSHCDb2go7Cc7MyND8rSjHKQP+Cz6RYJ52SFTs6rwpycRBmtsrjyqukVXLGvqM1vJj5Y/ktdD/u/Wg9EsaoU X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2020 08:43:03.3288 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8312dd5d-d76c-4095-4ec7-08d7b060bd3c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB7035 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12. 02. 20 16:53, Peter Zijlstra wrote: > On Wed, Feb 12, 2020 at 04:42:25PM +0100, Michal Simek wrote: >> From: Stefan Asserhall >> >> For SMP based system there is a need to have proper bit operations. >> Microblaze is using exclusive load and store instructions. >> >> Signed-off-by: Stefan Asserhall >> Signed-off-by: Michal Simek > >> +/* >> + * clear_bit doesn't imply a memory barrier >> + */ >> +#define smp_mb__before_clear_bit() smp_mb() >> +#define smp_mb__after_clear_bit() smp_mb() > > These macros no longer exist. ok. Easy to remove. > > Also, might I draw your attention to: > > include/asm-generic/bitops/atomic.h > > This being a ll/sc arch, I'm thinking that if you do your atomic_t > implementation right, the generic atomic bitop code should be near > optimal. > Based on my look it looks like that I can replace implementations in this file by sourcing which will be using atomic operations. #include #include Correct? Would be good to run any testsuite to prove that all operations works as expected. Is there any testsuite I can use to confirm it? Thanks, Michal