Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7029053rwr; Wed, 10 May 2023 02:52:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ63KfjhMpqdihnRGUxbEKjpTHlz0zYrTNrm+0tgu9LNg6DixR+YKgmziOa+GaN6ZADZAKYr X-Received: by 2002:a05:6a00:b8a:b0:646:2edb:a23 with SMTP id g10-20020a056a000b8a00b006462edb0a23mr13522575pfj.1.1683712346342; Wed, 10 May 2023 02:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683712346; cv=none; d=google.com; s=arc-20160816; b=n2M4c7/rNSxk/SnFyBfPzOqHTuZSbbM4MQxWil2eJJT/petE0ZLH/fu6WAStap87Oz PEgVfEg2PIS+zdxX6bprXJPlrFcNkJWhFQauKQzWbkE/ljVdBCRjNo+FKqmYy6B6L7Zd B2YFP2aefW0AhRpjvlcN8Id2zGKC6YZUTQqopKlGSpo3oZYcF05M6KKrQUT61SJ6o6nT 8vvTJ1nCSfmBwV4bEvh/yxLiC85ADgOaql2TGa9jzITYDOzV79LlXXW/cXbjNHkfXhO0 K+21ezthiGKE5TbykeGg36KENXie6Zkx0xB0A8/E+W7hkv21TfUcSxdMTIUFTENEz5oM GXvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=sK0IS5tT2TVxu8WkTltc56+w3+KZLmjYmrjmwCwe18o=; b=Hosy5qRqjabiyrjRvUkEFLD5g/gxWna5eiw3abLQc8jgymOpPO2y7RDRE/3wxoXbHj ZXUFZJLyHQLoOLbJMoKSFbfe2459k5AO9aNNVFIXEZuaJxyai/7yg57P41rhFQ5ne0AQ +oYW0E9V+ZpynHo/Mjdxk5836QpRDFR2VOMvsZR9c0TUkvrbLFTAViNiB0jbCQHl04nZ zO0xTxiTdjuHs9P+P1Z9pH+czDHO1giWkB/0AjEbCerAfSNZ0ieMtbaHKl173Eaguopc rVLhx5ve3Y8iG9sxwrVNK2VpVsm8rgsCpgHG2OmpJ8Jz2rVfUE6uby1zZvSwmbT99asa GFQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=HxkXA9XP; 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 72-20020a62184b000000b005a8c65d57a0si4612698pfy.257.2023.05.10.02.52.11; Wed, 10 May 2023 02:52:26 -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=@xen0n.name header.s=mail header.b=HxkXA9XP; 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 S236375AbjEJJek (ORCPT + 99 others); Wed, 10 May 2023 05:34:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231268AbjEJJej (ORCPT ); Wed, 10 May 2023 05:34:39 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 624E73A89; Wed, 10 May 2023 02:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1683711275; bh=CVCNr+jiCPA9b+x0610c9UfH/6p5CPr9D1Yj681oIcw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HxkXA9XPuRLHE/D3W2hj/JAI8D5u3GtMSwd65oBRjmoscxxo8G6e1ZomdRhVk+C+B dY7CwJH+NAIkL1y6WKINQhtUUffDkKB+Tz+n8jGuEwIQEgAdW9RaxmaSMMPG4NAooq Z8HEk/JVknqNUGJoj4132JZcc5vWyL+/rRDt2NxM= Received: from [100.100.57.122] (unknown [58.34.185.106]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 7BDC96014E; Wed, 10 May 2023 17:34:34 +0800 (CST) Message-ID: <15594820-0a95-94bb-132f-5008d31c041f@xen0n.name> Date: Wed, 10 May 2023 17:34:33 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v2] LoongArch: Add jump-label implementation Content-Language: en-US To: Peter Zijlstra , Youling Tang Cc: Huacai Chen , Jonathan Corbet , Josh Poimboeuf , Jason Baron , Zhangjin Wu , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev References: <1683710206-23905-1-git-send-email-tangyouling@loongson.cn> <20230510092723.GK4253@hirez.programming.kicks-ass.net> From: WANG Xuerui In-Reply-To: <20230510092723.GK4253@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, 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 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"? If so, I'd say things would be fine in LoongArch as long as an instruction fetch barrier is used. Maybe Youling can confirm and mention this in the next revision. -- WANG "xen0n" Xuerui Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/