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]
Date:	Wed, 18 May 2016 18:00:08 +0200
From:	Juergen Gross <jgross@...e.com>
To:	Boris Ostrovsky <boris.ostrovsky@...cle.com>,
	David Vrabel <david.vrabel@...rix.com>,
	xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Cc:	sstabellini@...nel.org
Subject: Re: [PATCH] xen: add steal_clock support on x86

On 18/05/16 17:53, Boris Ostrovsky wrote:
> On 05/18/2016 11:45 AM, David Vrabel wrote:
>> On 18/05/16 16:42, Juergen Gross wrote:
>>> On 18/05/16 17:25, Boris Ostrovsky wrote:
>>>> On 05/18/2016 10:53 AM, Juergen Gross wrote:
>>>>> On 18/05/16 16:46, Boris Ostrovsky wrote:
>>>>>> On 05/18/2016 08:15 AM, Juergen Gross wrote:
>>>>>>>  }
>>>>>>>  
>>>>>>> +void __init xen_time_setup_guest(void)
>>>>>>> +{
>>>>>>> +	pv_time_ops.steal_clock = xen_steal_clock;
>>>>>>> +
>>>>>>> +	static_key_slow_inc(&paravirt_steal_enabled);
>>>>>>> +	/*
>>>>>>> +	 * We can't set paravirt_steal_rq_enabled as this would require the
>>>>>>> +	 * capability to read another cpu's runstate info.
>>>>>>> +	 */
>>>>>>> +}
>>>>>> Won't we be accounting for stolen cycles twice now --- once from
>>>>>> steal_account_process_tick()->steal_clock() and second time from
>>>>>> do_stolen_accounting()?
>>>>> Uuh, yes.
>>>>>
>>>>> I guess I should rip do_stolen_accounting() out, too? 
>>>> I don't think PARAVIRT_TIME_ACCOUNTING is always selected for Xen. If
>>> This is easy to accomplish. :-)
> 
> 
> I looked at KVM code (PARAVIRT_TIME_ACCOUNTING is not selected there
> neither) and in their case that's presumably because stealing accounting
> is a CPUID bit, i.e. it might not be supported. In Xen case we always
> have this interface.

So they added it later and the default is to keep the old behavior.

>>>> that's indeed the case then we should ifndef do_stolen_accounting(). Or
>>>> maybe check for paravirt_steal_enabled.
>>> Is this really a sensible thing to do? There is a mechanism used by KVM
>>> to do the stolen accounting. I think we should use it instead of having
>>> a second implementation doing the same thing in case the generic one
>>> isn't enabled.
>> I agree.
>>
>> Although I don't think selecting PARAVIRT_TIME_ACC' is necessary -- I
>> don't think it's essential (or is it?).
> 
> Looks like it's useful only if paravirt_steal_rq_enabled, which we don't
> support yet.

I think the patch is still useful. It is reducing code size and
it is removing arch-specific Xen-hack(s). With the patch Xen's
solution for arm and x86 is common and the same as for KVM. Adding
paravirt_steal_rq_enabled later will be much easier as only one
function needs substantial modification.


Juergen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ