All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guo Ren <guoren@kernel.org>
To: Jisheng Zhang <jszhang@kernel.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Anup Patel <anup@brainfault.org>,
	Atish Patra <atishp@atishpatra.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, kvm-riscv@lists.infradead.org
Subject: Re: [PATCH v3 1/3] RISC-V: KVM: Record number of signal exits as a vCPU stat
Date: Wed, 28 Sep 2022 13:18:01 +0800	[thread overview]
Message-ID: <CAJF2gTRSb4f9rF_sTZ2hr9iOnvLYcQYu3CN7q8PCZQg4HvC_Gg@mail.gmail.com> (raw)
In-Reply-To: <20220925162400.1606-2-jszhang@kernel.org>

Reviewed-by: Guo Ren <guoren@kernel.org>

➜  linux git:(master) grep signal_exits arch/arm64 -r
arch/arm64/kvm/guest.c: STATS_DESC_COUNTER(VCPU, signal_exits),
arch/arm64/include/asm/kvm_host.h:      u64 signal_exits;

By the way, do you know why arm64 is defined, but not used?


On Mon, Sep 26, 2022 at 12:33 AM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> Record a statistic indicating the number of times a vCPU has exited
> due to a pending signal.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  arch/riscv/include/asm/kvm_host.h | 1 +
>  arch/riscv/kvm/vcpu.c             | 2 ++
>  2 files changed, 3 insertions(+)
>
> diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h
> index 60c517e4d576..dbbf43d52623 100644
> --- a/arch/riscv/include/asm/kvm_host.h
> +++ b/arch/riscv/include/asm/kvm_host.h
> @@ -67,6 +67,7 @@ struct kvm_vcpu_stat {
>         u64 mmio_exit_kernel;
>         u64 csr_exit_user;
>         u64 csr_exit_kernel;
> +       u64 signal_exits;
>         u64 exits;
>  };
>
> diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c
> index d0f08d5b4282..3da459fedc28 100644
> --- a/arch/riscv/kvm/vcpu.c
> +++ b/arch/riscv/kvm/vcpu.c
> @@ -28,6 +28,7 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
>         STATS_DESC_COUNTER(VCPU, mmio_exit_kernel),
>         STATS_DESC_COUNTER(VCPU, csr_exit_user),
>         STATS_DESC_COUNTER(VCPU, csr_exit_kernel),
> +       STATS_DESC_COUNTER(VCPU, signal_exits),
>         STATS_DESC_COUNTER(VCPU, exits)
>  };
>
> @@ -973,6 +974,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
>                 if (signal_pending(current)) {
>                         ret = -EINTR;
>                         run->exit_reason = KVM_EXIT_INTR;
> +                       ++vcpu->stat.signal_exits;
>                 }
>
>                 /*
> --
> 2.34.1
>


--
Best Regards
 Guo Ren

WARNING: multiple messages have this Message-ID (diff)
From: Guo Ren <guoren@kernel.org>
To: Jisheng Zhang <jszhang@kernel.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Albert Ou <aou@eecs.berkeley.edu>,
	Anup Patel <anup@brainfault.org>,
	 Atish Patra <atishp@atishpatra.org>,
	linux-riscv@lists.infradead.org,  linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org,  kvm-riscv@lists.infradead.org
Subject: Re: [PATCH v3 1/3] RISC-V: KVM: Record number of signal exits as a vCPU stat
Date: Wed, 28 Sep 2022 13:18:01 +0800	[thread overview]
Message-ID: <CAJF2gTRSb4f9rF_sTZ2hr9iOnvLYcQYu3CN7q8PCZQg4HvC_Gg@mail.gmail.com> (raw)
In-Reply-To: <20220925162400.1606-2-jszhang@kernel.org>

Reviewed-by: Guo Ren <guoren@kernel.org>

➜  linux git:(master) grep signal_exits arch/arm64 -r
arch/arm64/kvm/guest.c: STATS_DESC_COUNTER(VCPU, signal_exits),
arch/arm64/include/asm/kvm_host.h:      u64 signal_exits;

By the way, do you know why arm64 is defined, but not used?


On Mon, Sep 26, 2022 at 12:33 AM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> Record a statistic indicating the number of times a vCPU has exited
> due to a pending signal.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  arch/riscv/include/asm/kvm_host.h | 1 +
>  arch/riscv/kvm/vcpu.c             | 2 ++
>  2 files changed, 3 insertions(+)
>
> diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h
> index 60c517e4d576..dbbf43d52623 100644
> --- a/arch/riscv/include/asm/kvm_host.h
> +++ b/arch/riscv/include/asm/kvm_host.h
> @@ -67,6 +67,7 @@ struct kvm_vcpu_stat {
>         u64 mmio_exit_kernel;
>         u64 csr_exit_user;
>         u64 csr_exit_kernel;
> +       u64 signal_exits;
>         u64 exits;
>  };
>
> diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c
> index d0f08d5b4282..3da459fedc28 100644
> --- a/arch/riscv/kvm/vcpu.c
> +++ b/arch/riscv/kvm/vcpu.c
> @@ -28,6 +28,7 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
>         STATS_DESC_COUNTER(VCPU, mmio_exit_kernel),
>         STATS_DESC_COUNTER(VCPU, csr_exit_user),
>         STATS_DESC_COUNTER(VCPU, csr_exit_kernel),
> +       STATS_DESC_COUNTER(VCPU, signal_exits),
>         STATS_DESC_COUNTER(VCPU, exits)
>  };
>
> @@ -973,6 +974,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
>                 if (signal_pending(current)) {
>                         ret = -EINTR;
>                         run->exit_reason = KVM_EXIT_INTR;
> +                       ++vcpu->stat.signal_exits;
>                 }
>
>                 /*
> --
> 2.34.1
>


--
Best Regards
 Guo Ren

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2022-09-28  5:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 16:23 [PATCH v3 0/3] riscv: kvm: use generic entry for TIF_NOTIFY_RESUME and misc Jisheng Zhang
2022-09-25 16:23 ` Jisheng Zhang
2022-09-25 16:23 ` [PATCH v3 1/3] RISC-V: KVM: Record number of signal exits as a vCPU stat Jisheng Zhang
2022-09-25 16:23   ` Jisheng Zhang
2022-09-28  5:18   ` Guo Ren [this message]
2022-09-28  5:18     ` Guo Ren
2022-09-28  8:59     ` Andrew Jones
2022-09-28  8:59       ` Andrew Jones
2022-09-25 16:23 ` [PATCH v3 2/3] RISC-V: KVM: Use generic guest entry infrastructure Jisheng Zhang
2022-09-25 16:23   ` Jisheng Zhang
2022-09-25 16:24 ` [PATCH v3 3/3] riscv: select HAVE_POSIX_CPU_TIMERS_TASK_WORK Jisheng Zhang
2022-09-25 16:24   ` Jisheng Zhang
2022-09-28  9:00 ` [PATCH v3 0/3] riscv: kvm: use generic entry for TIF_NOTIFY_RESUME and misc Andrew Jones
2022-09-28  9:00   ` Andrew Jones
2022-10-01 12:37 ` Anup Patel
2022-10-01 12:37   ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJF2gTRSb4f9rF_sTZ2hr9iOnvLYcQYu3CN7q8PCZQg4HvC_Gg@mail.gmail.com \
    --to=guoren@kernel.org \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=atishp@atishpatra.org \
    --cc=jszhang@kernel.org \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.