From nobody Mon Feb 9 13:59:08 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 1539897911110343.23419005112964; Thu, 18 Oct 2018 14:25:11 -0700 (PDT) Received: from localhost ([::1]:44804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDFn2-0003UN-OD for importer@patchew.org; Thu, 18 Oct 2018 17:25:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDEyY-0007bl-9H for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:33:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDEyV-0006Xu-Cc for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:58 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:39911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDEyV-0006Wr-1r for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id 61-v6so35110496wrb.6 for ; Thu, 18 Oct 2018 13:32:54 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 13:32:52 -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=3jMpBjW2RjjaneKFCh4VOi3MYzbeg1SPv8QfUhGFqak=; b=fV00wJTSkJPcPOG6U6XxEMctUqPkOUrOtOSuBeIPX0kgpi6jTlJSpahVmJy5Z34prd FbqY87bI4ng3NgssKuBp8fn1ZknXQA2+Z/8F/TM8XJNZ/k6LcSKqRBSXOi20YE5T2TuT h9r1MrxI6GXPBY/FBbHVc67ZxLiR1TI/30JvSGXQd3tq6Hw/LgcYVADs6KSvGyyoD9XS MuVT3+wDv2jQQCZjakK8XXZpQfNb6bx7Do2lq5eGysMEKEzL2BfnNvgl/4Jbm9mJyfIa 7OOKcNaZe2heI4QzWF0ZSF2C7UTkh6FuZtsaN46MtjE/UOtoCJiqOPuDGv0FxzxZcLMX 64QQ== 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=3jMpBjW2RjjaneKFCh4VOi3MYzbeg1SPv8QfUhGFqak=; b=FI0xo1tZHrJ5ZHq68sJtyiQOPWVSah8+w/Xaw+JsHF30TNuJXNLgt9+weS8kLMRm00 X1jSjGdAJ4Cre3S14XzGe9a8qG/kQqHjAZyNuWsr+vou1yHgA55pAfV0xChvf/4clnno 2BZYh9rrE3HuvOs8GvOrJK0LVZqaYsSyYFTdxhzI/p30Z9944zBCkbANZpoAbDwnwEI+ 54C2WC+MvDA6Nr0b+VubsFoa0xZoONP3mkbmmp0N+PctI0ORMBSdJMrqaB+Ttn4aeCRs toV/VycqgZ5K9p+vP6EJ0Mv03fe0u5HiaQfxF/Et8bnUumc8eHaLVcisxPjlwklvfMaA uyKg== X-Gm-Message-State: ABuFfoi5DNsFgHQck24XLaZjrxvZAkJNjg61HDlo//KTX+jO65DJe2DX DVQgV7ft7MEUX8wvC05kg5tEcjf2 X-Google-Smtp-Source: ACcGV61OoLEa9ZoXkHuTLN4iZZNH+ZPhZo897JoRHj+ntScIR8VdjRuIs0kyqCC3hohQhxNi7oQ/+Q== X-Received: by 2002:adf:92e6:: with SMTP id 93-v6mr32154899wrn.124.1539894773715; Thu, 18 Oct 2018 13:32:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 22:32:00 +0200 Message-Id: <1539894735-14232-34-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::429 Subject: [Qemu-devel] [PULL 33/48] hyperv: make hyperv_vp_index inline 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 Also make the inverse function, hyperv_find_vcpu, static as it's not used outside hyperv.c This paves the way to making hyperv.c built optionally. Signed-off-by: Roman Kagan Message-Id: <20180921082041.29380-3-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini --- target/i386/hyperv.c | 11 ++++------- target/i386/hyperv.h | 6 ++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index fc537e7..6881664 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -27,14 +27,11 @@ struct HvSintRoute { unsigned refcount; }; =20 -uint32_t hyperv_vp_index(X86CPU *cpu) +static X86CPU *hyperv_find_vcpu(uint32_t vp_index) { - return CPU(cpu)->cpu_index; -} - -X86CPU *hyperv_find_vcpu(uint32_t vp_index) -{ - return X86_CPU(qemu_get_cpu(vp_index)); + X86CPU *cpu =3D X86_CPU(qemu_get_cpu(vp_index)); + assert(hyperv_vp_index(cpu) =3D=3D vp_index); + return cpu; } =20 int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 59e9f9a..8d4619c 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -30,7 +30,9 @@ void hyperv_sint_route_unref(HvSintRoute *sint_route); =20 int hyperv_sint_route_set_sint(HvSintRoute *sint_route); =20 -uint32_t hyperv_vp_index(X86CPU *cpu); -X86CPU *hyperv_find_vcpu(uint32_t vp_index); +static inline uint32_t hyperv_vp_index(X86CPU *cpu) +{ + return CPU(cpu)->cpu_index; +} =20 #endif --=20 1.8.3.1