lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 28 Sep 2022 10:59:03 +0200
From:   Andrew Jones <ajones@...tanamicro.com>
To:     Guo Ren <guoren@...nel.org>
Cc:     Jisheng Zhang <jszhang@...nel.org>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Anup Patel <anup@...infault.org>,
        Atish Patra <atishp@...shpatra.org>,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, kvm-riscv@...ts.infradead.org
Subject: Re: [PATCH v3 1/3] RISC-V: KVM: Record number of signal exits as a
 vCPU stat

On Wed, Sep 28, 2022 at 01:18:01PM +0800, Guo Ren wrote:
> Reviewed-by: Guo Ren <guoren@...nel.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?

It is. arm64 uses generic xfer to guest mode work, like this series
introduces for riscv.

Thanks,
drew

> 
> 
> On Mon, Sep 26, 2022 at 12:33 AM Jisheng Zhang <jszhang@...nel.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@...nel.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
> 
> -- 
> kvm-riscv mailing list
> kvm-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/kvm-riscv

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ