Message ID | 20230817125951.1126909-16-zhaotianrui@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp757771vqi; Thu, 17 Aug 2023 07:53:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEz19rwlpP8ptN8R7FTh8BM1jUxj98TgTkyuxwxJQ7yBh9uL72hTZzh92bcMC25Qq/DmUWc X-Received: by 2002:a05:6402:14cd:b0:525:7091:124c with SMTP id f13-20020a05640214cd00b005257091124cmr4518797edx.19.1692283992175; Thu, 17 Aug 2023 07:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692283992; cv=none; d=google.com; s=arc-20160816; b=dBnfHgOO3D0QyKH9Yyr0zjVm/QI0CNztFKw7wqqwTwMIEL/HxiQ329mV5sqlErlaCS hoc+kh8Swr5g+HbOQxaXsKpHUdntjbzR9AHyTN6i1XPGYwwHfEAxXDd8NULSyG4tbY0B 4sH4bCXmYZGHp4ovO234Qkv37xP9gXiyBwJPZ/cdqN7Yxeofe52U8w8DnM0e6lIRhyn/ e6GilAbBVfZ3F4WeuKrFNnz8Vsar8P6/zPNXO7QYRw49do6OX4jBDX5XIVAvi3EGpvaO G58ghM1PuWfAQneKhmKfTUprkdkaaePSFaHGW4yzUdgpA+ubDbB7HmvFSEmIIAzFLZnJ z1Tg== 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=OttzO04VItqJMWRBRYCzSpv+OXyTGGEN2HmgfhjyfrY=; fh=vBXozhnPXwSB3DJhjnKWz3f6luaN/KxHDpM6/QeZg4o=; b=ucN8GvHLVbxj08UA9VuhB5RXtU12ArdJVgFm9HttdJtSkNjBvCqKoWv1Vo0sFanogR 2ggpx/MKXofh5sRxm37OFcxtzBRQlJSkUDaDSsDt3i4y2mroxET6cF0GlYZkPA90n6CW SfOn/99vOwoQDuBhb4zHbTEExidMzct4IXAeKvwiIZm4l0wPj40x1pN02AjQWEso7Sc5 4LAOxrvmhCYhWLgLYJZeKiUMOS158JbB2Wtx506fHmwUEjbmTHNKRu6Jctah72JfnH7R YaGgHnElloDGlSL51kHlpyUtJe5de+Ze4TFzVICzihu1j9ZGbsJkVJKgN3n4ACLVem0x SHLA== 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 f19-20020a056402069300b00528497fa1dfsi606442edy.584.2023.08.17.07.52.21; Thu, 17 Aug 2023 07:53:12 -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 S1351249AbjHQNAe (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Thu, 17 Aug 2023 09:00:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351102AbjHQNAH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Aug 2023 09:00:07 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2BD7E30CF; Thu, 17 Aug 2023 06:00:04 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8Bxd+jOGd5kQYYZAA--.16445S3; Thu, 17 Aug 2023 20:59:58 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxniPIGd5kmchcAA--.55665S17; Thu, 17 Aug 2023 20:59:57 +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 v19 15/30] LoongArch: KVM: Implement vcpu status description Date: Thu, 17 Aug 2023 20:59:36 +0800 Message-Id: <20230817125951.1126909-16-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230817125951.1126909-1-zhaotianrui@loongson.cn> References: <20230817125951.1126909-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxniPIGd5kmchcAA--.55665S17 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, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,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: INBOX X-GMAIL-THRID: 1774488379441002149 X-GMAIL-MSGID: 1774488379441002149 |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
Aug. 17, 2023, 12:59 p.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 79e4e2277359..60b2e584c634 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) &&