Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1215136lqa; Mon, 29 Apr 2024 01:26:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyQRZsU5LOw8Ygg27z5L58f+vhQ6v27Hzmaho5f90cifDYw/+9QlfsF8S49t8ug4djTUKTPPl9TP4c4va0xnKoHT16pVaV5zpagBYkxA== X-Google-Smtp-Source: AGHT+IEWRNWHDB0HKKahOQzgCcatnc1CsNjtLsAhP1TkHD2eWc8GCzIpFC++p/7ZnZrDLa2lrF6U X-Received: by 2002:a17:90b:4b0f:b0:2b0:e81e:8cb2 with SMTP id lx15-20020a17090b4b0f00b002b0e81e8cb2mr4803180pjb.13.1714379190947; Mon, 29 Apr 2024 01:26:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714379190; cv=pass; d=google.com; s=arc-20160816; b=JZUh+9omd9jlynZWwaPdDzLQAKJGT7RKviht84ekAQqkJzw29oGppIcHyjZczqvOLi V98SdGoidLx3lbEWUyUSW9qq4fZazhKeolffIbi2slao4dJ8xz3PFT1YViPa3ecZ5Dgm YaPO7OP7rBJS7WpbPcF8cHF/dh2qPmwuj1+N+v0gyCGrmwzleVNiQ5I6TdvxAwE/dvKC ukaaZepDn27UCRfuvZayVTt6V7OTHkiHufQr7viaZCAZZxvhpdxrHiuy/emBfnP7kzUR tMxL+YSU+g7nkDw8eL/Kf/zMC5M++su95YUrvhNNyLFuNrlafDUMq4xLxh5xEQb3sLMN 12Ig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=JgDt5XbywEqzC3JGGC/c9zGpBDESUKHUbAKs+4f5GLw=; fh=b14ldiMUy8k8EXcWHKmixht3wjIsnz99a6pT987XVUU=; b=IN+2r5FO8YkPCaLolwRqRHps0IrbLsHGlDE4NOCkwG+oBfJhY+26BNqDYeRLMuHOq5 7mqCdYrtUoOiSxZyS1mzwBPV9urcyHtLDYERYjuMpLkhkQoKrxi7HN6mUwHbfHhU1wNB x3f/8NtbAnx96hr58ktGUUWBB/XhWEUMaj/VnD2h2oErlrp4zAJt8VdoWf2fgF2gxNVZ NoDavDdA/OU6kO7AdpMZS9lMskj8gyaPNBeshsd5IRH9Twv9/meZvf6DcQw0hjV/OvL3 fIiwffKcmYb06DM0WSTuuvz/369yIzLcsmvmh1ua7dPkTocRcPVmahUFg8Fq9EpPZf4U kAcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-161905-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161905-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id nv3-20020a17090b1b4300b002b143417621si2542648pjb.108.2024.04.29.01.26.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 01:26:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161905-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-161905-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161905-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6002F280F8A for ; Mon, 29 Apr 2024 08:26:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A211F1758C; Mon, 29 Apr 2024 08:26:24 +0000 (UTC) Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADEE0171B0; Mon, 29 Apr 2024 08:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.175.24.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714379184; cv=none; b=MNTpLy4TqVbd97nIzh19MY8Z8sUCHShJ38GSCpdVH8D+3p3usPv8DhwpRXGboGkpZMAHJFYloRImWPjhCyeZMq0lWYBn3GOyOEJqTuih6RKKz1pdZOzO23GpoC6YxxBEClaAkzv/h7op46Uo1dXD3+cpS+2hEyAjkvqEI6Z2k7I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714379184; c=relaxed/simple; bh=fG/3DgD9qg8PAoCTBqPrTfIB8CcOOZ4f1uEoJ+ssisM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tGQLkqTP6PunrqnwlZ0D/lwxddKWLu3EdwXfo7pBdOsS3o4FqGWGuBkF7CCORtO9HVILbleqfEOx3l6GQ+wed0CZjI/Eo+TuvGOGB0myDlJgrc5uycJ0Efow/H8UYOPahcvsjn1vIhG2TTg0MipsWoTIhSlmQR3mH9ItSl3LsE8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de; spf=pass smtp.mailfrom=alpha.franken.de; arc=none smtp.client-ip=193.175.24.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1s1MGC-0000Bf-00; Mon, 29 Apr 2024 10:21:16 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 33BE6C0135; Mon, 29 Apr 2024 10:18:57 +0200 (CEST) Date: Mon, 29 Apr 2024 10:18:57 +0200 From: Thomas Bogendoerfer To: Siarhei Volkau Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: Re: [PATCH] MIPS: Take in account load hazards for HI/LO restoring Message-ID: References: <20231012162027.3411684-1-lis8215@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231012162027.3411684-1-lis8215@gmail.com> On Thu, Oct 12, 2023 at 07:20:27PM +0300, Siarhei Volkau wrote: > MIPS CPUs usually have 1 to 4 cycles load hazards, thus doing load > and right after move to HI/LO will usually stall the pipeline for > significant amount of time. Let's take it into account and separate > loads and mthi/lo in instruction sequence. > > The patch uses t6 and t7 registers as temporaries in addition to t8. > > The patch tries to deal with SmartMIPS, but I know little about and > haven't tested it. > > Signed-off-by: Siarhei Volkau > --- > arch/mips/include/asm/stackframe.h | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > > diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h > index a8705aef47e1..3821d91b00fd 100644 > --- a/arch/mips/include/asm/stackframe.h > +++ b/arch/mips/include/asm/stackframe.h > @@ -308,17 +308,11 @@ > jal octeon_mult_restore > #endif > #ifdef CONFIG_CPU_HAS_SMARTMIPS > - LONG_L $24, PT_ACX(sp) > - mtlhx $24 > - LONG_L $24, PT_HI(sp) > - mtlhx $24 > - LONG_L $24, PT_LO(sp) > - mtlhx $24 > -#elif !defined(CONFIG_CPU_MIPSR6) > + LONG_L $14, PT_ACX(sp) > +#endif > +#if defined(CONFIG_CPU_HAS_SMARTMIPS) || !defined(CONFIG_CPU_MIPSR6) isn't that just #ifndef CONFIG_CPU_MIPSR6 ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]