From patchwork Fri Dec 11 17:45:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Ivanov X-Patchwork-Id: 1415172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cambridgegreys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=RRj9Rhln; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Csyrw6bqlz9sVJ for ; Sat, 12 Dec 2020 04:46:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=LgcjvJ6vaKmDNkeP9czA6C/drdISpfVwWR2YwSLTRxc=; b=RRj9RhlnMfGd5e3hFpewaApJ/ 1YwBI/jw69K2kPv1zy1tclZ57/9F/mIdRrMo15Z7moJXThEuPWL/aDCRqN/en1/2PwV6z2M6wwbGy ajAfumf9g4wciHVoEVtu8Dpxcn6GjPHNy4uGRXW4g6bT8uoxgPhNVuRaC3JLVCnTSKlcdZ5xwSZVp p2kICdgMHazLgHYqGWPItX37E5zjm11TIePSiGCSRfzAKduWGLBxa7elPfonpV5YaaUvTbfxZXv2O kXKPn1PlCu1JmYYBWcFjCVXH7xFchloLVt37MqzA6CbC/gxTReOr5tW2ofMIcvLwsiDvavEwJpSM/ yIR0Mi5/A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1knmUw-0008K1-6p; Fri, 11 Dec 2020 17:46:30 +0000 Received: from ivanoab7.miniserver.com ([37.128.132.42] helo=www.kot-begemot.co.uk) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1knmUr-0008Hz-F7 for linux-um@lists.infradead.org; Fri, 11 Dec 2020 17:46:26 +0000 Received: from tun252.jain.kot-begemot.co.uk ([192.168.18.6] helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knmUq-00020C-Mx; Fri, 11 Dec 2020 17:46:24 +0000 Received: from jain.kot-begemot.co.uk ([192.168.3.3]) by jain.kot-begemot.co.uk with esmtp (Exim 4.92) (envelope-from ) id 1knmUo-0006zn-0m; Fri, 11 Dec 2020 17:46:23 +0000 From: anton.ivanov@cambridgegreys.com To: linux-um@lists.infradead.org Subject: [PATCH v4 5/7] um: "borrow" cmpxchg from x86 tree in UML Date: Fri, 11 Dec 2020 17:45:57 +0000 Message-Id: <20201211174559.26010-6-anton.ivanov@cambridgegreys.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201211174559.26010-1-anton.ivanov@cambridgegreys.com> References: <20201211174559.26010-1-anton.ivanov@cambridgegreys.com> MIME-Version: 1.0 X-Spam-Score: -1.0 X-Spam-Score: -1.0 X-Clacks-Overhead: GNU Terry Pratchett X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201211_124625_564785_AE393178 X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard@nod.at, Anton Ivanov Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Anton Ivanov UML was falling back to asm-generic cmpxchg which emulates atomic behaviour by turning irqs on/off. On UML this means turning on/off signals for each cmpxchg which is expensive. Signed-off-by: Anton Ivanov --- arch/um/include/asm/cmpxchg-x86.h | 1 + arch/um/include/asm/cmpxchg.h | 7 +++++++ arch/um/include/asm/cmpxchg_32.h | 1 + arch/um/include/asm/cmpxchg_64.h | 1 + 4 files changed, 10 insertions(+) create mode 120000 arch/um/include/asm/cmpxchg-x86.h create mode 100644 arch/um/include/asm/cmpxchg.h create mode 120000 arch/um/include/asm/cmpxchg_32.h create mode 120000 arch/um/include/asm/cmpxchg_64.h diff --git a/arch/um/include/asm/cmpxchg-x86.h b/arch/um/include/asm/cmpxchg-x86.h new file mode 120000 index 000000000000..a5c607edde88 --- /dev/null +++ b/arch/um/include/asm/cmpxchg-x86.h @@ -0,0 +1 @@ +../../../x86/include/asm/cmpxchg.h \ No newline at end of file diff --git a/arch/um/include/asm/cmpxchg.h b/arch/um/include/asm/cmpxchg.h new file mode 100644 index 000000000000..03e7a669eeef --- /dev/null +++ b/arch/um/include/asm/cmpxchg.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_UM_CMPXCHG_H +#define _ASM_UM_CMPXCHG_H + +#include + +#endif diff --git a/arch/um/include/asm/cmpxchg_32.h b/arch/um/include/asm/cmpxchg_32.h new file mode 120000 index 000000000000..1f360d0a9fa9 --- /dev/null +++ b/arch/um/include/asm/cmpxchg_32.h @@ -0,0 +1 @@ +../../../x86/include/asm/cmpxchg_32.h \ No newline at end of file diff --git a/arch/um/include/asm/cmpxchg_64.h b/arch/um/include/asm/cmpxchg_64.h new file mode 120000 index 000000000000..bc09ae22b0cb --- /dev/null +++ b/arch/um/include/asm/cmpxchg_64.h @@ -0,0 +1 @@ +../../../x86/include/asm/cmpxchg_64.h \ No newline at end of file