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 47B51C61DA3 for ; Tue, 21 Feb 2023 09:48:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234028AbjBUJsz (ORCPT ); Tue, 21 Feb 2023 04:48:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234019AbjBUJst (ORCPT ); Tue, 21 Feb 2023 04:48:49 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 800C2233C5; Tue, 21 Feb 2023 01:48:46 -0800 (PST) Received: from loongson.cn (unknown [10.20.42.120]) by gateway (Coremail) with SMTP id _____8AxIMx8k_RjNBwDAA--.834S3; Tue, 21 Feb 2023 17:48:44 +0800 (CST) Received: from [10.20.42.120] (unknown [10.20.42.120]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx6r14k_RjH6g3AA--.36064S3; Tue, 21 Feb 2023 17:48:40 +0800 (CST) Subject: Re: [PATCH v2 22/29] LoongArch: KVM: Implement handle idle exception To: Paolo Bonzini References: <20230220065735.1282809-1-zhaotianrui@loongson.cn> <20230220065735.1282809-23-zhaotianrui@loongson.cn> <06d61407-00b9-812c-e5b3-de585c47ae6b@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: <5d7fe795-66b9-7a07-b754-77327886c6c6@loongson.cn> Date: Tue, 21 Feb 2023 17:48:40 +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: <06d61407-00b9-812c-e5b3-de585c47ae6b@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Dx6r14k_RjH6g3AA--.36064S3 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvdXoWrZrWDJw1ruFyxWr4DCryxAFb_yoWxurg_Ww s3X3Z2kw4UWFsrt3W3CwnIgF43Ga1vqF98urWj9FyUWFnFqFWUWanFg397u397twsxZFZI 9r18A342kr17XjkaLaAFLSUrUUUUeb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUO 07kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2kK e7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUAVWUtwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxk0xIA0c2IEe2 xFo4CEbIxvr21lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC 6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s 026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF 0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0x vE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv 6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU4SoGDUUUU Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2023年02月21日 02:40, Paolo Bonzini 写道: > On 2/20/23 07:57, Tianrui Zhao wrote: >> +int _kvm_emu_idle(struct kvm_vcpu *vcpu) >> +{ >> + ++vcpu->stat.idle_exits; >> + trace_kvm_exit(vcpu, KVM_TRACE_EXIT_IDLE); > > Please add a separate tracepoint, don't overload trace_kvm_exit(). > > Likewise for _kvm_trap_handle_gspr(). > > I think _kvm_trap_handle_gspr() should have a tracepoint whose > parameter is inst.word. Thanks, I will add the tracepoint for _kvm_emu_idle and _kvm_trap_handle_gspr. Thanks Tianrui Zhao > > Paolo > >> + if (!vcpu->arch.irq_pending) { >> + kvm_save_timer(vcpu); >> + kvm_vcpu_block(vcpu); >> + } >> + >> + return EMULATE_DONE;