2016-11-23 12:38:56

by Vitaly Kuznetsov

[permalink] [raw]
Subject: [PATCH KERNEL] xen/events: use xen_vcpu_id mapping for EVTCHNOP_status

EVTCHNOP_status hypercall returns Xen's idea of vcpu id so we need to
compare it against xen_vcpu_id mapping, not the Linux cpu id.

Suggested-by: Radim Krcmar <[email protected]>
Signed-off-by: Vitaly Kuznetsov <[email protected]>
---
drivers/xen/events/events_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 9ecfcdc..137bd0e 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -948,7 +948,7 @@ static int find_virq(unsigned int virq, unsigned int cpu)
continue;
if (status.status != EVTCHNSTAT_virq)
continue;
- if (status.u.virq == virq && status.vcpu == cpu) {
+ if (status.u.virq == virq && status.vcpu == xen_vcpu_nr(cpu)) {
rc = port;
break;
}
--
2.7.4


2016-11-23 16:14:54

by Boris Ostrovsky

[permalink] [raw]
Subject: Re: [PATCH KERNEL] xen/events: use xen_vcpu_id mapping for EVTCHNOP_status

On 11/23/2016 07:38 AM, Vitaly Kuznetsov wrote:
> EVTCHNOP_status hypercall returns Xen's idea of vcpu id so we need to
> compare it against xen_vcpu_id mapping, not the Linux cpu id.
>
> Suggested-by: Radim Krcmar <[email protected]>
> Signed-off-by: Vitaly Kuznetsov <[email protected]>

Reviewed-by: Boris Ostrovsky <[email protected]>


> ---
> drivers/xen/events/events_base.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
> index 9ecfcdc..137bd0e 100644
> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -948,7 +948,7 @@ static int find_virq(unsigned int virq, unsigned int cpu)
> continue;
> if (status.status != EVTCHNSTAT_virq)
> continue;
> - if (status.u.virq == virq && status.vcpu == cpu) {
> + if (status.u.virq == virq && status.vcpu == xen_vcpu_nr(cpu)) {
> rc = port;
> break;
> }

2016-11-30 06:46:53

by Jürgen Groß

[permalink] [raw]
Subject: Re: [PATCH KERNEL] xen/events: use xen_vcpu_id mapping for EVTCHNOP_status

On 23/11/16 13:38, Vitaly Kuznetsov wrote:
> EVTCHNOP_status hypercall returns Xen's idea of vcpu id so we need to
> compare it against xen_vcpu_id mapping, not the Linux cpu id.
>
> Suggested-by: Radim Krcmar <[email protected]>
> Signed-off-by: Vitaly Kuznetsov <[email protected]>

Applied to xen/tip.git for-linus-4.10


Juergen