Message ID | 20230220065735.1282809-16-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 s9csp1165989wrn; Sun, 19 Feb 2023 22:59:40 -0800 (PST) X-Google-Smtp-Source: AK7set/bjdgvZbzVSifLodnC942uRL3Yee8piEqC6OqJ5oeYHs+/RUqGdMAn17XIfYRnvk4nqYLG X-Received: by 2002:a17:902:e851:b0:19a:a267:f16c with SMTP id t17-20020a170902e85100b0019aa267f16cmr1676120plg.31.1676876380699; Sun, 19 Feb 2023 22:59:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676876380; cv=none; d=google.com; s=arc-20160816; b=hvhHs/Jw3KYs3jfKG5olKDwgWQbYnMgOz7MT19QehctxHZ1PRI1ax74BGfWhwxJbd3 gzF/xmpjdw1AzRXOt7gFYt6V6If4zJd1ow/8mKJPrlp74xPjKcxb6lsxmWkb0ZY26N/m uiKXn6BvcsY3AImg3ZzzaKd+8nSsGkpIFRVfwt7yVsnB7yKv7WcCqRDr3QsvlZJ5TOAC Ezg1Bko/WJ1ZTjUyO05dcKFV8/TgiJxqVWYHtzH0qlvVPSBckpjSVBmNbfX2SwHGL/My 7qR+MByKqUTMxc2qA/jJGth9BvpIgrbTaoCrgsNQKUNssgAePnUbIDHnWPJjXean5OtB 9NhQ== 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=UTLlyxykhxhe6EcWwZ8whQTsbktSybIv+Sy2fzxq2CU=; b=iDTOe+JXCmul9alSQRNVlPqkkOpe7UsbyRFb9ejwnVQG5rJ15Pa8NhHN0Fhhdjw+5a Qj1Y7HGDo31qftmUMtmYCDEvj1i8UuuvVIWVQ19mrJl5sQvfwjotih1rJ+PBUmSdxnZj k2q5qQqhfsOM6ivNWl4iC2wIyEqgtyEZw6crcT91ydLlDWYb4lMU15WJ407s5myP1cZO nBpoaEvWJPssA6uWa32BUn+05c0u+97AoI//3aUkap87HwWADg+W9CFIY7fZZy7y+R42 lNgN7mtSqxq3k/ZIYCEnQKjpQqy9lA7QO7sIK9YZBYz+GqxTjQ/stSFjmY2mMT7S7B4J xTxw== 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 ja22-20020a170902efd600b0019a981b8f1csi7903064plb.413.2023.02.19.22.59.28; Sun, 19 Feb 2023 22:59:40 -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 S231126AbjBTG6F (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Mon, 20 Feb 2023 01:58:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbjBTG5p (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Feb 2023 01:57:45 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A77C0EB71; Sun, 19 Feb 2023 22:57:42 -0800 (PST) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxJPTlGfNjnbQCAA--.58S3; Mon, 20 Feb 2023 14:57:41 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Ax+73fGfNjFvk2AA--.34690S17; Mon, 20 Feb 2023 14:57:40 +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>, Oliver Upton <oliver.upton@linux.dev>, maobibo@loongson.cn Subject: [PATCH v2 15/29] LoongArch: KVM: Implement vcpu status description Date: Mon, 20 Feb 2023 14:57:21 +0800 Message-Id: <20230220065735.1282809-16-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230220065735.1282809-1-zhaotianrui@loongson.cn> References: <20230220065735.1282809-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Ax+73fGfNjFvk2AA--.34690S17 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvJXoWxJrWfXw17tr1kZryDXw4rGrg_yoW8Jw4rpF nrua4Ygr4rWwn3Ww1fJ398Xw47XrZ5WF1fWr9Fq34YkFnrtrn5XFW0krWDGFyvy34rAr1S qayrtwnrua90yw7anT9S1TB71UUUUjJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bx8Fc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4 AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF 7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aV CY1x0267AKxVWxJr0_GcWln4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l 57IF6xkI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x8ErcxFaV Av8VWrMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxVWU AVWUtwCF04k20xvY0x0EwIxGrwCF04k20xvE74AGY7Cv6cx26rWl4I8I3I0E4IkC6x0Yz7 v_Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_tr0E3s1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcVCF 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?1758332327956843888?= X-GMAIL-MSGID: =?utf-8?q?1758332327956843888?= |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
Feb. 20, 2023, 6:57 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 f649f47c4..cfd35b4d6 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);