Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0579DC61DA3 for ; Tue, 21 Feb 2023 12:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233249AbjBUM63 (ORCPT ); Tue, 21 Feb 2023 07:58:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232115AbjBUM61 (ORCPT ); Tue, 21 Feb 2023 07:58:27 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5784B9030; Tue, 21 Feb 2023 04:58:24 -0800 (PST) Received: from loongson.cn (unknown [10.20.42.120]) by gateway (Coremail) with SMTP id _____8BxYU_tv_RjiSgDAA--.1046S3; Tue, 21 Feb 2023 20:58:21 +0800 (CST) Received: from [10.20.42.120] (unknown [10.20.42.120]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxSL3sv_RjK8I3AA--.36234S3; Tue, 21 Feb 2023 20:58:21 +0800 (CST) Subject: Re: [PATCH v2 27/29] LoongArch: KVM: Implement vcpu world switch To: Paolo Bonzini References: <20230220065735.1282809-1-zhaotianrui@loongson.cn> <20230220065735.1282809-28-zhaotianrui@loongson.cn> <884fdf34-e675-2ebe-e37f-6aeb696a0922@redhat.com> Cc: Huacai Chen , WANG Xuerui , Greg Kroah-Hartman , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jens Axboe , Mark Brown , Alex Deucher , Oliver Upton , maobibo@loongson.cn From: Tianrui Zhao Message-ID: <2a2d6a84-11cc-7a5b-5f1d-6660446b481c@loongson.cn> Date: Tue, 21 Feb 2023 20:58:20 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <884fdf34-e675-2ebe-e37f-6aeb696a0922@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxSL3sv_RjK8I3AA--.36234S3 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvdXoW7XFyDCw1furyUXF4kKw4Durg_yoWxKFc_Wr W0gFs7Cwn5Wws2vF4UGr9IvFs29ay5tayIq348Wr1qqFyfKrZrAw4DXr95ZayUJ3yYkrs8 WrZ8Wa45Cr4jgjkaLaAFLSUrUUUUnb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUO e7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2kK e7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUAVWUtwAv7VC2z280 aVAFwI0_Cr0_Gr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62 AI1cAE67vIY487MxkF7I0En4kS14v26r126r1DMxAIw28IcxkI7VAKI48JMxC20s026xCa FVCjc4AY6r1j6r4UMxCIbckI1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2 IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI 42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42 IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Cr0_Gr1UMIIF0xvEx4A2 jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jb_-PUUUUU= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2023年02月21日 16:18, Paolo Bonzini 写道: > On 2/20/23 07:57, Tianrui Zhao wrote: >> + or a0, s0, zero >> + or a1, s1, zero >> + ld.d t8, a2, KVM_ARCH_HANDLE_EXIT >> + jirl ra,t8, 0 >> + ori t0, zero, CSR_CRMD_IE >> + csrxchg zero, t0, LOONGARCH_CSR_CRMD > > _kvm_handle_exit returns with the interrupts disabled. > > Can you please add a comment to explain why CRMD.IE needs to be > cleared here, or remove these two instructions if unnecessary? > > Paolo Thanks, the interrupts have already been disabled when _kvm_handle_exit returns, and I will remove the two instructions. Thanks Tianrui Zhao > >> + or a2, s1, zero >> + addi.d a2, a2, KVM_VCPU_ARCH >> + >> + andi t0, a0, RESUME_HOST >> + bnez t0, ret_to_host