Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19007764rwd; Wed, 28 Jun 2023 03:55:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uuHXwE9QR/UgO9cREbZELCCAbytPexvpt4ULmgpbNREdVnUwqoEsAJlc6XkgK5bsD8wx0 X-Received: by 2002:a17:90a:1ca:b0:262:c4c2:e29d with SMTP id 10-20020a17090a01ca00b00262c4c2e29dmr1097272pjd.24.1687949740460; Wed, 28 Jun 2023 03:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687949740; cv=none; d=google.com; s=arc-20160816; b=OxWNYN8F35uWKHNSrendql/ACmOSmrTbGYe61i3+z4D6+Ot06b5Jj70o0/NbKrwkX+ cVisTSPw8dfQKfAyxvwoekZNmos7hV4bXE2CglCeaNOg4KYHMLBwEhRtzCMLV7WijEn1 /yuxO21ltOa/jTASS8WqOZJ5lDhcjpJ26AxW9Fw04PnTF16ssKVjJXqE/TFkbAjEV3Gm k4V8M7jBpVyOhmQLe/4fSGjzg6kA5Y8i7Nda/IzS5TLLD5cRiPA9+eK0hj0d8sBveNDC x7Q0TQ4FWDZfIcHjbHSeUNYDm5yKoQ2OinsH2JVDtrsCUXG3rtM0D4GcEiLecl5AjO5+ tljA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=2p0QQcubcQsgjPpv5HR/EPiYpUQPx6/Fp1Kt09GI+dA=; fh=kzkYYxBR+87f1KmasYRnTAbdH1RvwdZjUYrNoEzX9ok=; b=Ae47TXciRzI+WMcaAUaQV9HXeZgXzg7WrnDXSZog1yNYHCcsrak8MO+8mZ3p+ZFXUe /TgkyiutLQo036ZGruNbcyCWislL1Y9rpmRD26TFlS0xeavbfbKAfuw/ftCjLNT7lCNg nYwdi1Y/cAXOZsEr8JiHbG+X0F5t3kDe9CxAJOUdDWTCbdbQaMIlTyEnCIdlKTo1s3DF 0Dycaj+UfgQpt3a7f69gZ+lAY7UJe58HJ3lZ4tK2TrSRs/HUTxNlEkH0XPxLijNk3nFP 3LEqVDs6QVbSEJ+OuxLEgzNOaH6xI3od5JIYoPbDsViJbgrHR+wHDLSZAsOPsCLN83QG sdtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=he8v0OYn; 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oc16-20020a17090b1c1000b0025ec34c3688si12310153pjb.34.2023.06.28.03.55.29; Wed, 28 Jun 2023 03:55:40 -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=@xry111.site header.s=default header.b=he8v0OYn; 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231630AbjF1Kmg (ORCPT + 99 others); Wed, 28 Jun 2023 06:42:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231954AbjF1Kka (ORCPT ); Wed, 28 Jun 2023 06:40:30 -0400 Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E680FE2 for ; Wed, 28 Jun 2023 03:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1687948824; bh=j1QlM126j6MA+r/+OaAKCCpzmed3Q7diNaQnwFqIZ8U=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=he8v0OYnFOPwL55tjufGR98tmw8tQQXPIdHEIUgxkSsv3f7JngrXzV1aU+i1bsw2J iFw/W/hTQzIIJQwMxFXpuNk9D22uydpV2stSa1vQUA2L+oMLFWkCKDo25UoMgrjiLz hh5nGrEcl5FwV7L/20/wRImVTklBVOpe9UIkxR9g= Received: from [192.168.124.11] (unknown [113.140.11.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id D86A165C20; Wed, 28 Jun 2023 06:40:21 -0400 (EDT) Message-ID: <74a06e8e7d0bab88892321dbdb891762487b6f6b.camel@xry111.site> Subject: Re: [PATCH v15 27/30] LoongArch: KVM: Implement vcpu world switch From: Xi Ruoyao To: WANG Xuerui , bibo mao , zhaotianrui , Jinyang He , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , Huacai Chen , Greg Kroah-Hartman , loongarch@lists.linux.dev, Jens Axboe , Mark Brown , Alex Deucher , Oliver Upton , tangyouling@loongson.cn Date: Wed, 28 Jun 2023 18:40:20 +0800 In-Reply-To: References: <20230626084752.1138621-1-zhaotianrui@loongson.cn> <20230626084752.1138621-28-zhaotianrui@loongson.cn> <7017277c-3721-b417-5215-491efae7c8a9@loongson.cn> <30261345-45de-8511-e285-fe16ee408ba1@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.3 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, 2023-06-28 at 18:22 +0800, WANG Xuerui wrote: > > is "ori t0, zero, CSR_PRMD_PIE" hard to understand? It is basic > > arithmetic instr and easy to understand also. To be frank I do not > > see the advantage of using li.w, also there is no document that > > pseudo-instruction should be used with high priority. > It depends on the reader. Sure the semantics are the same, but with "ori= =20 > xx, zero, xx" someone's always going to wonder "why do 'x =3D 0 |=20 > something' when you can simply li.w", because even if it's easy to=20 > understand it's still an extra level of indirection. >=20 > And I've given the historical and general software engineering=20 > perspective too; it's not something set in stone, but I'd expect general= =20 > software development best practices and minimizing any *possible* reader= =20 > confusion to be acceptable. The pseudo *should* be the high priority in general. If we don't consider the pseudos high priority, people will start to load immediates with "their own way", like writing "addi.w $t0, $zero, 42" or even "xori $t0, $zero, 42" for "42". These may puzzle the uarch, causing a performance worse than "ori $t0, $zero, 42". So the only rationale things are either: 1. Telling people always use pseudos if possible. or 2. Telling people "remember to use ori for loading small immediates, not other instructions". 1 is obviously easier. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University