Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7140179rwr; Wed, 10 May 2023 04:36:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6hxqR3/vMFdHEhRYw5VMuyaPYI027kHxWu07dkVpKLSXzHuceq5zM0hUBCaAl8GaXmHFoK X-Received: by 2002:a05:6a00:1492:b0:643:53b6:d841 with SMTP id v18-20020a056a00149200b0064353b6d841mr25416362pfu.2.1683718580831; Wed, 10 May 2023 04:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683718580; cv=none; d=google.com; s=arc-20160816; b=bnBGra8sIH8ZD+Kg2rE5x/UHnV/xKGAH4jdLCVAu7qR1aLRW/ixtb7TdtMcYY1es4g +QZfvQyzWSMh/zmszfKpCuOCUOgIieiZJlI847o42iXivdN1g2mb2feBbxxJSFVaHk9m PeoIjbq7Fr4yJy5wkAwfaVAcm3GHX/pPsJK+02AMw6vuAszkp3jWHoYwpQi+AKMv/iI2 25CabCaj5zmJHyg2uwJ+PcSQ37vRZON+RVBXFmh299HrLwr64pO6invhLnjCvP+isYbY BeKv6MCbgJsFM4xDmnFn2Fk3rnoZX9niNNmIMlpPkDq3VBZqqxggLWebAiYaCD19SCTU 7lJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QbzoChfNbmTPAWVYTeVTH2VekWVcJSNCB9AwQAbgzcA=; b=WmWPe5NaBY2cVz7KdfVOI2fjgnzY2u9OA2LASoQ/lSoQLyjTJ8dT7k+kPfRIhpd7t2 yy87x+/Gx3cJ4lSvdO6AtfY9L91hkdwGA8Rn2mAeQIPogVRRwndH7Z+iCgnz97ZxkVWQ W1djKGfs3hRHcZSLf2vblJiiPqLTxU8mbmy0vtdRKqQsFZLnsAZuufxYIea93oEXPPjB eFBwlx0Qk0Di2mhIZ5fVFYdVCF7l4yXnWe+W2XfkG/K90txY0A5Id8tX+JeQSFRNYrw6 iSugmWLRSZDfrOqPdZiEhYG2ulJg+Eg2ESJ0xexyC7Bg7p8DcRlnamGaCEzpG66xkyfi Zk7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FgxufkvO; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a620504000000b00646672f2be3si4603542pff.282.2023.05.10.04.36.07; Wed, 10 May 2023 04:36:20 -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=@infradead.org header.s=casper.20170209 header.b=FgxufkvO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236673AbjEJLXh (ORCPT + 99 others); Wed, 10 May 2023 07:23:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235731AbjEJLXg (ORCPT ); Wed, 10 May 2023 07:23:36 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C8C910D; Wed, 10 May 2023 04:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QbzoChfNbmTPAWVYTeVTH2VekWVcJSNCB9AwQAbgzcA=; b=FgxufkvO0GetjfD6zrhAGQ8OT1 KOYVMDTYuYoeCc25K0fCN/t0UcEn1LE+dP93KXRPDRmwXVOd7HkbsIl9LZMFh6tGqRC+M0c5o6Lw5 Jg15V5qs4F5hDFKQQ6zjgFFaF95r2zGNUEdtI7nGL6FVy9PiYWJs1RsPA/KISDiikM2zXwiE2R10m s2OUSWm03W7jstFisa0+5qRKuuVzDtHnyw+PI2aXHVUeM5JOtztCZ9K6qQuyNQXw7rA/Zqb0Fgo6J cGvdFpYGpdTUriawNxVFJCxDK2dzEHWiYhMIT34iWbhVkgJPdgu4piKQxzQ/kSDaWENkeZ/dyxNwG C5CuKsbw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pwhuc-00GDJC-Pd; Wed, 10 May 2023 11:23:14 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9ECCD300023; Wed, 10 May 2023 13:23:11 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 65E3720B04BA9; Wed, 10 May 2023 13:23:11 +0200 (CEST) Date: Wed, 10 May 2023 13:23:11 +0200 From: Peter Zijlstra To: WANG Xuerui Cc: Youling Tang , Huacai Chen , Jonathan Corbet , Josh Poimboeuf , Jason Baron , Zhangjin Wu , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev Subject: Re: [PATCH v2] LoongArch: Add jump-label implementation Message-ID: <20230510112311.GA2176161@hirez.programming.kicks-ass.net> References: <1683710206-23905-1-git-send-email-tangyouling@loongson.cn> <20230510092723.GK4253@hirez.programming.kicks-ass.net> <15594820-0a95-94bb-132f-5008d31c041f@xen0n.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15594820-0a95-94bb-132f-5008d31c041f@xen0n.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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, May 10, 2023 at 05:34:33PM +0800, WANG Xuerui wrote: > Hi Peter, > > My 2 cents: > > On 2023/5/10 17:27, Peter Zijlstra wrote: > > On Wed, May 10, 2023 at 05:16:46PM +0800, Youling Tang wrote: > > > Add jump-label implementation based on the ARM64 version. > > > > > > Signed-off-by: Youling Tang > > > > > > > > > > > + if (type == JUMP_LABEL_JMP) > > > + insn = larch_insn_gen_b(jump_entry_code(entry), jump_entry_target(entry)); > > > + else > > > + insn = larch_insn_gen_nop(); > > > + > > > + larch_insn_patch_text(addr, insn); > > > +} > > > > This all implies Loongarch is fine with the nop<->b transition (much > > like arm64 is), but I found no actual mention of what transitions are > > valid for the architecture in your inst.c file -- perhaps you could put > > a small comment there to elucidate the occasional reader that doesn't > > have your arch manual memorized? > > Do you mean by "valid transition" something like "what kind of > self-modification is architecturally sound, taking ICache / > micro-architecture behavior etc. into consideration"? Yes that. There are definitely architectures that have limitations on what instructions can be hot-patched in the face of concurrent execution without jumping through too many hoops.