kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Andrew Jones <drjones@redhat.com>
Cc: "Marc Zyngier" <maz@kernel.org>, "Will Deacon" <will@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"James Morse" <james.morse@arm.com>,
	"Julien Thierry" <julien.thierry.kdev@gmail.com>,
	"Suzuki K Pouloze" <suzuki.poulose@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	kvm@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 05/10] KVM: arm64: Support stolen time reporting via shared structure
Date: Fri, 4 Oct 2019 10:13:40 +0100	[thread overview]
Message-ID: <b107c1ca-6804-dc47-af25-fcd0b201472f@arm.com> (raw)
In-Reply-To: <20191004070301.d7ari5rjlu3uuara@kamzik.brq.redhat.com>

On 04/10/2019 08:03, Andrew Jones wrote:
> On Thu, Oct 03, 2019 at 03:22:35PM +0200, Andrew Jones wrote:
>> On Wed, Oct 02, 2019 at 03:50:32PM +0100, Steven Price wrote:
>>> +int kvm_update_stolen_time(struct kvm_vcpu *vcpu, bool init)
>>> +{
>>> +	struct kvm *kvm = vcpu->kvm;
>>> +	u64 steal;
>>> +	u64 steal_le;
>>> +	u64 offset;
>>> +	int idx;
>>> +	u64 base = vcpu->arch.steal.base;
>>> +
>>> +	if (base == GPA_INVALID)
>>> +		return -ENOTSUPP;
>>> +
>>> +	/* Let's do the local bookkeeping */
>>> +	steal = vcpu->arch.steal.steal;
>>> +	steal += current->sched_info.run_delay - vcpu->arch.steal.last_steal;
>>> +	vcpu->arch.steal.last_steal = current->sched_info.run_delay;
>>> +	vcpu->arch.steal.steal = steal;
>>> +
>>> +	steal_le = cpu_to_le64(steal);
>>
>> Agreeing on a byte order for this interface makes sense, but I don't see
>> it documented anywhere. Is this an SMCCC thing? Because I skimmed some
>> of those specs and other users too but didn't see anything obvious. Anyway
>> even if everybody but me knows that all data returned from SMCCC calls
>> should be LE, it might be nice to document that in the pvtime doc.

A very good point - I'll document this in the Linux document and feed
that back for DEN0057A.

> 
> I have another [potentially dumb] SMCCC byte order question. If we need
> to worry about using LE for the members of this structure, then why don't
> we need to worry about the actual return values of the SMCCC calls? Like
> the IPA of the structure?

The SMCCC calls pass values in registers. It's only when reading/writing
these values from/to memory that the endianness actually has any meaning.

Steve

  reply	other threads:[~2019-10-04  9:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 14:50 [PATCH v5 00/10] arm64: Stolen time support Steven Price
2019-10-02 14:50 ` [PATCH v5 01/10] KVM: arm64: Document PV-time interface Steven Price
2019-10-03 12:19   ` Andrew Jones
2019-10-04  9:00     ` Steven Price
2019-10-02 14:50 ` [PATCH v5 02/10] KVM: arm/arm64: Factor out hypercall handling from PSCI code Steven Price
2019-10-03 12:23   ` Andrew Jones
2019-10-02 14:50 ` [PATCH v5 03/10] KVM: arm64: Implement PV_FEATURES call Steven Price
2019-10-02 14:50 ` [PATCH v5 04/10] KVM: Implement kvm_put_guest() Steven Price
2019-10-02 14:50 ` [PATCH v5 05/10] KVM: arm64: Support stolen time reporting via shared structure Steven Price
2019-10-03 13:22   ` Andrew Jones
2019-10-04  7:03     ` Andrew Jones
2019-10-04  9:13       ` Steven Price [this message]
2019-10-04  9:51         ` Andrew Jones
2019-10-02 14:50 ` [PATCH v5 06/10] KVM: Allow kvm_device_ops to be const Steven Price
2019-10-03 13:23   ` Andrew Jones
2019-10-02 14:50 ` [PATCH v5 07/10] KVM: arm64: Provide VCPU attributes for stolen time Steven Price
2019-10-02 14:50 ` [PATCH v5 08/10] arm/arm64: Provide a wrapper for SMCCC 1.1 calls Steven Price
2019-10-02 14:50 ` [PATCH v5 09/10] arm/arm64: Make use of the SMCCC 1.1 wrapper Steven Price
2019-10-02 14:50 ` [PATCH v5 10/10] arm64: Retrieve stolen time as paravirtualized guest Steven Price

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=b107c1ca-6804-dc47-af25-fcd0b201472f@arm.com \
    --to=steven.price@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=drjones@redhat.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=suzuki.poulose@arm.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).