From nobody Wed Nov 5 02:13:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1531840224985789.43619058082; Tue, 17 Jul 2018 08:10:24 -0700 (PDT) Received: from localhost ([::1]:59872 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffRcN-0007Oj-Sf for importer@patchew.org; Tue, 17 Jul 2018 11:10:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffRZB-00054k-Md for qemu-devel@nongnu.org; Tue, 17 Jul 2018 11:07:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffRZA-0007CI-IA for qemu-devel@nongnu.org; Tue, 17 Jul 2018 11:07:05 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54078 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ffRZA-0007C3-B0 for qemu-devel@nongnu.org; Tue, 17 Jul 2018 11:07:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F20AE4075789; Tue, 17 Jul 2018 15:07:03 +0000 (UTC) Received: from 640k.localdomain.com (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF1782026D68; Tue, 17 Jul 2018 15:07:02 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 17 Jul 2018 17:06:45 +0200 Message-Id: <1531840015-28804-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1531840015-28804-1-git-send-email-pbonzini@redhat.com> References: <1531840015-28804-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 17 Jul 2018 15:07:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 17 Jul 2018 15:07:04 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 03/13] hyperv: rename vcpu_id to vp_index X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roman Kagan Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Roman Kagan In Hyper-V-related code, vCPUs are identified by their VP (virtual processor) index. Since it's customary for "vcpu_id" in QEMU to mean APIC id, rename the respective variables to "vp_index" to make the distinction clear. Signed-off-by: Roman Kagan Message-Id: <20180702134156.13404-2-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini --- hw/misc/hyperv_testdev.c | 16 ++++++++-------- target/i386/hyperv.c | 6 +++--- target/i386/hyperv.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index dbd7cdd..bf6bbfa 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -57,7 +57,7 @@ static void free_sint_route_index(HypervTestDev *dev, int= i) dev->sint_route[i] =3D NULL; } =20 -static int find_sint_route_index(HypervTestDev *dev, uint32_t vcpu_id, +static int find_sint_route_index(HypervTestDev *dev, uint32_t vp_index, uint32_t sint) { HvSintRoute *sint_route; @@ -65,7 +65,7 @@ static int find_sint_route_index(HypervTestDev *dev, uint= 32_t vcpu_id, =20 for (i =3D 0; i < ARRAY_SIZE(dev->sint_route); i++) { sint_route =3D dev->sint_route[i]; - if (sint_route && sint_route->vcpu_id =3D=3D vcpu_id && + if (sint_route && sint_route->vp_index =3D=3D vp_index && sint_route->sint =3D=3D sint) { return i; } @@ -74,7 +74,7 @@ static int find_sint_route_index(HypervTestDev *dev, uint= 32_t vcpu_id, } =20 static void hv_synic_test_dev_control(HypervTestDev *dev, uint32_t ctl, - uint32_t vcpu_id, uint32_t sint) + uint32_t vp_index, uint32_t sint) { int i; HvSintRoute *sint_route; @@ -83,19 +83,19 @@ static void hv_synic_test_dev_control(HypervTestDev *de= v, uint32_t ctl, case HV_TEST_DEV_SINT_ROUTE_CREATE: i =3D alloc_sint_route_index(dev); assert(i >=3D 0); - sint_route =3D kvm_hv_sint_route_create(vcpu_id, sint, NULL); + sint_route =3D kvm_hv_sint_route_create(vp_index, sint, NULL); assert(sint_route); dev->sint_route[i] =3D sint_route; break; case HV_TEST_DEV_SINT_ROUTE_DESTROY: - i =3D find_sint_route_index(dev, vcpu_id, sint); + i =3D find_sint_route_index(dev, vp_index, sint); assert(i >=3D 0); sint_route =3D dev->sint_route[i]; kvm_hv_sint_route_destroy(sint_route); free_sint_route_index(dev, i); break; case HV_TEST_DEV_SINT_ROUTE_SET_SINT: - i =3D find_sint_route_index(dev, vcpu_id, sint); + i =3D find_sint_route_index(dev, vp_index, sint); assert(i >=3D 0); sint_route =3D dev->sint_route[i]; kvm_hv_sint_route_set_sint(sint_route); @@ -117,8 +117,8 @@ static void hv_test_dev_control(void *opaque, hwaddr ad= dr, uint64_t data, case HV_TEST_DEV_SINT_ROUTE_DESTROY: case HV_TEST_DEV_SINT_ROUTE_SET_SINT: { uint8_t sint =3D data & 0xFF; - uint8_t vcpu_id =3D (data >> 8ULL) & 0xFF; - hv_synic_test_dev_control(dev, ctl, vcpu_id, sint); + uint8_t vp_index =3D (data >> 8ULL) & 0xFF; + hv_synic_test_dev_control(dev, ctl, vp_index, sint); break; } default: diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index a050c9d..7cc0fbb 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -72,7 +72,7 @@ static void kvm_hv_sint_ack_handler(EventNotifier *notifi= er) } } =20 -HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint, +HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, HvSintAckClb sint_ack_clb) { HvSintRoute *sint_route; @@ -92,7 +92,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, u= int32_t sint, event_notifier_set_handler(&sint_route->sint_ack_notifier, kvm_hv_sint_ack_handler); =20 - gsi =3D kvm_irqchip_add_hv_sint_route(kvm_state, vcpu_id, sint); + gsi =3D kvm_irqchip_add_hv_sint_route(kvm_state, vp_index, sint); if (gsi < 0) { goto err_gsi; } @@ -105,7 +105,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id,= uint32_t sint, } sint_route->gsi =3D gsi; sint_route->sint_ack_clb =3D sint_ack_clb; - sint_route->vcpu_id =3D vcpu_id; + sint_route->vp_index =3D vp_index; sint_route->sint =3D sint; =20 return sint_route; diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 0c3b562..eaf3df3 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -23,7 +23,7 @@ typedef void (*HvSintAckClb)(HvSintRoute *sint_route); =20 struct HvSintRoute { uint32_t sint; - uint32_t vcpu_id; + uint32_t vp_index; int gsi; EventNotifier sint_set_notifier; EventNotifier sint_ack_notifier; @@ -32,7 +32,7 @@ struct HvSintRoute { =20 int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit); =20 -HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint, +HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, HvSintAckClb sint_ack_clb); =20 void kvm_hv_sint_route_destroy(HvSintRoute *sint_route); --=20 1.8.3.1