Message ID | 20230619083255.3841777-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 k13csp2851425vqr; Mon, 19 Jun 2023 01:35:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7d5zr+YJ4apryMczA94rC5oS1gDvgZrVeeIhPJFgsuHih2I/msPU0VJjj41VYwj/MLYxrI X-Received: by 2002:a17:903:280e:b0:1b0:48e9:cddd with SMTP id kp14-20020a170903280e00b001b048e9cdddmr4091826plb.69.1687163749591; Mon, 19 Jun 2023 01:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687163749; cv=none; d=google.com; s=arc-20160816; b=b8MrwfH4traW9BtpBt9YK6Gd8R1avYExaHRtiNxCsURonJcBMScNnm39E1Fekn71Dz akQm6RNfDHb8TlVYPR1gRQUmj/nV4fYkFZKGi2VR78o9ElVyniZZO24GNE7zkMUJgG/H Xa6ftpXUg/u8kMv49DaFseNHMcomfzNwZ989TJKtVVtyj6xCrzukXcb+2ADNEMUlrkNg rTPjzvDbKUOI4oNRuTdYNy4oegp/7gvYFA3sVV31NvOeQUm8RgS7GD0JyaboiXH2tgKm ahZcl++zA7imxTxu913xNwG2GmC/A+KHoH45lldIgNGkEE6gof4QztKyZfhupqaBhVkH aagg== 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=hNX0bsBQSk1hIyX2jOClTW9jwnaDKQghYtlHEFOzjB4=; b=h5c1G8tXlYomE2sIuea1BxvCLGpcPVo/WRqMB22wtDKlyc8p8QtdwOW/JbgfOInySG Mbra5EdfZfh3ausJqVrCcrfRxzpVIsgYhYtfC84xVBW/pEnwETLbJZczPs4pJvnLWkND ++gLoZqz9wvzp+VPDdLXYDdURlbg96CKYbkaxWJytLKSr+EA1SsOsJpTljBxr2m019t7 41lO1/HfjVU42WWH4QVXcY84Ra9MfuIg99yDdRbUMzyiKtaQoISoiCa6c1ldoUGo49HA iIzhkks8pCOzfFAdwPvF4HOv9iN1e2lHW35u6T6f9ASx61j5wsMn31V8Iui0Hvpd0xDJ ErGw== 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 m1-20020a170902bb8100b001a6d4eab490si16489874pls.63.2023.06.19.01.35.32; Mon, 19 Jun 2023 01:35:49 -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 S229960AbjFSIeZ (ORCPT <rfc822;duw91626@gmail.com> + 99 others); Mon, 19 Jun 2023 04:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230342AbjFSIdN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 19 Jun 2023 04:33:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06D76D1; Mon, 19 Jun 2023 01:33:11 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8DxDevDEpBkvssGAA--.14111S3; Mon, 19 Jun 2023 16:33:07 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxC8q3EpBkAgsgAA--.15169S17; Mon, 19 Jun 2023 16:33:06 +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, tangyouling@loongson.cn Subject: [PATCH v14 15/30] LoongArch: KVM: Implement vcpu status description Date: Mon, 19 Jun 2023 16:32:40 +0800 Message-Id: <20230619083255.3841777-16-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230619083255.3841777-1-zhaotianrui@loongson.cn> References: <20230619083255.3841777-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxC8q3EpBkAgsgAA--.15169S17 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== 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?1769119415808123716?= X-GMAIL-MSGID: =?utf-8?q?1769119415808123716?= |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
June 19, 2023, 8:32 a.m. UTC
Implement LoongArch vcpu status description such as idle exits counter, signal exits counter, cpucfg exits counter, etc. Reviewed-by: Bibo Mao <maobibo@loongson.cn> 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 012b0738a06d..2a8d9a76b134 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) &&