Message ID | 20230214025648.1898508-11-zhaotianrui@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2723370wrn; Mon, 13 Feb 2023 18:58:27 -0800 (PST) X-Google-Smtp-Source: AK7set8uJG6Ssaoupcq+hrC+c8JqowRuymlRoI1W0cYAe6m4Hz31plkD8MoS4xBRlJP27ErpuFhr X-Received: by 2002:a05:6a20:144e:b0:bc:ee04:275d with SMTP id a14-20020a056a20144e00b000bcee04275dmr685207pzi.61.1676343507364; Mon, 13 Feb 2023 18:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676343507; cv=none; d=google.com; s=arc-20160816; b=0lOj6wCNvmpE5AiMBdC/hoW6n6DQfwuI9CEUUVMkKcsV/Mp07qehL1Bu/al7d1Xgp8 sX8lltmPabP6D8bI358UmB3nu6X0e+c80hln2FPvM21EJRUeNR/G5rFuMTs5OekqYVpk lpKdSp/m4N4wD/DiKvjqp483RnyvX7XAZi8O2w4tL4ijmU0FBY9HWNGaxuogk3F2u8No JgYa18IRswPU4wqdXkHXhZi0aVyrGfUAkjptgLfa6BzAM8252Ohi6KZTPP4TNcLQuTjg BHxUfCByX/5k+/RnrCHP3lJCugdsLqCuHIBCR67tztrJJbQwDqSNoZEHGnqN712HGs1s RxvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=T52CXVYdX2OKUtxBBtfzEFZSvZIpJMxKRpY/L2rYuwM=; b=maR9Mv+P5lnAOnFe2lOS8u6G2fez3ajm3AUhhCuIfF2XgHLpv0Djo94CF7SW0GCPZK xnD0Kqhv3jU6aBH6wGbAOrciouwjrg2L4MXKWMVUyjMghEpd2Cp4CL6CnuGsVFd+J2vW YjmNTt/tdneCxaWu8Tf8I6JJuSjYOoF8tchkkRhYGPISnoklBitN7jjkXVJOwrGCtr8H a92d4tdDmumVYWt6hjRoGPFt7YB5p1CLR2MYkHfDXaQ/5NUTr9dRRQ6WCMgWiQlac7mi qHq4PqUdb3Jz46NxAS15IOCojVtcZRlrsN/7JVGCoKe8N4KEvlDwnLBToYQJa7+v2na6 K6ww== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b184-20020a6334c1000000b004fb90621a9esi7223521pga.40.2023.02.13.18.58.13; Mon, 13 Feb 2023 18:58:27 -0800 (PST) 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; 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 S231493AbjBNC5T (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 13 Feb 2023 21:57:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbjBNC45 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Feb 2023 21:56:57 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 830D418B03; Mon, 13 Feb 2023 18:56:55 -0800 (PST) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8Bxtth2+Opja1cAAA--.391S3; Tue, 14 Feb 2023 10:56:54 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Axeb1w+OpjmZwyAA--.28802S12; Tue, 14 Feb 2023 10:56:54 +0800 (CST) From: Tianrui Zhao <zhaotianrui@loongson.cn> To: Paolo Bonzini <pbonzini@redhat.com> Cc: Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jens Axboe <axboe@kernel.dk>, Mark Brown <broonie@kernel.org>, Alex Deucher <alexander.deucher@amd.com> Subject: [PATCH v1 10/24] LoongArch: KVM: Implement vcpu status description Date: Tue, 14 Feb 2023 10:56:34 +0800 Message-Id: <20230214025648.1898508-11-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230214025648.1898508-1-zhaotianrui@loongson.cn> References: <20230214025648.1898508-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Axeb1w+OpjmZwyAA--.28802S12 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvJXoWxJrWfXw17tr1kuFWUKF1kGrg_yoW8Jw4rpF nrCa4Ygr4rWwnxWw1fJ39xJw42qrZ5W3WfWr9FqryakFnrtrn5XFW0krWDGFykA34rAr1S qayrtwnrua90kw7anT9S1TB71UUUUj7qnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bx8Fc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4 AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF 7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aV CY1x0267AKxVW8Jr0_Cr1UM2kKe7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487 Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VCjz48v1s IEY20_WwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_ JF0_Jw1l42xK82IYc2Ij64vIr41l42xK82IY6x8ErcxFaVAv8VWrMxC20s026xCaFVCjc4 AY6r1j6r4UMxCIbckI1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4UJVWxJr1lIxAIcVC2z280aV CY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0zR9iSdUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757773569233773127?= X-GMAIL-MSGID: =?utf-8?q?1757773569233773127?= |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
Feb. 14, 2023, 2:56 a.m. UTC
Implement loongarch vcpu status description such as idle exits counter,
signal exits counter, cpucfg exits counter, etc.
Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn>
---
arch/loongarch/kvm/vcpu.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c index 0228941ec..0136ee3a1 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -13,6 +13,23 @@ #define CREATE_TRACE_POINTS #include "trace.h" +const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = { + KVM_GENERIC_VCPU_STATS(), + STATS_DESC_COUNTER(VCPU, idle_exits), + STATS_DESC_COUNTER(VCPU, signal_exits), + STATS_DESC_COUNTER(VCPU, int_exits), + STATS_DESC_COUNTER(VCPU, cpucfg_exits), +}; + +const struct kvm_stats_header kvm_vcpu_stats_header = { + .name_size = KVM_STATS_NAME_SIZE, + .num_desc = ARRAY_SIZE(kvm_vcpu_stats_desc), + .id_offset = sizeof(struct kvm_stats_header), + .desc_offset = sizeof(struct kvm_stats_header) + KVM_STATS_NAME_SIZE, + .data_offset = sizeof(struct kvm_stats_header) + KVM_STATS_NAME_SIZE + + sizeof(kvm_vcpu_stats_desc), +}; + int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) { return !!(vcpu->arch.irq_pending);