public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Tianrui Zhao <zhaotianrui@loongson.cn>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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: Thu, 16 Feb 2023 19:34:36 +0000	[thread overview]
Message-ID: <Y+6FTC1vBeZoZx8V@linux.dev> (raw)
In-Reply-To: <a44fc722-e3e2-7f8a-0454-f27a8a10d52b@loongson.cn>

On Tue, Feb 14, 2023 at 09:00:50PM +0800, Tianrui Zhao wrote:
> 在 2023年02月14日 17:58, Greg Kroah-Hartman 写道:
> > On Tue, Feb 14, 2023 at 05:00:56PM +0800, Tianrui Zhao wrote:
> > > > > +#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?
> > > We want to use this ioctl to access multiple csrs at one time. If without
> > > this, we only access one csr.
> > What is wrong with accessing only one csr at a time?  Isn't this what
> > other architectures do?
> 
> Generally, using KVM_GET_ONE_GET ioctl to get one reg, but we want a
> more convenient interface to get serial regs at one time, so we add this
> ioctl.

Have you found register accesses through the KVM_{GET,SET}_ONE_REG
ioctls to actually be a bounding issue? I'd be surprised if that were
actually the case.

An architecture-neutral implementation was entertained a few years ago
[*], but even then it saved an inconsequential amount of time relative
to the rest of VM serialization (at least for arm64). The one thing that
series got right was to share the plumbing across all architectures that
use the ONE_REG interface (i.e. everyone but x86).

If you have data that supports the thesis that a batched ioctl is
useful then please do share. But in any case this should not use an ioctl
tied down to a single architecture.

[*] https://lore.kernel.org/kvm/20201120125616.14436-1-darkhan@amazon.com/

-- 
Thanks,
Oliver

  reply	other threads:[~2023-02-16 19:34 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
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 [this message]
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+6FTC1vBeZoZx8V@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=alexander.deucher@amd.com \
    --cc=axboe@kernel.dk \
    --cc=broonie@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=gregkh@linuxfoundation.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