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] [day] [month] [year] [list]
Message-ID: <20191004095116.a6bi46y76chik3kd@kamzik.brq.redhat.com>
Date:   Fri, 4 Oct 2019 11:51:16 +0200
From:   Andrew Jones <drjones@...hat.com>
To:     Steven Price <steven.price@....com>
Cc:     Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
        Catalin Marinas <catalin.marinas@....com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        Russell King <linux@...linux.org.uk>,
        James Morse <james.morse@....com>,
        Julien Thierry <julien.thierry.kdev@...il.com>,
        Suzuki K Pouloze <suzuki.poulose@....com>,
        Mark Rutland <mark.rutland@....com>, kvm@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 05/10] KVM: arm64: Support stolen time reporting via
 shared structure

On Fri, Oct 04, 2019 at 10:13:40AM +0100, Steven Price wrote:
> 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.
>

Ah yes, of course.

Thanks,
drew 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ