Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp46406imu; Thu, 8 Nov 2018 14:30:37 -0800 (PST) X-Google-Smtp-Source: AJdET5csSTrnfaXHunZEdhx92RUCtiJsNl1BDvxKCb2UXv6K+grlltxyvCzqQ7Tl+RJ9DdufZ48X X-Received: by 2002:a62:6547:: with SMTP id z68-v6mr6228213pfb.169.1541716237761; Thu, 08 Nov 2018 14:30:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716237; cv=none; d=google.com; s=arc-20160816; b=0HF9PgtFbNY+J56ekTl0VPUdpK2ckLpSF+NxTns+hnkoanVeB/0uTu+4v9XtkeSKVl byrXtL5RwNDNjkDwtAQDUAbMtB/YpHgywxMEYvRIVVlKkIwRigJIvyyHE4VgRjnfLPgV mNW8lxdrJ4xPkvQUSyoiFME+RSlvvbiA37NS5/yRH1qMOwdmSW9k1DPN7+mD2q16dgqm ACt6KbZx0WO7kLn1tYgaSSnCQJyuoKKgTqtLwV3eLusNK7AdeSPMZQN2of3Zooq5/s4a vn5RFs6sMt8rigp3Zj7Jtn5NClWiaoukRtGgr3T4RcdTNO4s4NCrcBzZw7Fl9jD7SB/J P3iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2gIzV8OeV50rAkyEsaxDG+c3FTN6zSyygacC3K+hJTk=; b=GW0iGUUD3PAAiggGRv010RjEjI72zNUtdFupCUivJbvjNdQzhMsvXKAp7CxOXi4reQ UUad4+FiBhBtPqXtwjd+KpWrdPbLv//dpp3gx1UJWWEsB38XKklzN3TWv9RCV4LjB19e aMAAbti3fZ8T+vNmB2q2ZdHMRhtFqJcAceNe3Jqu2ujpKyiUiD+bHxmeo/BqxUgYbNpX 9MWmTKky3lf90uedkDGj62z07hfuIu8qj6RIaQXaucLjVxAy3HtX2ZJRQS8Phc5s48Il S3xWN78oyp1eOsVfsH4i6+uVLlR1R3Hns6Lf41FkiXyYDdJnACFQOHW9WclRc5UkOv40 VgtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bChDUMU8; 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 o13-v6si4574971pgh.61.2018.11.08.14.30.22; Thu, 08 Nov 2018 14:30:37 -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=@kernel.org header.s=default header.b=bChDUMU8; 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 S1730922AbeKIHjR (ORCPT + 99 others); Fri, 9 Nov 2018 02:39:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:58912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728085AbeKIHjR (ORCPT ); Fri, 9 Nov 2018 02:39:17 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E9C27208E3; Thu, 8 Nov 2018 22:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714508; bh=tZxv+KaOyiGHq5qWK+Ccv4oFJku2+/pF55clW50yChk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bChDUMU8iLkZgO4t36IB1sJL38qK8V1NWZHbAFQUesfl4lAuxiCQEJD28+mduC2j3 UN+C/XyeNNj3u+CdSU1NrE2zPJEGTJJmJVeUkVI7wW41dBG3JeidGx7J/yElkKUJ4T hm9UEIbODFAwkn4Z8jyXI8/OT0+U2Ef9tsd8y5Os= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "Peter Zijlstra (Intel)" , Thomas Gleixner , hpa@zytor.com, eric.dumazet@gmail.com, bp@alien8.de Subject: [PATCH 4.4 113/114] x86/percpu: Fix this_cpu_read() Date: Thu, 8 Nov 2018 13:52:08 -0800 Message-Id: <20181108215111.026443173@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Zijlstra commit b59167ac7bafd804c91e49ad53c6d33a7394d4c8 upstream. Eric reported that a sequence count loop using this_cpu_read() got optimized out. This is wrong, this_cpu_read() must imply READ_ONCE() because the interface is IRQ-safe, therefore an interrupt can have changed the per-cpu value. Fixes: 7c3576d261ce ("[PATCH] i386: Convert PDA into the percpu section") Reported-by: Eric Dumazet Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Acked-by: Eric Dumazet Cc: hpa@zytor.com Cc: eric.dumazet@gmail.com Cc: bp@alien8.de Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181011104019.748208519@infradead.org Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/percpu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -184,22 +184,22 @@ do { \ typeof(var) pfo_ret__; \ switch (sizeof(var)) { \ case 1: \ - asm(op "b "__percpu_arg(1)",%0" \ + asm volatile(op "b "__percpu_arg(1)",%0"\ : "=q" (pfo_ret__) \ : "m" (var)); \ break; \ case 2: \ - asm(op "w "__percpu_arg(1)",%0" \ + asm volatile(op "w "__percpu_arg(1)",%0"\ : "=r" (pfo_ret__) \ : "m" (var)); \ break; \ case 4: \ - asm(op "l "__percpu_arg(1)",%0" \ + asm volatile(op "l "__percpu_arg(1)",%0"\ : "=r" (pfo_ret__) \ : "m" (var)); \ break; \ case 8: \ - asm(op "q "__percpu_arg(1)",%0" \ + asm volatile(op "q "__percpu_arg(1)",%0"\ : "=r" (pfo_ret__) \ : "m" (var)); \ break; \