From: Sebastian Ene <sebastianene@google.com>
To: Marc Zyngier <maz@kernel.org>
Cc: kvm@vger.kernel.org, qperret@google.com, will@kernel.org,
julien.thierry.kdev@gmail.com
Subject: Re: [PATCH kvmtool v7 2/3] aarch64: Add stolen time support
Date: Mon, 7 Mar 2022 11:46:20 +0000 [thread overview]
Message-ID: <YiXwjCjcJbgaY10x@google.com> (raw)
In-Reply-To: <87pmn22ac7.wl-maz@kernel.org>
On Thu, Mar 03, 2022 at 05:51:36PM +0000, Marc Zyngier wrote:
> On Thu, 03 Mar 2022 12:01:10 +0000,
> Sebastian Ene <sebastianene@google.com> wrote:
Hi,
> >
> > > > +int kvm_cpu__setup_pvtime(struct kvm_cpu *vcpu)
> > > > +{
> > > > + int ret;
> > > > + bool has_stolen_time;
> > > > + u64 pvtime_guest_addr = ARM_PVTIME_MMIO_BASE + vcpu->cpu_id *
> > > > + ARM_PVTIME_STRUCT_SIZE;
> > > > + struct kvm_config *kvm_cfg = NULL;
> > > > + struct kvm_device_attr pvtime_attr = (struct kvm_device_attr) {
> > > > + .group = KVM_ARM_VCPU_PVTIME_CTRL,
> > > > + .addr = KVM_ARM_VCPU_PVTIME_IPA
> > > > + };
> > > > +
> > > > + kvm_cfg = &vcpu->kvm->cfg;
> > > > + if (kvm_cfg->no_pvtime)
> > > > + return 0;
> > > > +
> > > > + if (!pvtime_data.is_supported)
> > > > + return -ENOTSUP;
> > >
> > > It is a bit odd to have this hard failure if running on a system that
> > > doesn't have pvtime. It forces the user to alter their command-line,
> > > which is a bit annoying. I'd rather have a soft-fail here.
> > >
> >
> > The flag 'is_supported' is set to false when we support pvtime but we
> > fail to configure it. We verify that we support pvtime by calling the check
> > extension KVM_CAP_STEAL_TIME. I think the naming is odd here for the
> > flag name. It should be : 'is_failed_cfg'.
>
> Ah, I see. Yes, the name is misleading.
>
I will update the name for this to: 'is_failed_cfg'.
> >
> > > > +
> > > > + has_stolen_time = kvm__supports_extension(vcpu->kvm,
> > > > + KVM_CAP_STEAL_TIME);
> > > > + if (!has_stolen_time)
> > > > + return 0;
>
> Here, you could force no_pvtime to 1, and avoid checking for each vcpu
> once you detected that the host is not equipped to deal with it.
>
Good point ! I will do this.
Thanks,
Sebastian
> Thanks,
>
> M.
>
> --
> Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2022-03-07 11:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 14:07 [PATCH kvmtool v7 0/3] aarch64: Add stolen time support Sebastian Ene
2022-03-02 14:07 ` [PATCH kvmtool v7 1/3] aarch64: Populate the vCPU struct before target->init() Sebastian Ene
2022-03-02 14:21 ` Marc Zyngier
2022-03-02 14:07 ` [PATCH kvmtool v7 2/3] aarch64: Add stolen time support Sebastian Ene
2022-03-02 14:41 ` Marc Zyngier
2022-03-03 12:01 ` Sebastian Ene
2022-03-03 17:51 ` Marc Zyngier
2022-03-07 11:46 ` Sebastian Ene [this message]
2022-03-07 10:52 ` Alexandru Elisei
2022-03-07 11:46 ` Alexandru Elisei
2022-03-07 14:55 ` Sebastian Ene
2022-03-02 14:07 ` [PATCH kvmtool v7 3/3] Add --no-pvtime command line argument Sebastian Ene
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=YiXwjCjcJbgaY10x@google.com \
--to=sebastianene@google.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=maz@kernel.org \
--cc=qperret@google.com \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).