From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tianrui Zhao <zhaotianrui@loongson.cn>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
Mark Brown <broonie@kernel.org>,
Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH v1 01/24] LoongArch: KVM: Implement kvm module related interface
Date: Tue, 14 Feb 2023 07:38:07 +0100 [thread overview]
Message-ID: <Y+ssT+W27GxDRAAZ@kroah.com> (raw)
In-Reply-To: <20230214025648.1898508-2-zhaotianrui@loongson.cn>
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@loongson.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
next prev parent reply other threads:[~2023-02-14 6:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 2:56 [PATCH v1 00/24] Add KVM LoongArch support Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 01/24] LoongArch: KVM: Implement kvm module related interface Tianrui Zhao
2023-02-14 6:38 ` Greg Kroah-Hartman [this message]
2023-02-14 9:00 ` Tianrui Zhao
2023-02-14 9:58 ` Greg Kroah-Hartman
2023-02-14 13:00 ` Tianrui Zhao
2023-02-16 19:34 ` Oliver Upton
2023-02-17 1:27 ` Tianrui Zhao
2023-02-17 1:33 ` maobibo
2023-02-14 13:05 ` maobibo
2023-02-14 2:56 ` [PATCH v1 02/24] LoongArch: KVM: Implement VM related functions Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 03/24] LoongArch: KVM: Implement vcpu create,run,destroy operations Tianrui Zhao
2023-02-14 6:40 ` Greg Kroah-Hartman
2023-02-14 9:03 ` Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 04/24] LoongArch: KVM: Implement vcpu get, vcpu set registers Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 05/24] LoongArch: KVM: Implement vcpu ENABLE_CAP, CHECK_EXTENSION ioctl interface Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 06/24] LoongArch: KVM: Implement fpu related operations for vcpu Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 07/24] LoongArch: KVM: Implement vcpu interrupt operations Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 08/24] LoongArch: KVM: Implement misc vcpu related interfaces Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 09/24] LoongArch: KVM: Implement vcpu load and vcpu put operations Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 10/24] LoongArch: KVM: Implement vcpu status description Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 11/24] LoongArch: KVM: Implement update VM id function Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 12/24] LoongArch: KVM: Implement virtual machine tlb operations Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 13/24] LoongArch: KVM: Implement vcpu timer operations Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 14/24] LoongArch: KVM: Implement kvm mmu operations Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 15/24] LoongArch: KVM: Implement handle csr excption Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 16/24] LoongArch: KVM: Implement handle iocsr exception Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 17/24] LoongArch: KVM: Implement handle idle exception Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 18/24] LoongArch: KVM: Implement handle gspr exception Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 19/24] LoongArch: KVM: Implement handle mmio exception Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 20/24] LoongArch: KVM: Implement handle fpu exception Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 21/24] LoongArch: KVM: Implement kvm exception vector Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 22/24] LoongArch: KVM: Implement vcpu world switch Tianrui Zhao
2023-02-14 7:07 ` kernel test robot
2023-02-14 2:56 ` [PATCH v1 23/24] LoongArch: KVM: Implement probe virtualization when loongarch cpu init Tianrui Zhao
2023-02-14 2:56 ` [PATCH v1 24/24] LoongArch: KVM: Enable kvm config and add the makefile Tianrui Zhao
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=Y+ssT+W27GxDRAAZ@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=alexander.deucher@amd.com \
--cc=axboe@kernel.dk \
--cc=broonie@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=pbonzini@redhat.com \
--cc=zhaotianrui@loongson.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox