From patchwork Tue Nov 13 23:39:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10681649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66AC214D6 for ; Tue, 13 Nov 2018 23:40:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 575BD2B4A0 for ; Tue, 13 Nov 2018 23:40:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AE972B486; Tue, 13 Nov 2018 23:40:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C03462B458 for ; Tue, 13 Nov 2018 23:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Lg0jirTxKcbuiTIUP/okk8aoKZH1ngEhWYSPtzcfRjE=; b=lzE ocKwxuL1IXf6XccZEoec4/CkUp3l9Gzwv/+2tFe75Sa2nJEUokkB9EQjVAJzJO0N0GOFYT8EkaYRx PJJxuCqtmb3lMmOfxoRxenhP/8NLyHQaiQafBJue/g83pvGdCyJjDQQbQv2H2L3VbABbZATXum8/2 9lKxS+OrpJlZRrCeDjEt4VURtdbA7lufRzVDceaoh2PCP9vcWn6FjoLaYWLW2o6Ngq0cFhg1uqVHV Sev6JSwSTqVHgrRs8h5RE22NveR/Wx8Qm0Q7v7maCcwjD6BDaQt2Bez3Tvil8mlgbDIqcbl5RXZS+ QjVDM1UurWGDKnFBoPmYPtQ8XV6NjRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMiIR-00027A-Vj; Tue, 13 Nov 2018 23:40:39 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMiIP-000261-PT for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2018 23:40:39 +0000 Received: by mail-pg1-x529.google.com with SMTP id y4so6431671pgc.12 for ; Tue, 13 Nov 2018 15:40:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=2XONnGIvrFS3x1l1/nbOrnE02cD2eCA4Bx8TGR1qljI=; b=L2O73/7Il3KyFuP+a77eRXa8iCzlCmLk2jWqXgMGkQSIJ9I2ziiv8FR11Vg3A+zLni p+zKuy3NJQ/tZ8++ie/+JQTj6inR+KtPnwDDFszl3UobTswjcqhp5LiQ1y3wM9Fl8kgr 0fuUjcSzEyGIKPVCbxVkDH5mmYAaHFgG4DFqM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2XONnGIvrFS3x1l1/nbOrnE02cD2eCA4Bx8TGR1qljI=; b=XWWu8LsICSZLE1uiW5LU+F+6/Xif8whQGem4pPBaLlA6uYgNU5OPskAvIF5/pSrUMD t9wqcyJ+NxXPUOStUa+b20yHWFQ21Oeu5+uld3a+sIT6k5uQ9VCHzRrW70tDAIUN7p7H S+3QWV1vJCA5zWVBQ80JxcL/GIX3kPlDZlkpiQ365eFqtyH1rcNZcN2/AlS8VTL/GbOk +1VHY2XubyvLg/pR2VjWvNu2fLuG8gV+2wSOg449wJKppFTEvgKJnjd77BnKvejnc/bo hEHv9qbDOpI0dkWD04ybRkQvzoO3mtf0P9NiKZT056WQDzwArR/O0Go26BYfXzaZWLhN LS/Q== X-Gm-Message-State: AGRZ1gL1yXIk5N7UNIvVNGUb3FQc4VuemWAAt68B1ICyUUXct9c5L8lH nHyAk6/JS1/kUpqw4l59agooIje1NSkRKg== X-Google-Smtp-Source: AJdET5fZwdMVRjTLv+y4NupG9+a3hd63qWskz2jDeixU6n3f5wEmjxvwPFbAXVtgRWTbEQrNNPrQRA== X-Received: by 2002:a63:2ad4:: with SMTP id q203-v6mr6470344pgq.356.1542152423996; Tue, 13 Nov 2018 15:40:23 -0800 (PST) Received: from mba13.psav.com ([64.114.255.97]) by smtp.gmail.com with ESMTPSA id c7-v6sm26270493pfh.25.2018.11.13.15.40.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 15:40:23 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/3] arm64: use subsections instead of function calls for LL/SC fallbacks Date: Tue, 13 Nov 2018 15:39:20 -0800 Message-Id: <20181113233923.20098-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181113_154037_829981_44AA81D9 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com, Ard Biesheuvel , will.deacon@arm.com, marc.zyngier@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Refactor the LL/SC atomics code so we can emit the LL/SC fallbacks for the LSE atomics as subsections that get instantiated at each call site rather than as out of line functions that get called from inline asm (without the awareness of the compiler) This should allow slightly better LSE code, and removes stack spilling and potential PLT indirection for the LL/SC fallbacks. Ard Biesheuvel (3): arm64/atomics: refactor LL/SC base asm templates arm64/atomics: use subsections for out of line LL/SC alternatives arm64/atomics: remove out of line LL/SC alternatives arch/arm64/include/asm/atomic_ll_sc.h | 190 ++++--- arch/arm64/include/asm/atomic_lse.h | 558 ++++++++++---------- arch/arm64/include/asm/lse.h | 13 - arch/arm64/lib/Makefile | 19 - arch/arm64/lib/atomic_ll_sc.c | 3 - 5 files changed, 372 insertions(+), 411 deletions(-) delete mode 100644 arch/arm64/lib/atomic_ll_sc.c