Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp760153pxb; Tue, 5 Apr 2022 22:07:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+jHXe70itRC/7MHXT3n90uWf7I90R7Vau1OIqApY505TWbzShpLc5lA731wvnCHbpC4tc X-Received: by 2002:a05:6a00:2908:b0:4fa:9297:f631 with SMTP id cg8-20020a056a00290800b004fa9297f631mr7145753pfb.3.1649221656668; Tue, 05 Apr 2022 22:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649221656; cv=none; d=google.com; s=arc-20160816; b=aHSf/hTd0j01mEsaOIYOXxT9yNRWfpDgJOLiqXENromjxenEvpBkU/pABnhSYyLwCd 46ONAk9lNYX3PDT3tulmTMnNm7Ey/O/4qOWzm8x3a2Pc269ZWLjIdy84oWSTNQ5a5qaX EaJ2f8o/sq7mVCT7+ESvsHq5OFgZRiXk4OT9uHUj5JlUVnK/kwh99FHSCi3RMUe1jvQP EwO4ki8ORvNWtTaK3pSzmNUnTrG9le20etEBoNoavaN2mqpQ9rkVJJwqUyuhbR2tGqpU o6Pj/BL+WaS0HLbPTGd1mYXiJLlJngibIcvuOh/bI6YGFq0PgN+peREIOhXmAkPhxAB2 WK9w== 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=IHHwCmrYlpXfuuscSx4wbcTzQMu/qeXWynuMHSyqrJOcYADNeokiMLqB7vV2wQPKpJ AK5kENfbICE82/QwyPuWe77dJpq/sFRINtlv9E+ZZTJOetzFB9rZVJ/ZA56Dmenbf4mz LQSY+mNgNWYL19eLglmxIGhIef4thSQXvxg0qi9AcfoB5vISlPalcphcv0+gQkdVA6tE 4FkiHq+ovbhFtnux69gfVk+TBpGH4MzdT/zX2hdVtCHJ/C+yrzJAZbQ6nk7ys1VWjfE+ MPaCg7FbTR00u0xRovFJOBzd37ttVfPSHQR7H7e7MQXCC33Pdv8Rr3MXgIkuYghwVLbm EbaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZFYRkzt3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id pf6-20020a17090b1d8600b001bf8643b853si4369052pjb.147.2022.04.05.22.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:07:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZFYRkzt3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C68793E4C3E; Tue, 5 Apr 2022 20:31:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389184AbiDEOnq (ORCPT + 99 others); Tue, 5 Apr 2022 10:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244222AbiDEJlK (ORCPT ); Tue, 5 Apr 2022 05:41:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43005BB08B; Tue, 5 Apr 2022 02:25:45 -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 D24CD6165C; Tue, 5 Apr 2022 09:25:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E43CCC385A2; Tue, 5 Apr 2022 09:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150744; bh=CRkojIeG8hfsFSBTHg4oYYawOOdZgescy1u4wNygcPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZFYRkzt3EKn2b5kC4UZmdNi8fHMtPNTTF9o9vfvwlpnMzKQyzpTUczV4F3q3OFnD8 P3DSx8VK5npKnu8nE4CiU8zM7urQHJ3tfNS3enP7RfXfa8tfJxKtKv3tE9sstAYDp5 6pp8iDkIpGOvxxh4oOSNzcMFS8s5OReBsX/GFXu4= 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.15 163/913] DEC: Limit PMAX memory probing to R3k systems Date: Tue, 5 Apr 2022 09:20:25 +0200 Message-Id: <20220405070344.731019792@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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