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:   Tue, 14 Feb 2023 07:38:07 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Tianrui Zhao <zhaotianrui@...ngson.cn>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Huacai Chen <chenhuacai@...nel.org>,
        WANG Xuerui <kernel@...0n.name>, loongarch@...ts.linux.dev,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        Jens Axboe <axboe@...nel.dk>, Mark Brown <broonie@...nel.org>,
        Alex Deucher <alexander.deucher@....com>
Subject: Re: [PATCH v1 01/24] LoongArch: KVM: Implement kvm module related
 interface

On Tue, Feb 14, 2023 at 10:56:25AM +0800, Tianrui Zhao wrote:
> 1. Implement loongarch kvm module init, module exit interface,
> using kvm context to save the vpid info and vcpu world switch
> interface pointer.
> 2. Implement kvm hardware enable, disable interface, setting
> the guest config reg to enable virtualization features.
> 3. Add kvm related headers.

Shouldn't this be 3 different patches instead?

> 
> Signed-off-by: Tianrui Zhao <zhaotianrui@...ngson.cn>
> ---
>  arch/loongarch/include/asm/cpu-features.h |  22 ++
>  arch/loongarch/include/asm/kvm_host.h     | 257 ++++++++++++++++++++++
>  arch/loongarch/include/asm/kvm_types.h    |  11 +
>  arch/loongarch/include/uapi/asm/kvm.h     | 121 ++++++++++
>  arch/loongarch/kvm/main.c                 | 152 +++++++++++++
>  include/uapi/linux/kvm.h                  |  15 ++
>  6 files changed, 578 insertions(+)
>  create mode 100644 arch/loongarch/include/asm/kvm_host.h
>  create mode 100644 arch/loongarch/include/asm/kvm_types.h
>  create mode 100644 arch/loongarch/include/uapi/asm/kvm.h
>  create mode 100644 arch/loongarch/kvm/main.c
> 
> diff --git a/arch/loongarch/include/asm/cpu-features.h b/arch/loongarch/include/asm/cpu-features.h
> index b07974218..23e7c3ae5 100644
> --- a/arch/loongarch/include/asm/cpu-features.h
> +++ b/arch/loongarch/include/asm/cpu-features.h
> @@ -64,5 +64,27 @@
>  #define cpu_has_guestid		cpu_opt(LOONGARCH_CPU_GUESTID)
>  #define cpu_has_hypervisor	cpu_opt(LOONGARCH_CPU_HYPERVISOR)
>  
> +#define cpu_has_matc_guest	(cpu_data[0].guest_cfg & (1 << 0))
> +#define cpu_has_matc_root	(cpu_data[0].guest_cfg & (1 << 1))
> +#define cpu_has_matc_nest	(cpu_data[0].guest_cfg & (1 << 2))
> +#define cpu_has_sitp		(cpu_data[0].guest_cfg & (1 << 6))
> +#define cpu_has_titp		(cpu_data[0].guest_cfg & (1 << 8))
> +#define cpu_has_toep		(cpu_data[0].guest_cfg & (1 << 10))
> +#define cpu_has_topp		(cpu_data[0].guest_cfg & (1 << 12))
> +#define cpu_has_torup		(cpu_data[0].guest_cfg & (1 << 14))
> +#define cpu_has_gcip_all	(cpu_data[0].guest_cfg & (1 << 16))
> +#define cpu_has_gcip_hit	(cpu_data[0].guest_cfg & (1 << 17))
> +#define cpu_has_gcip_secure	(cpu_data[0].guest_cfg & (1 << 18))

Why not use BIT() for all of those "<<" statements?

> +#define KVM_GET_CSRS		_IOWR(KVMIO, 0xc5, struct kvm_csrs)
> +#define KVM_SET_CSRS		_IOW(KVMIO,  0xc6, struct kvm_csrs)

Why does this arch need new ioctls?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ