Message ID | 20230509075346.1023386-16-zhaotianrui@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2702908vqo; Tue, 9 May 2023 01:07:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7zpuSkogGuV/6hQnBMNcevIwvjgMoYrO+NR8iRlocdOyVW0GZD0AHBkBVv+qvr1/CNxaaH X-Received: by 2002:a05:6a20:3c89:b0:100:2ac0:ec0a with SMTP id b9-20020a056a203c8900b001002ac0ec0amr9353672pzj.2.1683619659082; Tue, 09 May 2023 01:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683619659; cv=none; d=google.com; s=arc-20160816; b=tY3Y2W6YDQya+AgSpGZ/dAImYZtJcB3K2+tr9Rs+781VIvhYbr9H9pQyR2UfSumMXP 0jBkNACoEKpFd8XgtvV0CW8clIUZfIqN0VYQn0l6OM9UBZoKuCLNLgGgZci4WyDfweXr +BR0Kehy3hU8CSs1nt8Kx4xR5EGuDRllZdO2sIYF0QUAw8Q97uPYDE2fJcVMDNQe1GNj DfGc6b6obKqqJ3u+TuP8TtrXnrwKOKAdUJlEpFbnB/+sJ1sJcDFhCGor4e/oE4y0OLaK R0xqbg7rUAHn48TpRnryG9XXmzjnu1E+RkzKVgoU73fNNfGc+RrLmPigkx/5Mhldwuzz lObA== 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=AjzxDz3v5n+dAILYMGUEiA0a8ih18u22g1wBIY1y8g4=; b=HQZ4IoCaNJ0OJzvMQ8OkNk3Eg0t3H6mf4y2QaEm36PhZWSLpWpAvOUOPjb3E0xtJig zbyIxb9IN5a5wTKzlmcm2uSO3o3i8K4nl5EYngbYM38W2UAxHO4lO54QPKeSrH1Gsnw/ sHq75vNHs3Mwg2fgXnj9EBeK790xeW9ttA4aK9j5/ZLB0tOlm/WofOVo/bVqGO/YTX/6 TGm+AfkZKbBLHjInuca4fbu9U4F81zblP3zxXN3xfOznBIPYuqp3QdIs3/eK6DihYOQX U6AZeiaoceRlTcZqi3XH4kSvASKx1Zk+I9FBqGsz9V5aP/YVVgba4kjw0l4mNh/0TtNN OMog== 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 t67-20020a625f46000000b0063b76333d9asi1883576pfb.217.2023.05.09.01.07.24; Tue, 09 May 2023 01:07:39 -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; 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 S235331AbjEIHzK (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Tue, 9 May 2023 03:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234619AbjEIHx7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 9 May 2023 03:53:59 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D05E9A257; Tue, 9 May 2023 00:53:56 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8CxE_AT_FlkLOMGAA--.11564S3; Tue, 09 May 2023 15:53:55 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFLUK_FlkIEhSAA--.16908S17; Tue, 09 May 2023 15:53:54 +0800 (CST) From: Tianrui Zhao <zhaotianrui@loongson.cn> To: Paolo Bonzini <pbonzini@redhat.com>, Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name> Cc: 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>, Oliver Upton <oliver.upton@linux.dev>, maobibo@loongson.cn, Xi Ruoyao <xry111@xry111.site>, zhaotianrui@loongson.cn Subject: [PATCH v9 15/30] LoongArch: KVM: Implement vcpu status description Date: Tue, 9 May 2023 15:53:31 +0800 Message-Id: <20230509075346.1023386-16-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230509075346.1023386-1-zhaotianrui@loongson.cn> References: <20230509075346.1023386-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxFLUK_FlkIEhSAA--.16908S17 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7uw4kGry8Kw4DWrW7ZF1DWrg_yoW8Gr1UpF nrCa4Ygr4rWwnxWw1fJ39xGw47XrZ5WF1fWr9Fq34YkFnrtrn5XFW8KrWDGFyvy3sYyr1S qayrtwnxua90yaUanT9S1TB71UUUUjJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b4AFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4 AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF 7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6x kF7I0E14v26F4UJVW0owAaw2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAq jxCEc2xF0cIa020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E74AGY7Cv6c x26rWlOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkF7I0En4kS14v26r12 6r1DMxAIw28IcxkI7VAKI48JMxAIw28IcVCjz48v1sIEY20_WwCFx2IqxVCFs4IE7xkEbV WUJVW8JwCFI7km07C267AKxVWUAVWUtwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWDJVCq3wCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr1j6F4UJwCI42IY6I8E87Iv6x kF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7xRiTKZJUUUUU== X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,RCVD_IN_SBL_CSS, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1765403167486676306?= X-GMAIL-MSGID: =?utf-8?q?1765403167486676306?= |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
May 9, 2023, 7:53 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 2c9298e8817c..12fc3eefab8b 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -12,6 +12,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) &&