Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2375688rwd; Sun, 21 May 2023 19:55:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6oJ+UjUYWIsT+cx2buoP3/0gYAj2FnfmUVmZOYQ4o/IeI8hUyTeK7HyucR0RlLst3ooZE6 X-Received: by 2002:a17:90b:4a81:b0:255:517a:41c9 with SMTP id lp1-20020a17090b4a8100b00255517a41c9mr3445238pjb.9.1684724147091; Sun, 21 May 2023 19:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684724147; cv=none; d=google.com; s=arc-20160816; b=sjrF8tDrUgb3gU1JenDpgxfHV0SfdSWnPiPE4nUGbPlXPCkVYOOSjFLqDbevW1+fKd YUy8ObOT+QezYuYv83f9UH7rehD7MTzVTy9r5vGB924Q5I1HOnBZkRubtu/FbnMsDasI NCrSME2wSgtSVOa7gatG+o9V0rkdt5FBhIoc9JSz/Z2uoRF/VvIaxUMAq9THXZoE/LPt aD5/qIoBpvcHK/VBlBMcQy/U3wGq5tbdrNeui6pjt3j7/P4FCIRllQiJCpOV52Q7BiUo +brriTw/2SIOV19ZEY+4hStTOdvlGaOY8Jrb6rwQxOw7oUKw1Z97pfHUOKDpRVnLds+H ZSdg== 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=tU7B85J3Q4Hm10F/Y+cCh+HiiHyiMYGDK+8lKzZr7I4=; b=xEdK+XfaE+JFf2992dR6ViM3XhZdBQJgDieKRdUUSQ0exNtTVXy1mFH7qnX5hzdk4B cqmS0iLKkNGGGiaVFzl2XxwjPvJTtbv8IhqFGGdhciRtp+JKab/Xt6Ii7Lthww5OYE4q Z+HdvGoy3hjgQMFTVVmSS4EHlVSYyfYT9mqZ6NxGXSuMVVrUQRsINhVb+8VYw6Tgbsgn mN5bjAQseRcFt/QtecHw9wZFBER1d98UYLMAlqvxE4hTDauLQAIqj9iTJPr4/dX//qqw Oagq/XRivNIJwPdMcGZQhQQ2nlQRAeH3Mbmf88JMdZMnv24d7yLuIieGj+v9o+k9UQ3V FupQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=KFsw6ekV; 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 e11-20020a17090a804b00b00250b5ffafdcsi3957377pjw.125.2023.05.21.19.55.34; Sun, 21 May 2023 19:55:47 -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=KFsw6ekV; 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 S229959AbjEVChg (ORCPT + 99 others); Sun, 21 May 2023 22:37:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbjEVChe (ORCPT ); Sun, 21 May 2023 22:37:34 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC86FBF; Sun, 21 May 2023 19:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1684723048; bh=2I37PoGTbZtIxILPqHRdtx9Ofw+v5h7+2+yuRe0uyXY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KFsw6ekVQ3j3EjS4tBu9id9rY9133f1FoEeQzmnSPT1tW3x+0upklnWahcL7jgR6s RejJ0t8pcMOsGfbHRJUmPGc1SGQOYabX+Pu0nu3x1VWtVzNKUdsSdcTxJ6jMiqMYZI O9MTUADUpalQgYNg+EYrgio/RiRNJ471E+pxKZ1Q= 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) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 114F4600DA; Mon, 22 May 2023 10:37:27 +0800 (CST) Message-ID: <90b2fc60-af26-4ba6-f775-7db2514a62f4@xen0n.name> Date: Mon, 22 May 2023 10:37:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v10 00/30] Add KVM LoongArch support Content-Language: en-US To: maobibo , Paolo Bonzini , Huacai Chen Cc: Greg Kroah-Hartman , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jens Axboe , Mark Brown , Alex Deucher , Oliver Upton , Xi Ruoyao , Tianrui Zhao References: <20230515021522.2445551-1-zhaotianrui@loongson.cn> <02f07d8e-e1c2-2ec0-59c3-f5b4ef0463dc@loongson.cn> <4529ee5b-364a-7819-c727-71cf94057b8b@xen0n.name> <99371487-717a-64d6-1c3d-aaeaee6f20db@loongson.cn> From: WANG Xuerui In-Reply-To: <99371487-717a-64d6-1c3d-aaeaee6f20db@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 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 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 2023/5/22 09:39, maobibo wrote: > > > 在 2023/5/21 18:22, WANG Xuerui 写道: >> On 2023/5/18 10:56, maobibo wrote: >>> >> (BTW, how do people usually deal with pre-release hardware wit documentation not out yet? I suppose similar situations like this should turn up fairly often.) > Manual is actually one issue, however it does not prevent the review > process. There are some drivers for *fruit* devices, I can not find > the hw manual also. With the manual, it helps to review and points > out the further and detailed issues. There's a *slight* difference: the certain vendor you've mentioned is historically uncooperative in providing the documentation, so outside contributors had to reverse-engineer and document the HW themselves; but in Loongson's case, you *are* the vendor, so you are probably in a position that can make everyone's life easier by at least pushing for the docs release... >> >> Aside from this, there's another point: use of undocumented instructions in raw form with ".word". This currently doesn't work in LLVM/Clang > As for one new architecture, it is normal to use .word or .insn, instruction > will update for the first few years and also compiler may be not supported > timely. The other arch has the same phenomenon if you grep "\.insn", also > llvm on LoongArch supports ".word" directives. > > After three or five years, we will remove these ".insn" macro when hw and > compiler is matured. Sorry for the confusion at my side; `.word` certainly works, what doesn't work currently seems to be the `parse_r` helper. I know because I've tried in the last week with latest LLVM/Clang snapshot. And you can't write ergonomic inline asm with proper register allocator awareness without the helper; the LoongArch assembler isn't capable of assembling in a certain encoding format. With RISC-V `.insn` you can do things like `.insn r 0xNN, 0, 0, a0, a1, a2`, but you cannot simply e.g. express gcsrxchg with `.insn DJK 0x05000000, a0, a1, a2` because no such instruction format convention has been standardized. (The notation demonstrated here is taken from [1].) In any case, it seems best to at least wait for the documentation release a little bit, or you should state clearly that this is not going to happen soon, so people can properly manage their expectation and prioritize. (For example, if I know docs and/or assembler support for the virtualization extension won't come soon, then I'd work on supporting the .word idiom before other things. Otherwise there are more important things than that.) [1]: https://github.com/loongson/LoongArch-Documentation/pull/56 -- WANG "xen0n" Xuerui Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/