Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3339432imu; Sun, 11 Nov 2018 12:43:51 -0800 (PST) X-Google-Smtp-Source: AJdET5eBPIrRezReOstqypJv6KJelfaugUS+l07VFzh+y4XYZYz+TPkSgUC0aQrCu79Bt+DB4LMG X-Received: by 2002:a17:902:6bc9:: with SMTP id m9-v6mr17715760plt.106.1541969030967; Sun, 11 Nov 2018 12:43:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541969030; cv=none; d=google.com; s=arc-20160816; b=ffm1gvsZYrQCv5+pdWEiiklYePXJa3m5FLc5D+r5FsScKrqAlbLYeHbruBk0tFVUNw FAA2XqYknaINPa0wvovs4wNagWKpc0diYAxJTH55jC4xw21HkswEu8Tm6AmIUHYrKzwu iBUMV6gdf4Q8huE+DulBp4HNmqWSY/x/VaJUj6VoDEjaEeY7ibKkofyr02lMg263Up/R FO+kMRUMut+jQMu8l78zBhmIIhMgpVB5mT/7f3ENLNDS2mH++1et8eQhSzi2joQ5EjF3 uuD4iqk2NXsAJzKayq7ZyMKY1m0iPbCU0Tmgjs4PrDTghZs+wFUwnNN4ewLSMY2yctkR Ntlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=Q0N+JpO6hoQtTTYptF/j8iyD+Pn/rpQ1D6dHLRv8nMc=; b=URLJW3JT0XyZeK9/fi8Jgwp5MK36XPhVa0Sm52LB+PJxFP6tp99w5EO1VYULspKT9c DTIrTYVZexdxm75FvuC6sUoxG96XjYmm6GPFp30SjwBMfQWU8Q0slJtVPKzY1TXO2C92 BX0iD5skHFIq+4vKDwn1+Qxba7EtxGaCXP4lK2NxeaYLxZfQhOqY1am/oIwfGr97cQJ0 bj3jQZNU3kkcQYOpsvh+f9ZrwJxnWSwIU0XbdSEa5dd9xGKAcVUx8RHjYMxNKO+uGR8x fFu3eAKzSm24GOLJs1IVQhxDT3RFy1gRp15V5LLk3myCRL+46wFGkPKgazu/SbZu6IK+ g+cw== ARC-Authentication-Results: i=1; mx.google.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 n13si9872774pgp.307.2018.11.11.12.43.35; Sun, 11 Nov 2018 12:43:50 -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; 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 S1730196AbeKLGcq (ORCPT + 99 others); Mon, 12 Nov 2018 01:32:46 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49302 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729749AbeKLFsB (ORCPT ); Mon, 12 Nov 2018 00:48:01 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsN-0000l5-Jg; Sun, 11 Nov 2018 19:58:31 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsN-0001M6-Ed; Sun, 11 Nov 2018 19:58:31 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Andre Przywara" , "Will Deacon" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 001/366] arm64: add missing data types in smp_load_acquire/smp_store_release In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Andre Przywara commit 878a84d5a8a18a4ab241d40cebb791d6aedf5605 upstream. Commit 8053871d0f7f ("smp: Fix smp_call_function_single_async() locking") introduced a call to smp_load_acquire() with a u16 argument, but we only cared about u32 and u64 types in that function so far. This resulted in a compiler warning fortunately, pointing at an uninitialized use. Due to the implementation structure the compiler misses that bug in the smp_store_release(), though. Add the u16 and u8 variants using ldarh/stlrh and ldarb/stlrb, respectively. Together with the compiletime_assert_atomic_type() check this should cover all cases now. Acked-by: Will Deacon Signed-off-by: Andre Przywara Signed-off-by: Will Deacon Signed-off-by: Ben Hutchings --- arch/arm64/include/asm/barrier.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h @@ -64,6 +64,14 @@ do { \ { .__val = (__force typeof(*p)) (v) }; \ compiletime_assert_atomic_type(*p); \ switch (sizeof(*p)) { \ + case 1: \ + asm volatile ("stlrb %w1, %0" \ + : "=Q" (*p) : "r" (v) : "memory"); \ + break; \ + case 2: \ + asm volatile ("stlrh %w1, %0" \ + : "=Q" (*p) : "r" (v) : "memory"); \ + break; \ case 4: \ asm volatile ("stlr %w1, %0" \ : "=Q" (*p) \ @@ -84,6 +92,14 @@ do { \ typeof(*p) ___p1; \ compiletime_assert_atomic_type(*p); \ switch (sizeof(*p)) { \ + case 1: \ + asm volatile ("ldarb %w0, %1" \ + : "=r" (___p1) : "Q" (*p) : "memory"); \ + break; \ + case 2: \ + asm volatile ("ldarh %w0, %1" \ + : "=r" (___p1) : "Q" (*p) : "memory"); \ + break; \ case 4: \ asm volatile ("ldar %w0, %1" \ : "=r" (___p1) : "Q" (*p) : "memory"); \