Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp137323pxa; Tue, 4 Aug 2020 19:07:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdW19RgfSW2SaOs9aYHYEYbDh/G/fCC8Zh87kjVcaaie6zL09PeUgDr3ibLXlNye+d+TK0 X-Received: by 2002:a17:906:a3d9:: with SMTP id ca25mr1052514ejb.164.1596593243095; Tue, 04 Aug 2020 19:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596593243; cv=none; d=google.com; s=arc-20160816; b=aAf3I94Zfk/cg1GdYTcIal7V/Vuy5P5xrj377JLUzYfBG5f4nG86OeKWK9xEwUrxZo C2vKIDw8jTqXKtFlafdQBn4k6bMf3zCX0G0wJaBX0tf7SK9a3qBWxAkLjq1H/cmZA7JB IpeQu3McVCjQvoAXs9jTZyiN2QMjlBvFspjZsDZ9yUB8U4BRwfi1vrZVghI4cIVklAHE /40vy4d0J9P8IbdDEKG2UlpnSAXZaAQkMmLkDSvhtOy/cJJkWbt6LffPlACYjjjx4zMK I/blsPF64Ic7/HkSMElQSI+U35gAAkkVM5iwYz/cpC7s/h4ql8HxZSUTjNCl2LPdC8i5 kw2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:wdcironportexception:ironport-sdr:ironport-sdr:ironport-sdr :dkim-signature; bh=duPkSxGgTt5OETAKBK/gVmdrEDyY4F/JvJeCaRjadNs=; b=HuJ+1XFi+LgU5Ey0m9LANRRumj0s4OC3rJfG28PHklJoGHJCmeAQWF6FKok15vZn1P x8fLyZdiFXzmqYu7J9Xv3lkBeLJpufZXKFy4krLxg76/gDbpIUK1DgMM9onGVRMzMHUX tBD3r+3jIPrPZizO95aOw6eeY9VMd2MOVEUK+a2fPer/KIIjHNnY6MSsDXTMh+xhLr8B SXM49ZhRsO/bP32EzVLrVYC7V9/GsHMY+TzE1Sdr/skNhyyqTrGNXPZM9qI50KPtFhPx 2WjSnUbre8iwAHt8pCal9RBg9+D/bgRXr11440lRcvKJLZcKI2jKoHQmlaGcn71VS/mV 3XLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=UOzwjeP3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu8si344403ejb.317.2020.08.04.19.07.00; Tue, 04 Aug 2020 19:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=UOzwjeP3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726854AbgHECGn (ORCPT + 99 others); Tue, 4 Aug 2020 22:06:43 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:56510 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgHECGm (ORCPT ); Tue, 4 Aug 2020 22:06:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1596593201; x=1628129201; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version:content-transfer-encoding; bh=mr8pEVR8EM2vtCoJYlVhaVMY23O+8KAaStBjD4hUG9U=; b=UOzwjeP3u11NEHuWvuztHqk1uf2wdN0hFd3uQBm7zqCRh1xTotCmTpOg imuUvnGEClv12uZEDCipCXg1Nflg7VQQsgyfcmOrdp1/vpLRE4PgQVu4m d2RMOwjzAr/rPilI4kfC2uQdYexp+E1Ymh/rgOkp3Pj8NY0JS2J/8ohSx buNH8Xzb9xn1vC+5jVGlXwhwkSOLHsWKawn/L2QsEE0uJYTOlkGPEyBps Tu4Ds8cc3JHlebp8Ygkj2Scbq9+i6SNoPpGNkzuHdxBXt/OZ98mPfNQ+K sVIFbNZI5UeDiUeqbd8JbU3mGq99srXFWcmPYtBhEzh4EzmwjGrsoIpQt w==; IronPort-SDR: 4CiEYIfPGx/er/2fMh7GgBPYbry7z7bJ9UrdZbOpTf+Bg1vBQIt7Pg7ZrCumy8cJwVD8hIADXE V6khl8+rwHIEdz7sOI8Q86ldtpIacEEtP15Z+NgqL8b2tXTYAPb35C9pxggeqlh8N5pvauT0Zb OngvhgJGjfHP9vdT0xnqllilVb4WXsmwFXFICOs6892h3QBz/OvgYt3alSmEdAZmqc/QjjkE1x Cp8GMFlZFdu+Ji9eVfAegA6U6ayigL+qp2pG5m5485syJSBSJ4Bo9097FLKKGAPFplwaqCmkwZ /sw= X-IronPort-AV: E=Sophos;i="5.75,436,1589212800"; d="scan'208";a="253513162" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 05 Aug 2020 10:06:41 +0800 IronPort-SDR: dLsXiV1JFaRo4eYiVkK9KAv6/QaRoRbX8UHYUkmM1N4Yo5O3tX0CdUoRx65QsvAOpBoQZF9PQR hvHqMctAApUw== Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2020 18:54:01 -0700 IronPort-SDR: TLhMEyPXwBjZRTNKUDbkN/wLMnj2ldUs7WjvT7jQGs0HtUMdjyM3RdD9bF/Ed/GwnQyNTpSQEe VPBQWkxZip7g== WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2020 19:06:40 -0700 Date: Wed, 5 Aug 2020 03:06:36 +0100 (BST) From: "Maciej W. Rozycki" To: Florian Fainelli cc: Thomas Bogendoerfer , Jiaxun Yang , linux-mips@linux-mips.org, "open list:BROADCOM BMIPS MIPS ARCHITECTURE" , "open list:BROADCOM BMIPS MIPS ARCHITECTURE" , open list , "Maciej W. Rozycki" Subject: Re: [PATCH] MIPS: BMIPS: Disable pref 30 for buggy CPUs In-Reply-To: Message-ID: References: <20200731042401.22871-1-f.fainelli@gmail.com> <21ad5472-1287-acba-5604-09f2e633c043@flygoat.com> <46de49ec-cc8b-708a-0cdd-82389b041078@gmail.com> <20200803113020.GA8958@alpha.franken.de> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Aug 2020, Florian Fainelli wrote: > >>>> diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c > >>>> index 19308df5f577..df0efea12611 100644 > >>>> --- a/arch/mips/bmips/setup.c > >>>> +++ b/arch/mips/bmips/setup.c > >>>> @@ -110,6 +110,20 @@ static void bcm6368_quirks(void) > >>>>       bcm63xx_fixup_cpu1(); > >>>>   } > >>>>   +static void bmips5000_pref30_quirk(void) > >>>> +{ > >>>> +    __asm__ __volatile__( > >>>> +    "    li    $8, 0x5a455048\n" > >>>> +    "    .word    0x4088b00f\n"    /* mtc0 $8, $22, 15 */ > >>>> +    "    nop; nop; nop\n" > >>>> +    "    .word    0x4008b008\n"    /* mfc0 $8, $22, 8 */ > >>>> +    /* disable "pref 30" on buggy CPUs */ > >>>> +    "    lui    $9, 0x0800\n" > >>>> +    "    or    $8, $9\n" > >>>> +    "    .word    0x4088b008\n"    /* mtc0 $8, $22, 8 */ > >>>> +    : : : "$8", "$9"); > >>>> +} > >>> Hi, > >>> > >>> Is there any toolchain issue blocking read_c0_**** family helpers being > >>> used? > >>> > >>> Use .word looks unreasonable. > >> > >> Yes, the assembler would be choking on the custom $22 selector, however > > > > I guess you meant selector 8 and 15. If BMIPS has a 4 bit selector field > > it might be good to do a binutils patch supporting it. > > Yes, sorry that is what I meant. I don't think an assembler patch makes > sense at this point given this is an isolated use, and there is not just > binutils these days, the Clang/LLVM integrated assembler would also need > to be supported, and then we would need to have the kernel say: I > require this minimum version to support the customer selectors, not > worth the trouble if you ask me. Well, I asked for a GAS patch to add support 4.5 years ago, so by now and 9 binutils releases later it would have become fairly common. And then I also suggested how to handle it in a robust way. Cf. . Maciej