diff mbox

[KERNEL] xen/events: use xen_vcpu_id mapping for EVTCHNOP_status

Message ID 1479904725-12812-1-git-send-email-vkuznets@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vitaly Kuznetsov Nov. 23, 2016, 12:38 p.m. UTC
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 <rkrcmar@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 drivers/xen/events/events_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Boris Ostrovsky Nov. 23, 2016, 4:17 p.m. UTC | #1
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 <rkrcmar@redhat.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>


> ---
>  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;
>  		}
Jürgen Groß Nov. 30, 2016, 6:46 a.m. UTC | #2
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 <rkrcmar@redhat.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

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


Juergen
diff mbox

Patch

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;
 		}