Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp31826pxb; Fri, 15 Jan 2021 05:10:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxitq+04YQ8CVP++TMvjiF8RAQa18cMuCOYHwi8EPkPrOEpWAlkeO6290szvNrCdjpwheDi X-Received: by 2002:a17:906:46c7:: with SMTP id k7mr8574182ejs.33.1610716203872; Fri, 15 Jan 2021 05:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610716203; cv=none; d=google.com; s=arc-20160816; b=vaBLKE8Y6hNkOO9jFGPDNmeFiG512keUuZ6V6K7nJQdhruAz1OsXzycGCyqNkrHK5C 3pki27mD1SFdkmf0cImDcHoCwDM9xZzKYaOudRbH+lWsSjWLd9qGAIdGpZcAk/twM6ZN k/j+/Ewkmp1ZGRVAEU6+YPVczUbbHKsbgjfy7gaVYAwHjEElZmn1nRNcuemq5fBncDha LaonXj3530sq4logvyJ8ToEwNY7tNP+M0tgN8RTI1069FAxAXmswc8caGFZwFahPLtEU mozr7oEkwEWN+rVFn1AzyO2kJLaz4xatY0BdgzAnjWE3mkx7NT+FmBn5R9IKGjxQsL/p HtTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AfMIbnGYUFpITSpoQKHfiNr2ERqdtJwbePEC2imwZGY=; b=USs2LQubobqjoa851Xg+i6a+B7SgHU//f7Z54lHRBUPZycraVIkRvwvqUG8eb4qMpR ikzALTkniH8Lfk018W0BDipN67qG/7AbQfp1ChgEqEzW6uTskmvfwBhkNp+T5gIQ87hj GlXv3bOIzMKZi9avEqOsufFMYZaGCeh76FG9UwmkVnvki5YHLtr2XuIl6/z5Skri6lqA NM2kRKu1PnxF9Uk7NYHziJTpz2E5gEZ2tMp8LsfXcOFTdKgZdW5BRYQCGdyQgiNRbQ7q GKrk6/VGDas6hQd4lSCFeDwkisJV/0NgtnvZWeHbUoZ1tYdpqhSfLugeg/WWjs2W+rUT IXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HC8TSVes; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k26si2058264ejz.48.2021.01.15.05.09.39; Fri, 15 Jan 2021 05:10:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HC8TSVes; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732327AbhAOMa5 (ORCPT + 99 others); Fri, 15 Jan 2021 07:30:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:36246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732286AbhAOMaz (ORCPT ); Fri, 15 Jan 2021 07:30:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 610282339D; Fri, 15 Jan 2021 12:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713790; bh=M/Np2hVMHaodeD4WUD77jlADoSgNJFwgu4YWU5+LLWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HC8TSVesoLwTIwdBoLKfx8DnI7Mv0V6z3onbTUXrGXTtdsuudDNmZgB2APcOuRtxy aguVN6YWO9DxXWvaPJQ+nxESCoHoXxC3qTl3V04iJwYFd6rL8t7R+p/mUKwYiA+i5A hO0hZhy/Q12v6roOFNzB1H6qJ+6vS6PAM5AKcSZI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Desnoyers , Christophe Leroy , Segher Boessenkool , Michael Ellerman , Sasha Levin Subject: [PATCH 4.4 07/18] powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at Date: Fri, 15 Jan 2021 13:27:35 +0100 Message-Id: <20210115121955.470805129@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121955.112329537@linuxfoundation.org> References: <20210115121955.112329537@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathieu Desnoyers [ Upstream commit d85be8a49e733dcd23674aa6202870d54bf5600d ] The placeholder for instruction selection should use the second argument's operand, which is %1, not %0. This could generate incorrect assembly code if the memory addressing of operand %0 is a different form from that of operand %1. Also remove the %Un placeholder because having %Un placeholders for two operands which are based on the same local var (ptep) doesn't make much sense. By the way, it doesn't change the current behaviour because "<>" constraint is missing for the associated "=m". [chleroy: revised commit log iaw segher's comments and removed %U0] Fixes: 9bf2b5cdc5fe ("powerpc: Fixes for CONFIG_PTE_64BIT for SMP support") Cc: # v2.6.28+ Signed-off-by: Mathieu Desnoyers Signed-off-by: Christophe Leroy Acked-by: Segher Boessenkool Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/96354bd77977a6a933fe9020da57629007fdb920.1603358942.git.christophe.leroy@csgroup.eu Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/pgtable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h @@ -149,9 +149,9 @@ static inline void __set_pte_at(struct m flush_hash_entry(mm, ptep, addr); #endif __asm__ __volatile__("\ - stw%U0%X0 %2,%0\n\ + stw%X0 %2,%0\n\ eieio\n\ - stw%U0%X0 %L2,%1" + stw%X1 %L2,%1" : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4)) : "r" (pte) : "memory");