From nobody Mon Feb 9 20:10:17 2026 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; dkim=fail; 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 153989773298778.00716939283745; Thu, 18 Oct 2018 14:22:12 -0700 (PDT) Received: from localhost ([::1]:44780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDFkB-0000Cy-SC for importer@patchew.org; Thu, 18 Oct 2018 17:22:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDEyU-0007Y4-M3 for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDEyQ-0006U8-HY for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:54 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:41685) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDEyQ-0006Tg-AM for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:50 -0400 Received: by mail-wr1-x443.google.com with SMTP id q7-v6so7266343wrr.8 for ; Thu, 18 Oct 2018 13:32:50 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-231-174.clienti.tiscali.it. [78.12.231.174]) by smtp.gmail.com with ESMTPSA id a12-v6sm14270952wrr.71.2018.10.18.13.32.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 13:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Crc8hXh6fuKllNJ5wmjW4kipXdhzcje7NjwDCMhKnrI=; b=eYzpghD5+WI2Y7RXSCgh6PMk9HaZqHygdS8IvG9aEXIU+yQ0sha7xclDeNLV6Y5Em8 TfTnEDqzdO3UeQ3hRF2EeRcAMDLbAcdMDz30jXCx23dUTUtw1OjMcaMOFkyQZ5kR/lKX CFYI3J8X1a4Iu9IJPIe4ccLOkxnC+lhML+QRRmc4XNMZ7LEj9YPORSvSiaRvLd/LjPgr c8uKNRE8shjZoUHJF6Sh0ZtYwTxKesRwYDDR2fdk2DozehIHoqJMRhc7yjOtdPkylY+X TY/lVtkqdBBpPqg2jTikhPBchehGiHs/RoBljp/flqGnDPdC12t+ghyftTqiPQBghazW Ns1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Crc8hXh6fuKllNJ5wmjW4kipXdhzcje7NjwDCMhKnrI=; b=kCCQTfQWJcnSHFIe7B7pDfFQHG74AowqWpp6PfKV6yIYeqN3XT0GNU20Nqkf+2pkh1 I2GKxoVKw7vnojcbZuzdkFDEOCBSLnT30mNnd5wnr+jQVM3jLMIy+DmVbN6rlqvkvusc 35haYte++yhGV+6RfFceB/zRp1cYk0fASfcsJJMkY66Yr9rF048b9mU20HSyk2WdHctb NdmLEcEVT21n2Iu7pUJSFKgj3YZM/Pt8NuU8SyGNwEFZedD5CbVZJ6MbiggpGFMGzdPq evjwbLll6gWKbHwzHF8+jhfTDe4c67erWNI9Bumxj2c+lwkOgWj5xsfPXrCax/LSOQ6g KR3w== X-Gm-Message-State: ABuFfog6r720ROX8JdqOn3jj59aqq0NBmYRcBMwf6V1CMyDtES1yBpA/ ELicB8tJViTPQbObcXDcs7i0V40x X-Google-Smtp-Source: ACcGV60VWFyBckaedG3mpGesH6ICmOrBeZBX10f+s/5PiG3SminGscNhnf+at82BPwjHZROaD0XOlg== X-Received: by 2002:adf:fec9:: with SMTP id q9-v6mr27754908wrs.164.1539894769168; Thu, 18 Oct 2018 13:32:49 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 22:31:56 +0200 Message-Id: <1539894735-14232-30-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1539894735-14232-1-git-send-email-pbonzini@redhat.com> References: <1539894735-14232-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 Subject: [Qemu-devel] [PULL 29/48] hyperv: address HvSintRoute by X86CPU pointer 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-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 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 Use X86CPU pointer to refer to the respective HvSintRoute instead of vp_index. This is more convenient and also paves the way for future enhancements. Signed-off-by: Roman Kagan Message-Id: <20180921081836.29230-7-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini --- target/i386/hyperv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 11fd1ad..0ce8a7a 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -18,7 +18,7 @@ =20 struct HvSintRoute { uint32_t sint; - uint32_t vp_index; + X86CPU *cpu; int gsi; EventNotifier sint_set_notifier; EventNotifier sint_ack_notifier; @@ -97,6 +97,12 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index,= uint32_t sint, HvSintRoute *sint_route; EventNotifier *ack_notifier; int r, gsi; + X86CPU *cpu; + + cpu =3D hyperv_find_vcpu(vp_index); + if (!cpu) { + return NULL; + } =20 sint_route =3D g_new0(HvSintRoute, 1); r =3D event_notifier_init(&sint_route->sint_set_notifier, false); @@ -128,7 +134,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index= , uint32_t sint, sint_route->gsi =3D gsi; sint_route->sint_ack_clb =3D sint_ack_clb; sint_route->sint_ack_clb_data =3D sint_ack_clb_data; - sint_route->vp_index =3D vp_index; + sint_route->cpu =3D cpu; sint_route->sint =3D sint; =20 return sint_route; --=20 1.8.3.1