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] [day] [month] [year] [list]
Message-ID: <CAAhSdy0jaPPBNkXkt5-jj+LWCm+XiC0G2udK2C7n1f2TqBPCmg@mail.gmail.com>
Date:   Fri, 19 Nov 2021 17:50:58 +0530
From:   Anup Patel <anup@...infault.org>
To:     Atish Patra <atishp@...shpatra.org>
Cc:     Anup Patel <anup.patel@....com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        kvm-riscv@...ts.infradead.org, KVM General <kvm@...r.kernel.org>,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] RISC-V: KVM: Fix incorrect KVM_MAX_VCPUS value

On Thu, Nov 18, 2021 at 1:23 PM Atish Patra <atishp@...shpatra.org> wrote:
>
> On Tue, Nov 16, 2021 at 10:03 PM Anup Patel <anup.patel@....com> wrote:
> >
> > The KVM_MAX_VCPUS value is supposed to be aligned with number of
> > VMID bits in the hgatp CSR but the current KVM_MAX_VCPUS value
> > is aligned with number of ASID bits in the satp CSR.
> >
> > Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support")
> > Signed-off-by: Anup Patel <anup.patel@....com>
> > ---
> >  arch/riscv/include/asm/kvm_host.h | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h
> > index 25ba21f98504..2639b9ee48f9 100644
> > --- a/arch/riscv/include/asm/kvm_host.h
> > +++ b/arch/riscv/include/asm/kvm_host.h
> > @@ -12,14 +12,12 @@
> >  #include <linux/types.h>
> >  #include <linux/kvm.h>
> >  #include <linux/kvm_types.h>
> > +#include <asm/csr.h>
> >  #include <asm/kvm_vcpu_fp.h>
> >  #include <asm/kvm_vcpu_timer.h>
> >
> > -#ifdef CONFIG_64BIT
> > -#define KVM_MAX_VCPUS                  (1U << 16)
> > -#else
> > -#define KVM_MAX_VCPUS                  (1U << 9)
> > -#endif
> > +#define KVM_MAX_VCPUS                  \
> > +       ((HGATP_VMID_MASK >> HGATP_VMID_SHIFT) + 1)
> >
> >  #define KVM_HALT_POLL_NS_DEFAULT       500000
> >
> > --
> > 2.25.1
> >
>
>
> Reviewed-by: Atish Patra <atishp@...osinc.com>

I have queued this patch for fixes.

Thanks,
Anup

>
> --
> Regards,
> Atish

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ