Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1703791lqz; Mon, 1 Apr 2024 14:40:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvCZs4qFF9KEN7VWQHo5aNV4JD2kx2ytBs7rnYeZQoyNeFvkUnMCQ4reWoKAaK6nvQTkpDYel8idxWmFQOFFpHwvZ87I55NRYGyDjo9w== X-Google-Smtp-Source: AGHT+IHHMPg7AK4kgIC1jurprw4tgeUdy2XlFS4RCzTR0V4i8hX7ItpU/YyvcY39ebQOTuLMaomI X-Received: by 2002:a50:baa2:0:b0:56b:f461:5de8 with SMTP id x31-20020a50baa2000000b0056bf4615de8mr8421397ede.29.1712007631608; Mon, 01 Apr 2024 14:40:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712007631; cv=pass; d=google.com; s=arc-20160816; b=ICZhYF52tqY24kLiiWzcNRGTbNO0jWMAJej0WkhyXsLbi5P3fGfyZv0cTLUaZQ3025 ALaZLgyRkXQANSFwUyqaRpLFpmN6DMTGDfftK5m+7m+IFafvcLh63yLStCYEVNnQyvR7 RNuRqyqw7deh8klmvbnlx6yiFq7+1FhbXLnbKyhHl9vXnQx3pUM+w9/hh5uK8kSb3Kr3 jXINlw903EEBeXHXRJvqb/ERHba9eDht/ybOSw/FThqT/SQ5PBpGS1qK9dKzcpC830eC WtOywpyqI2CJkEogsPVyngFzknbL4LuSHN9Fldh2m8SoMoZWBkG+G7JM6pXFfpdWyYoV VE6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4r4C6xpmZtPLxkHBlmscAUvl4q14/Dun9H0yrFgl1jY=; fh=vFFXWtNskSru5peB+17BCDUQts8AkxlHcJ7fxDSCWF4=; b=JLqzHMNs3nis1nylG3y6rZB/DrSd0Ww5mPb6rxqg/zPVW8D6s7LVGglkx+xcAYU4PW isWxZezoZ0l/t0U+ep0e4PGVbq1TPCYJdDUrFE5Hvhk8tN2lnALWOQMp0AmP7fv2Tplh IInB0vhNvYPiAo3ulX191PUkvxhexLqpTeO3bFf6TC6elt/9VeKYnkhHnEqjtTaTLan1 7u6ClH92p2ffDUhUndCMs8MNQXWEZsjwmhkN9TcSzzr00zv1Hy9uaDSdV9+rvvFIVW+V V6Eq6dxUg3l2iDgthd+YQdiO5Ixm6ni8so3DbIpzj5F52zWzpLOGLsarYrbLYXnjIOnx /xqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GbSx1Kih; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127097-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w7-20020a05640234c700b0056bf2e861cesi5246953edc.236.2024.04.01.14.40.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 14:40:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GbSx1Kih; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127097-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127097-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 588A31F225D8 for ; Mon, 1 Apr 2024 21:40:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D77356B8C; Mon, 1 Apr 2024 21:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GbSx1Kih" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A102856451; Mon, 1 Apr 2024 21:39:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712007595; cv=none; b=OHksULmATpQ38ZWlpGbMs7O80ptkUvSsFc4v7GAgibcIEfsPzjZnOpUvcSaUX6uahYEa5kGNxz1B3vwp5spbiRMliBzYwu5P4pSu2nFIytJkIe1n69tkxelRVlTUPV1CxG7fu3dZJvzwgI78qB9BbxnGsVjYB2oFzUHehWTleIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712007595; c=relaxed/simple; bh=Pey06aLnsLIkF3gQwCE3xye5sHMsA4TvrP5HMpqUzF4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qy/lNoxwRBLHRqyrTxYWqyVcJR5U7JFZ1Wbc06L7W17h3K43bAgKCWk8W0+jnVcINkFya7xhl7XJ+hFHEpDF/oDmJZGp1Jl8lUTRk7bxgHeVP36hOEXsjJP4WR4hiJIycuLEJlOyZZ7i6m0KVeF86nUZoPZmmoUClJyf4LMkROQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GbSx1Kih; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71E1AC4166D; Mon, 1 Apr 2024 21:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712007595; bh=Pey06aLnsLIkF3gQwCE3xye5sHMsA4TvrP5HMpqUzF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GbSx1KihmT9WtPJs586246mVIRQzi+qsjmxTVRaon1gmEjk0lPItmESlYh5QhC9aV Ib69kzvUKgqxWrUKS37wueAgS72+c0IG3W6VRsD8Rw0BBODDuRjhPDbhQfqZbLi5Zl JATJgrTA8tSNHW38sYwH+8Mld9eGwOElgjCvThaJFDHnxG/j+eDJuOEkTfleTqLZ4k y1QSM8JcNE9ztVxnVdm0kUWrjFqLQ0SeDzpR/S9IOhhl12uCVcUqxSkoZLGewk7ILg MLN7wp98ifSjdXgOA2VjujrSZZglP3VEzV9iw6fcTrBjlc8P17TmdKtn40qCad4c9s tbsftMN3dOLtA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id CA97BCE0FF3; Mon, 1 Apr 2024 14:39:54 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: kernel-team@meta.com, "Paul E. McKenney" , "James E.J. Bottomley" , Helge Deller , Palmer Dabbelt , Geert Uytterhoeven , Arnd Bergmann , "Peter Zijlstra (Intel)" , Andrzej Hajda , linux-parisc@vger.kernel.org Subject: [PATCH RFC cmpxchg 7/8] parisc: Emulate two-byte cmpxchg Date: Mon, 1 Apr 2024 14:39:49 -0700 Message-Id: <20240401213950.3910531-7-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <31c82dcc-e203-48a9-aadd-f2fcd57d94c1@paulmck-laptop> References: <31c82dcc-e203-48a9-aadd-f2fcd57d94c1@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use the new cmpxchg_emu_u16() to emulate two-byte cmpxchg() on parisc. Signed-off-by: Paul E. McKenney Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Palmer Dabbelt Cc: Geert Uytterhoeven Cc: Arnd Bergmann Cc: "Peter Zijlstra (Intel)" Cc: Andrzej Hajda Cc: --- arch/parisc/Kconfig | 1 + arch/parisc/include/asm/cmpxchg.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index daafeb20f9937..06f221a3f3459 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -15,6 +15,7 @@ config PARISC select ARCH_HAS_STRICT_MODULE_RWX select ARCH_HAS_UBSAN select ARCH_HAS_PTE_SPECIAL + select ARCH_NEED_CMPXCHG_1_2_EMU select ARCH_NO_SG_CHAIN select ARCH_SUPPORTS_HUGETLBFS if PA20 select ARCH_SUPPORTS_MEMORY_FAILURE diff --git a/arch/parisc/include/asm/cmpxchg.h b/arch/parisc/include/asm/cmpxchg.h index c1d776bb16b4e..f909c000b6577 100644 --- a/arch/parisc/include/asm/cmpxchg.h +++ b/arch/parisc/include/asm/cmpxchg.h @@ -72,6 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) #endif case 4: return __cmpxchg_u32((unsigned int *)ptr, (unsigned int)old, (unsigned int)new_); + case 2: return cmpxchg_emu_u16((volatile u16 *)ptr, old, new); case 1: return __cmpxchg_u8((u8 *)ptr, old & 0xff, new_ & 0xff); } __cmpxchg_called_with_bad_pointer(); -- 2.40.1