* [Xen-devel] [BUG] xenstat_vcpu_ns returns invalid value
@ 2020-01-09 19:40 Richard Kojedzinszky
2020-01-09 19:50 ` Andrew Cooper
0 siblings, 1 reply; 5+ messages in thread
From: Richard Kojedzinszky @ 2020-01-09 19:40 UTC (permalink / raw)
To: xen-devel
Dear Xen Devs,
commit 2529c850ea48f036727ca2f148caed89391311b8 introduces the
XEN_RUNSTATE_UPDATE marker bit, which is not handled in
vcpu_runstate_get() in xen/common/schedule.c. Relevant code:
delta = NOW() - runstate->state_entry_time;
if ( delta > 0 )
runstate->time[runstate->state] += delta;
If state_entry_time has the bit set, it will be a negative value, so
delta will be greater than 0, actually the marker bit
will appear in runstate->time too. This causes the MSB bit set in the
return of xenstat_vcpu_ns(). Is it true, that when reading these values
through xenstat, the user should take care of this bit, and reread, or
is it a bug in the relevant code?
I am using xenstat.h interface, where I can only request statistics for
the whole node. So, basically, walking through all vcpu of all domain,
and checking that no one
contains this bit seems a bit ugly solution.
Thanks in advance,
Richard Kojedzinszky
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] [BUG] xenstat_vcpu_ns returns invalid value
2020-01-09 19:40 [Xen-devel] [BUG] xenstat_vcpu_ns returns invalid value Richard Kojedzinszky
@ 2020-01-09 19:50 ` Andrew Cooper
2020-01-09 20:09 ` Richard Kojedzinszky
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2020-01-09 19:50 UTC (permalink / raw)
To: Richard Kojedzinszky, xen-devel
On 09/01/2020 19:40, Richard Kojedzinszky wrote:
> Dear Xen Devs,
>
> commit 2529c850ea48f036727ca2f148caed89391311b8 introduces the
> XEN_RUNSTATE_UPDATE marker bit, which is not handled in
> vcpu_runstate_get() in xen/common/schedule.c. Relevant code:
>
> delta = NOW() - runstate->state_entry_time;
> if ( delta > 0 )
> runstate->time[runstate->state] += delta;
That was found and fixed a while ago. c/s f28c4c4c10 "sched: don't let
XEN_RUNSTATE_UPDATE leak into vcpu_runstate_get()".
No changes in userspace should be necessary, although you might need to
pester your distro for backports.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] [BUG] xenstat_vcpu_ns returns invalid value
2020-01-09 19:50 ` Andrew Cooper
@ 2020-01-09 20:09 ` Richard Kojedzinszky
2020-01-09 20:10 ` Andrew Cooper
0 siblings, 1 reply; 5+ messages in thread
From: Richard Kojedzinszky @ 2020-01-09 20:09 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel
2020-01-09 20:50 időpontban Andrew Cooper ezt írta:
> On 09/01/2020 19:40, Richard Kojedzinszky wrote:
>> Dear Xen Devs,
>>
>> commit 2529c850ea48f036727ca2f148caed89391311b8 introduces the
>> XEN_RUNSTATE_UPDATE marker bit, which is not handled in
>> vcpu_runstate_get() in xen/common/schedule.c. Relevant code:
>>
>> delta = NOW() - runstate->state_entry_time;
>> if ( delta > 0 )
>> runstate->time[runstate->state] += delta;
>
> That was found and fixed a while ago. c/s f28c4c4c10 "sched: don't let
> XEN_RUNSTATE_UPDATE leak into vcpu_runstate_get()".
>
> No changes in userspace should be necessary, although you might need to
> pester your distro for backports.
>
> ~Andrew
Hi,
Thanks for the quick reply,
Then, as it is just a leak, until a backport arrives to my distro, I can
mask out that bit from the results with no other side-effects, am I
right?
Regards,
Richard Kojedzinszky
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] [BUG] xenstat_vcpu_ns returns invalid value
2020-01-09 20:09 ` Richard Kojedzinszky
@ 2020-01-09 20:10 ` Andrew Cooper
2020-01-09 20:14 ` Richard Kojedzinszky
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2020-01-09 20:10 UTC (permalink / raw)
To: Richard Kojedzinszky; +Cc: xen-devel
On 09/01/2020 20:09, Richard Kojedzinszky wrote:
> 2020-01-09 20:50 időpontban Andrew Cooper ezt írta:
>> On 09/01/2020 19:40, Richard Kojedzinszky wrote:
>>> Dear Xen Devs,
>>>
>>> commit 2529c850ea48f036727ca2f148caed89391311b8 introduces the
>>> XEN_RUNSTATE_UPDATE marker bit, which is not handled in
>>> vcpu_runstate_get() in xen/common/schedule.c. Relevant code:
>>>
>>> delta = NOW() - runstate->state_entry_time;
>>> if ( delta > 0 )
>>> runstate->time[runstate->state] += delta;
>>
>> That was found and fixed a while ago. c/s f28c4c4c10 "sched: don't let
>> XEN_RUNSTATE_UPDATE leak into vcpu_runstate_get()".
>>
>> No changes in userspace should be necessary, although you might need to
>> pester your distro for backports.
>>
>> ~Andrew
>
> Hi,
>
> Thanks for the quick reply,
>
> Then, as it is just a leak, until a backport arrives to my distro, I
> can mask out that bit from the results with no other side-effects, am
> I right?
Yes - that should be safe.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] [BUG] xenstat_vcpu_ns returns invalid value
2020-01-09 20:10 ` Andrew Cooper
@ 2020-01-09 20:14 ` Richard Kojedzinszky
0 siblings, 0 replies; 5+ messages in thread
From: Richard Kojedzinszky @ 2020-01-09 20:14 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel
2020-01-09 21:10 időpontban Andrew Cooper ezt írta:
> On 09/01/2020 20:09, Richard Kojedzinszky wrote:
>> 2020-01-09 20:50 időpontban Andrew Cooper ezt írta:
>>> On 09/01/2020 19:40, Richard Kojedzinszky wrote:
>>>> Dear Xen Devs,
>>>>
>>>> commit 2529c850ea48f036727ca2f148caed89391311b8 introduces the
>>>> XEN_RUNSTATE_UPDATE marker bit, which is not handled in
>>>> vcpu_runstate_get() in xen/common/schedule.c. Relevant code:
>>>>
>>>> delta = NOW() - runstate->state_entry_time;
>>>> if ( delta > 0 )
>>>> runstate->time[runstate->state] += delta;
>>>
>>> That was found and fixed a while ago. c/s f28c4c4c10 "sched: don't
>>> let
>>> XEN_RUNSTATE_UPDATE leak into vcpu_runstate_get()".
>>>
>>> No changes in userspace should be necessary, although you might need
>>> to
>>> pester your distro for backports.
>>>
>>> ~Andrew
>>
>> Hi,
>>
>> Thanks for the quick reply,
>>
>> Then, as it is just a leak, until a backport arrives to my distro, I
>> can mask out that bit from the results with no other side-effects, am
>> I right?
>
> Yes - that should be safe.
>
> ~Andrew
Hi,
Many thanks, I will do that.
Regards,
Richard
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-09 20:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 19:40 [Xen-devel] [BUG] xenstat_vcpu_ns returns invalid value Richard Kojedzinszky
2020-01-09 19:50 ` Andrew Cooper
2020-01-09 20:09 ` Richard Kojedzinszky
2020-01-09 20:10 ` Andrew Cooper
2020-01-09 20:14 ` Richard Kojedzinszky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.