X-Received: by 2002:a17:902:e289:b0:14f:ffd3:29bc with SMTP id o9-20020a170902e28900b0014fffd329bcmr122975plc.35.1645628215513; Wed, 23 Feb 2022 06:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645628215; cv=none; d=google.com; s=arc-20160816; b=VPwAfF4GnwKFSXeANDUtyrAA9uRZWgXFGjlt66/P7wVEQGzbnE+vIZqgcxsmz+QrXz i8TXlAIXtPmIdHaaIEW6KRwp1BZjZLmo/fqtY/AixXFfMlrdv0aE06qH0EfK8YgBwPE+ okcIBcxSsVdJZxjlxbybJVkVP0GaUq0KknZD3qTpXt/XXC13sgJLsn/JtPmwjW8Xn0kk ZkmK0kwc+mZALA4iiCKgge0sOhDG1HswcZnCN0IhLXW5RgwynNDJhPBczgkQdd/jtQPV bQ459FpL5XanOywzdC3/u9G9OMH+/kQ5Ya9u8IyVd7wlP/Ra88aVbmBqp1PKdAOh2S00 Bj3A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aHyzMFtQe0EUOGyo5aNMOVUBLvuCyxjF47uhkzb6m4c=; b=hA0LflI4/x7mvmAnAsg118e8eQvp+TrUKwb7o/Vi36ztl33JHsZa5X53Tq6OM/7cEY 6WHKib0r9wC7/fd9PZwKPV+r+Tef/kHiz1zDRLRrVyQVo5d3B80FfPPUpvAeep1qnIhe zwtPYup3T3e9MM3usBAzz1CUMEHKHxeOcfz0XO13lWEGzzS/EPSRobe9X2U4kcid3s2i ihO9tQvctczG6buLjLKPb1QJuVVNxHEHXR8RfbjYvWn/667h/iQZ0bmc4AOi0IetntCB +eQ1uwXs+5hQcatHIv8S5hQ269HVrcdoH1rFG7GjfOdtQC2jS9gcI3gB4BJbprxim3iH 85iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kErSueoT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 73si16464847pge.816.2022.02.23.06.56.38; Wed, 23 Feb 2022 06:56:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kErSueoT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241274AbiBWN7W (ORCPT + 99 others); Wed, 23 Feb 2022 08:59:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241260AbiBWN7P (ORCPT ); Wed, 23 Feb 2022 08:59:15 -0500 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB3799ED9 for ; Wed, 23 Feb 2022 05:58:47 -0800 (PST) Received: by mail-lj1-x232.google.com with SMTP id v28so17329713ljv.9 for ; Wed, 23 Feb 2022 05:58:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aHyzMFtQe0EUOGyo5aNMOVUBLvuCyxjF47uhkzb6m4c=; b=kErSueoTeHbWeWky89XlisWfN7RXR5Bflcws8Duv1Byb1Kjh6SF4QfOqyyH08ANsvr YCBvyKZjsm46rLQCoeD5JVy+tQiKQRI+WhZ4MZP6JubaTFlr24WPJHfFvjKfMFiv7n64 /J+uOha29mNmckK7Skdqrj9iZ9ShzeHKZ+TEdPTJykePyCGNzgsCqXHq36TLn6MlMCmz pEogmT6UzYgfoCF1MgWeFvfNElXy0hAnBm+zOZ+C4sZ79i1L6ukdUe5xmf2b+0/OCBnr XXur+Bz41evUrrlQ8GLP01gv320vzdqUu3DMs6qv+PHpFSasxuk1NYXaot5vBdBdtShd 1jdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aHyzMFtQe0EUOGyo5aNMOVUBLvuCyxjF47uhkzb6m4c=; b=5X5/zGvaW/ff6Suni0mbR5ODxx/dhhvcwazBFza39ZqL8GxPMyFIQHmXpMRcMTlzmu xGgDKDGiYMRBUyKEuKk7Hu3Oq35+fsTOEmyksnCdOnMfuIPQajqeyfhTgYLguaM1eA9Q +FBLYpVwyJ6w7aYenrFZgud+IYa8LN0k7OiOm7eQw5RMv6R9tZrODPPgURXBJZNxJK9x 3YTtK85LOtdyrKWpEuAX6QbzpfQOPFEQaybHp8v7ITr2yPrYXN8Err4epNowrXr5951A KKJatQJCVLT/WYT5AeElGtS9pHha6wTFlRp6bzIVvCRnD2902E4YiFiLW3SKnhkG3XrT lZ+g== X-Gm-Message-State: AOAM533LxtbHVhKp+yRtBkEJHfyzFIJLvpQucVSl75KlKvRUdUz33Lav ezPZAPDmZPw5dRi6zVow4TjLSqyveGtzCA== X-Received: by 2002:a05:651c:307:b0:244:dc4c:c2f2 with SMTP id a7-20020a05651c030700b00244dc4cc2f2mr20026151ljp.531.1645624725984; Wed, 23 Feb 2022 05:58:45 -0800 (PST) Received: from localhost (c-9b28e555.07-21-73746f28.bbcust.telenor.se. [85.229.40.155]) by smtp.gmail.com with ESMTPSA id v29sm2099448ljv.72.2022.02.23.05.58.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 05:58:45 -0800 (PST) From: Anders Roxell To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Anders Roxell , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 3/3] powerpc: lib: sstep: fix build errors Date: Wed, 23 Feb 2022 14:58:20 +0100 Message-Id: <20220223135820.2252470-3-anders.roxell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220223135820.2252470-1-anders.roxell@linaro.org> References: <20220223135820.2252470-1-anders.roxell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building tinyconfig with gcc (Debian 11.2.0-16) and assembler (Debian 2.37.90.20220207) the following build error shows up: {standard input}: Assembler messages: {standard input}:10576: Error: unrecognized opcode: `stbcx.' {standard input}:10680: Error: unrecognized opcode: `lharx' {standard input}:10694: Error: unrecognized opcode: `lbarx' Rework to add assembler directives [1] around the instruction. The problem with this might be that we can trick a power6 into single-stepping through an stbcx. for instance, and it will execute that in kernel mode. [1] https://sourceware.org/binutils/docs/as/PowerPC_002dPseudo.html#PowerPC_002dPseudo Cc: Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Anders Roxell --- arch/powerpc/lib/sstep.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index d2d29243fa6d..b9f43bbdd55a 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1097,7 +1097,10 @@ NOKPROBE_SYMBOL(emulate_dcbz); #define __put_user_asmx(x, addr, err, op, cr) \ __asm__ __volatile__( \ + ".machine \"push\"\n" \ + ".machine \"power8\"\n" \ "1: " op " %2,0,%3\n" \ + ".machine \"pop\"\n" \ " mfcr %1\n" \ "2:\n" \ ".section .fixup,\"ax\"\n" \ @@ -1110,7 +1113,10 @@ NOKPROBE_SYMBOL(emulate_dcbz); #define __get_user_asmx(x, addr, err, op) \ __asm__ __volatile__( \ + ".machine \"push\"\n" \ + ".machine \"power8\"\n" \ "1: "op" %1,0,%2\n" \ + ".machine \"pop\"\n" \ "2:\n" \ ".section .fixup,\"ax\"\n" \ "3: li %0,%3\n" \ -- 2.34.1