From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C857347A6B; Mon, 1 Apr 2024 17:00:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711990856; cv=none; b=LQ4K5Wz0NsaXhGMV+TD13C8Z8JNKt/7+M7WDcbrOTyILhFgqB1ANIepXOT5f1BEBTdFzwFZn8H3440BL7MJde7NA1eWFlGehGKBXlPR4MAJ2Sz/awYqNq4uXquiStAjO+WiT65ggyb6z/vYDB+q9QXPF2ND4ocsM0K7XZDE6gkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711990856; c=relaxed/simple; bh=Ux594vPgpac524bAHtE2607NuX0GdXiz/iaTpImU8I4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pQas6KzxtNBNi0wTTFrJSMQOiMBcRfNDDLwjsgj4GIoIBgpGcpwSZHUjBnfHPOqiGIHt8hYbcMqTGjT9YDegGqSkl0dLEoLs5Au0IXFNEQa+G8oDK6V+VEQLLTT47nQEfrGMGX+hZYointja96G9gHHg1k9h/IdXJ1TYwX9fTiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Kw/+1zPs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Kw/+1zPs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FFD5C433F1; Mon, 1 Apr 2024 17:00:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711990856; bh=Ux594vPgpac524bAHtE2607NuX0GdXiz/iaTpImU8I4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kw/+1zPs5bS2rkqQsLKQ2SW7srJBnv6NK3o3LodhkHbTFmgJ+iEzeo09aMVinj+/a UldcW9PaB+gVzVH5LjKrm33cAcSQQRtukWCQ1FfM7sGzOEtEDo70el43B5AhoX5wXj aYx25MgimZsG+3XkEXutcSn/8Z7W17y3Fng5yeE4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jan-Benedict Glaw , Michael Ellerman , Sasha Levin Subject: [PATCH 6.1 058/272] powerpc/fsl: Fix mfpmr build errors with newer binutils Date: Mon, 1 Apr 2024 17:44:08 +0200 Message-ID: <20240401152532.365543401@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152530.237785232@linuxfoundation.org> References: <20240401152530.237785232@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Ellerman [ Upstream commit 5f491356b7149564ab22323ccce79c8d595bfd0c ] Binutils 2.38 complains about the use of mfpmr when building ppc6xx_defconfig: CC arch/powerpc/kernel/pmc.o {standard input}: Assembler messages: {standard input}:45: Error: unrecognized opcode: `mfpmr' {standard input}:56: Error: unrecognized opcode: `mtpmr' This is because by default the kernel is built with -mcpu=powerpc, and the mt/mfpmr instructions are not defined. It can be avoided by enabling CONFIG_E300C3_CPU, but just adding that to the defconfig will leave open the possibility of randconfig failures. So add machine directives around the mt/mfpmr instructions to tell binutils how to assemble them. Cc: stable@vger.kernel.org Reported-by: Jan-Benedict Glaw Signed-off-by: Michael Ellerman Link: https://msgid.link/20240229122521.762431-3-mpe@ellerman.id.au Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/reg_fsl_emb.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/reg_fsl_emb.h b/arch/powerpc/include/asm/reg_fsl_emb.h index a21f529c43d96..8359c06d92d9f 100644 --- a/arch/powerpc/include/asm/reg_fsl_emb.h +++ b/arch/powerpc/include/asm/reg_fsl_emb.h @@ -12,9 +12,16 @@ #ifndef __ASSEMBLY__ /* Performance Monitor Registers */ #define mfpmr(rn) ({unsigned int rval; \ - asm volatile("mfpmr %0," __stringify(rn) \ + asm volatile(".machine push; " \ + ".machine e300; " \ + "mfpmr %0," __stringify(rn) ";" \ + ".machine pop; " \ : "=r" (rval)); rval;}) -#define mtpmr(rn, v) asm volatile("mtpmr " __stringify(rn) ",%0" : : "r" (v)) +#define mtpmr(rn, v) asm volatile(".machine push; " \ + ".machine e300; " \ + "mtpmr " __stringify(rn) ",%0; " \ + ".machine pop; " \ + : : "r" (v)) #endif /* __ASSEMBLY__ */ /* Freescale Book E Performance Monitor APU Registers */ -- 2.43.0