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: <83ed7fac-277f-a31e-af37-8ec134f39d26@redhat.com>
Date:   Wed, 18 Sep 2019 10:25:37 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Jianyong Wu <jianyong.wu@....com>, netdev@...r.kernel.org,
        yangbo.lu@....com, john.stultz@...aro.org, tglx@...utronix.de,
        sean.j.christopherson@...el.com, maz@...nel.org,
        richardcochran@...il.com, Mark.Rutland@....com,
        Will.Deacon@....com, suzuki.poulose@....com
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        Steve.Capper@....com, Kaly.Xin@....com, justin.he@....com,
        nd@....com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm.

On 18/09/19 10:07, Jianyong Wu wrote:
> +	case ARM_SMCCC_VENDOR_HYP_KVM_PTP_FUNC_ID:
> +		getnstimeofday(ts);

This is not Y2038-safe.  Please use ktime_get_real_ts64 instead, and
split the 64-bit seconds value between val[0] and val[1].

However, it seems to me that the new function is not needed and you can
just use ktime_get_snapshot.  You'll get the time in
systime_snapshot->real and the cycles value in systime_snapshot->cycles.

> +		get_current_counterval(&sc);
> +		val[0] = ts->tv_sec;
> +		val[1] = ts->tv_nsec;
> +		val[2] = sc.cycles;
> +		val[3] = 0;
> +		break;

This should return a guest-cycles value.  If the cycles values always
the same between the host and the guest on ARM, then okay.  If not, you
have to apply whatever offset exists.

Thanks,

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ