Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp680177pxb; Tue, 5 Apr 2022 18:30:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwg34ojRavL/y1j/9qkBcRCfqq31CO4v78y9uzpXx5mxUYwHNvUYWNZ9vijrG1tlg0ggRP7 X-Received: by 2002:a17:907:da3:b0:6e7:fd56:9137 with SMTP id go35-20020a1709070da300b006e7fd569137mr6039577ejc.503.1649208618647; Tue, 05 Apr 2022 18:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649208618; cv=none; d=google.com; s=arc-20160816; b=CNMTJWeGfBF6N2lW22waqmGS8bFoYC95AdA6SP14lTg7PvrJHFuX4TB/W61yCR4+go uRUJ5NO6VGlfYhmSpo9IB2xOk8AJdkQWCTF1GYu3shz97Evo4tucQNIb2peo3X3eE6ne IcL4CzzJ6UqTJZLkLTbZjQG70/NQC+cK0PwzxcQQP5YgOjTqO7oyJzEu8n8PQuwMNlHH e4hIEWRFbL8e2tc3ADpMqR9oqw88it6rj+az5pfLC/kAUIP16hImysXa4rRI3JmXTp9q EPOpMt0lBkxGLq5/3/qKDKZLJJtKtPEiE+ZVgGHLDMWzfAYhWQ0nhoRRd1aKGShM3HyJ ONyA== 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=Bw8DdJjTSGufjc2f9h68VScC9lZ+W1YBNGCK8VsT+oY=; b=vC2BViUnOZQD5l8BtvwIMF2Gl7T80nw+UxySo7aSXKzGWFZn61KKwr7RwvMyYsyym1 SYLIl2LG7o98Xbmxpi2iYMoUnXlTO2oziYolBfcC1LYVgLjhFlAb6ZfJxi1+5SgF++m/ 34FRQj2MxMcItMA1MBX7zPeGgv7ow8FyF+7lpJ2auPam76DBOa5q1/D3EO2JCB/9t7I7 0HUNz3MCbFyX64VKsD46FbQTxAxbr9+ulKaHFPA9O9q8f3yX/qkkdQuHK8MRzLKD0UvE qp6oe+4JY12i00uh/rMn7fjSykHCL6/RTXMdqeCbrbN1IQG4yCWkvz9gqEZsrwSnbI9r VRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hvh3vdij; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a170906641100b006e09345838csi9217499ejm.743.2022.04.05.18.29.53; Tue, 05 Apr 2022 18:30:18 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=hvh3vdij; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233248AbiDEH5B (ORCPT + 99 others); Tue, 5 Apr 2022 03:57:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233616AbiDEHsM (ORCPT ); Tue, 5 Apr 2022 03:48:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01956BB; Tue, 5 Apr 2022 00:46:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 919FC616BF; Tue, 5 Apr 2022 07:46:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 967BBC340EE; Tue, 5 Apr 2022 07:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649144774; bh=CRkojIeG8hfsFSBTHg4oYYawOOdZgescy1u4wNygcPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hvh3vdij0ASwQpbR5uMz2JS/nVhbTOXYfVbz64Qo3bbWncwqLVLY8XHtVmCPM017J HnU5tB20iZraw3D6psIRB0Recn7f2dTzjsi7nccB7N+Vkp7DxEXGOIPfi/+hThxMPH ulT1vH+HWQhqj6/PZrTy2sqNxUHK5wXXNFHm2mZU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan-Benedict Glaw , Sudip Mukherjee , "Maciej W. Rozycki" , Thomas Bogendoerfer Subject: [PATCH 5.17 0166/1126] DEC: Limit PMAX memory probing to R3k systems Date: Tue, 5 Apr 2022 09:15:13 +0200 Message-Id: <20220405070412.470033081@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Maciej W. Rozycki commit 244eae91a94c6dab82b3232967d10eeb9dfa21c6 upstream. Recent tightening of the opcode table in binutils so as to consistently disallow the assembly or disassembly of CP0 instructions not supported by the processor architecture chosen has caused a regression like below: arch/mips/dec/prom/locore.S: Assembler messages: arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this processor: r4600 (mips3) `rfe' in a piece of code used to probe for memory with PMAX DECstation models, which have non-REX firmware. Those computers always have an R2000 CPU and consequently the exception handler used in memory probing uses the RFE instruction, which those processors use. While adding 64-bit support this code was correctly excluded for 64-bit configurations, however it should have also been excluded for irrelevant 32-bit configurations. Do this now then, and only enable PMAX memory probing for R3k systems. Reported-by: Jan-Benedict Glaw Reported-by: Sudip Mukherjee Signed-off-by: Maciej W. Rozycki Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org # v2.6.12+ Signed-off-by: Thomas Bogendoerfer Signed-off-by: Greg Kroah-Hartman --- arch/mips/dec/prom/Makefile | 2 +- arch/mips/include/asm/dec/prom.h | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) --- a/arch/mips/dec/prom/Makefile +++ b/arch/mips/dec/prom/Makefile @@ -6,4 +6,4 @@ lib-y += init.o memory.o cmdline.o identify.o console.o -lib-$(CONFIG_32BIT) += locore.o +lib-$(CONFIG_CPU_R3000) += locore.o --- a/arch/mips/include/asm/dec/prom.h +++ b/arch/mips/include/asm/dec/prom.h @@ -43,16 +43,11 @@ */ #define REX_PROM_MAGIC 0x30464354 -#ifdef CONFIG_64BIT - -#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */ - -#else /* !CONFIG_64BIT */ - -#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC) - -#endif /* !CONFIG_64BIT */ - +/* KN04 and KN05 are REX PROMs, so only do the check for R3k systems. */ +static inline bool prom_is_rex(u32 magic) +{ + return !IS_ENABLED(CONFIG_CPU_R3000) || magic == REX_PROM_MAGIC; +} /* * 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and