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] [thread-next>] [day] [month] [year] [list]
Message-ID: <HE1PR0802MB2555E9997B3DD956430F9185F4FB0@HE1PR0802MB2555.eurprd08.prod.outlook.com>
Date:   Tue, 24 Nov 2020 05:11:52 +0000
From:   Jianyong Wu <Jianyong.Wu@....com>
To:     Marc Zyngier <maz@...nel.org>
CC:     Justin He <Justin.He@....com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "richardcochran@...il.com" <richardcochran@...il.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
        Steven Price <Steven.Price@....com>,
        Andre Przywara <Andre.Przywara@....com>,
        "john.stultz@...aro.org" <john.stultz@...aro.org>,
        "yangbo.lu@....com" <yangbo.lu@....com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>, nd <nd@....com>,
        "will@...nel.org" <will@...nel.org>,
        "kvmarm@...ts.cs.columbia.edu" <kvmarm@...ts.cs.columbia.edu>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH v15 6/9] arm64/kvm: Add hypercall service for kvm ptp.

Hi Marc,

> -----Original Message-----
> From: Marc Zyngier <maz@...nel.org>
> Sent: Monday, November 23, 2020 7:59 PM
> To: Jianyong Wu <Jianyong.Wu@....com>
> Cc: Justin He <Justin.He@....com>; kvm@...r.kernel.org;
> netdev@...r.kernel.org; richardcochran@...il.com; linux-
> kernel@...r.kernel.org; sean.j.christopherson@...el.com; Steven Price
> <Steven.Price@....com>; Andre Przywara <Andre.Przywara@....com>;
> john.stultz@...aro.org; yangbo.lu@....com; pbonzini@...hat.com;
> tglx@...utronix.de; nd <nd@....com>; will@...nel.org;
> kvmarm@...ts.cs.columbia.edu; linux-arm-kernel@...ts.infradead.org
> Subject: Re: [PATCH v15 6/9] arm64/kvm: Add hypercall service for kvm ptp.
> 
> On 2020-11-23 10:44, Marc Zyngier wrote:
> > On 2020-11-11 06:22, Jianyong Wu wrote:
> >> ptp_kvm will get this service through SMCC call.
> >> The service offers wall time and cycle count of host to guest.
> >> The caller must specify whether they want the host cycle count or the
> >> difference between host cycle count and cntvoff.
> >>
> >> Signed-off-by: Jianyong Wu <jianyong.wu@....com>
> >> ---
> >>  arch/arm64/kvm/hypercalls.c | 61
> >> +++++++++++++++++++++++++++++++++++++
> >>  include/linux/arm-smccc.h   | 17 +++++++++++
> >>  2 files changed, 78 insertions(+)
> >>
> >> diff --git a/arch/arm64/kvm/hypercalls.c
> >> b/arch/arm64/kvm/hypercalls.c index b9d8607083eb..f7d189563f3d
> 100644
> >> --- a/arch/arm64/kvm/hypercalls.c
> >> +++ b/arch/arm64/kvm/hypercalls.c
> >> @@ -9,6 +9,51 @@
> >>  #include <kvm/arm_hypercalls.h>
> >>  #include <kvm/arm_psci.h>
> >>
> >> +static void kvm_ptp_get_time(struct kvm_vcpu *vcpu, u64 *val) {
> >> +	struct system_time_snapshot systime_snapshot;
> >> +	u64 cycles = ~0UL;
> >> +	u32 feature;
> >> +
> >> +	/*
> >> +	 * system time and counter value must captured in the same
> >> +	 * time to keep consistency and precision.
> >> +	 */
> >> +	ktime_get_snapshot(&systime_snapshot);
> >> +
> >> +	// binding ptp_kvm clocksource to arm_arch_counter
> >> +	if (systime_snapshot.cs_id != CSID_ARM_ARCH_COUNTER)
> >> +		return;
> >> +
> >> +	val[0] = upper_32_bits(systime_snapshot.real);
> >> +	val[1] = lower_32_bits(systime_snapshot.real);
> >
> > What is the endianness of these values? I can't see it defined
> > anywhere, and this is likely not to work if guest and hypervisor don't
> > align.
> 
> Scratch that. This is all passed via registers, so the endianness of the data is
> irrelevant. Please discard any comment about endianness I made in this
> review.
> 
Yeah, these data process and transfer are no relationship with endianness. Thanks.

> The documentation aspect still requires to be beefed up.

So the endianness description will be "no endianness restriction".

Thanks 
Jianyong

> 
> Thanks,
> 
>          M.
> --
> Jazz is not dead. It just smells funny...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ