From patchwork Sun Dec 29 17:17:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 11312273 X-Patchwork-Delegate: paulburton@kernel.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5225930 for ; Sun, 29 Dec 2019 17:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9488F222C2 for ; Sun, 29 Dec 2019 17:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640596; bh=FoAkvQ84Aqr7ov3qxU+UYFel2j4aZ8kOa2zDHZChO/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=g1BLpuIBcm9X413vhTAEc6r1VWa1XEHUWcikoYqMFYpRA9shcgR+JLSN8Jq0oBGUb rgBws4X3+MtAF2khwsJMqNWpXI6wHl+X+gKKh+6whJm06sD2JLJe0kZGNgXFBHXejr 1+FIQ09B57U/+UzMlfvbNwOUe7Uom6k9Yx1E0vlo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728899AbfL2R3z (ORCPT ); Sun, 29 Dec 2019 12:29:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:55070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728892AbfL2R3y (ORCPT ); Sun, 29 Dec 2019 12:29:54 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0B37220722; Sun, 29 Dec 2019 17:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640593; bh=FoAkvQ84Aqr7ov3qxU+UYFel2j4aZ8kOa2zDHZChO/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xITgH2RjjCPOHwbVSaYDgQlyhUREQ/FNu1CoD1KMYO8I2Tb3jpbi636fnlilXV1RL YioMeZTgwPkgGd7luyL3F7yx/WLQDvYzhRPZwVOyzivqB1z13peBgVuW1TqoP37Dp8 MEVZIgLm7J54fGBm8gfxYqaUOITOnwDhx0hMgGCo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , linux-mips@vger.kernel.org, Huacai Chen , Jiaxun Yang , Sasha Levin Subject: [PATCH 4.19 060/219] MIPS: syscall: Emit Loongson3 sync workarounds within asm Date: Sun, 29 Dec 2019 18:17:42 +0100 Message-Id: <20191229162515.892321194@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Paul Burton [ Upstream commit e84957e6ae043bb83ad6ae7e949a1ce97b6bbfef ] Generate the sync instructions required to workaround Loongson3 LL/SC errata within inline asm blocks, which feels a little safer than doing it from C where strictly speaking the compiler would be well within its rights to insert a memory access between the separate asm statements we previously had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Huacai Chen Cc: Jiaxun Yang Cc: linux-kernel@vger.kernel.org Signed-off-by: Sasha Levin --- arch/mips/kernel/syscall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 69c17b549fd3..10990434bf94 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -135,6 +136,7 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new) " .set "MIPS_ISA_ARCH_LEVEL" \n" " li %[err], 0 \n" "1: \n" + " " __SYNC(full, loongson3_war) " \n" user_ll("%[old]", "(%[addr])") " move %[tmp], %[new] \n" "2: \n"