Message ID | 20230530015223.147755-16-zhaotianrui@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1877249vqr; Mon, 29 May 2023 18:54:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Xk+y134MaU2QvFrSEwB9jQjXJu1v7HlEvX+0YNGogsmeTk4bRWRUdN0iLHfNmbz+loLRD X-Received: by 2002:a17:90a:69c4:b0:256:a465:751b with SMTP id s62-20020a17090a69c400b00256a465751bmr890867pjj.9.1685411673123; Mon, 29 May 2023 18:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685411673; cv=none; d=google.com; s=arc-20160816; b=OlVPu111CWNEyXfxiycb/i5y0pKLRSuZky1fgP7sPuq74N/KQgJ55hCaMMRVTyfvxD vGAw9CZdSktqhStBZUZ57y+3uyr9AYz62v4AYKr9NyRng76tHpt7W2o+3iC5jE50PV29 DpoDD1WegK2PR473BPI1t5XrjG54K4/D3I7waXOVpbuTm3yDumdW45DPbBFvzanAs098 32oZtvC1pBPk1eaSn/ewiggfpL97hZ76Ka19sr8az91cMN3I7MchgwXw8cDzV1fdnDqp VR3nCioJqYIL0LECUhuvsEbHJOVqawmqnTdPxmYrgG03uu9tFYNhalT9svqLLtv4zCSI Pv5g== 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=uSbgPlF2G1vg6gl+58CerjL7yeMvL6XtgNZchnGhYg8=; b=hbdLPkV3i31kq/KOgyXG9LsfL2K8VLSbHRUb3qUn6XJVaOLeo2yqkCXqUt3t1bWvxl WK5yHmQfw5Bf7x9mNfynxFi52RmkEJ+9c+N5jRvfeB5ESuuHUaR/095fz+sZkLv50Ktp oTyS4D0Pjd7EwGAy0kPDNrzXEGQliuB1eqhcTlViFgkT21A6XzsHFefNj8yOafUtlWcX /dVKaVnfICuztK4zaivGl40rqGBHy8XSdFs4GGv9CjqoAF0gLllwNJ02EoM4xDCVUUcg aRREAZbdO3v6HVpQ3wC0zpUenqqgrrM7Av4YyOpe9mVVgWg6WQJcle6BzyRm2D7f3GYw yZdg== 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 oe5-20020a17090b394500b00246f8b06125si13823977pjb.108.2023.05.29.18.54.21; Mon, 29 May 2023 18:54:33 -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 S230112AbjE3BxV (ORCPT <rfc822;andrewvogler123@gmail.com> + 99 others); Mon, 29 May 2023 21:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbjE3Bwk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 29 May 2023 21:52:40 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F2377109; Mon, 29 May 2023 18:52:31 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8Bxy_LdVnVkZ2oCAA--.5575S3; Tue, 30 May 2023 09:52:29 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxQbTYVnVkQNZ_AA--.12077S17; Tue, 30 May 2023 09:52:29 +0800 (CST) From: Tianrui Zhao <zhaotianrui@loongson.cn> To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini <pbonzini@redhat.com>, Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, loongarch@lists.linux.dev, 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 v12 15/31] LoongArch: KVM: Implement vcpu status description Date: Tue, 30 May 2023 09:52:07 +0800 Message-Id: <20230530015223.147755-16-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230530015223.147755-1-zhaotianrui@loongson.cn> References: <20230530015223.147755-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8AxQbTYVnVkQNZ_AA--.12077S17 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7uw4kGry8Kw4DWrWxJF45trb_yoW8Gr1UpF nrCa4Ygr4rWwnxWw1fJ39xXw47XrZ5WF1fWr9Fq34YkFnrtrn5XFW0krWDGFyvy3sYyr1S qayrt3Zrua90yw7anT9S1TB71UUUUj7qnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bxxFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4 AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF 7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aV CY1x0267AKxVW8Jr0_Cr1UM2kKe7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487 Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VCjz48v1s IEY20_WwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_ JF0_Jw1l42xK82IYc2Ij64vIr41l42xK82IY6x8ErcxFaVAv8VWrMxC20s026xCaFVCjc4 AY6r1j6r4UMxCIbckI1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26w1j6s0DMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8Jr0_Cr1UMIIF0xvEx4A2js IEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvj4RKpBTUUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1767282230941995831?= X-GMAIL-MSGID: =?utf-8?q?1767282230941995831?= |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
May 30, 2023, 1:52 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(+)
Comments
Reviewed-by: Bibo, Mao <maobibo@loongson.cn> 在 2023/5/30 09:52, Tianrui Zhao 写道: > 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 c41de76d0a79..79599e69b2c9 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) &&
diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c index c41de76d0a79..79599e69b2c9 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) &&