From nobody Mon Feb 9 09:09:00 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1579724688; cv=none; d=zohomail.com; s=zohoarc; b=X4no9cbcI7dZzA4/RlhpWDS4GgNQgbrlyYG5LFbk0E4xYXIfFpPG7vPbl1UOGD2lH1kge221ewXGimGmER40ZF8CJH0ZF5Y12e+/KWQSQ87KnDFx+YhSQENaQiQxGqYlghKKPjeFkkAdT2qmQiVnT4961fZlPbmGKGct78u9pGA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579724688; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6i+f4nSb5pe5T1uaNpqfAbgsfKhXrgdRmIclNyoWEoY=; b=JOKcM5xIC8r/7alqNhiFZTmJUiYaUl+ExgfQdSfJx82rL8ebhBAcoIA61AiRxbEjdJm7FjMtTAFR+IXeBl5646Nxw9h60xgot7ri07MtPmtdl6qTEEhNifQIiwkjwZ75kDlfMX5pIQjssbd2R5LtOIZiWkzFJdz4sYK72yKOoHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1579724688346155.58329822104156; Wed, 22 Jan 2020 12:24:48 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iuMXy-0006Ny-Us; Wed, 22 Jan 2020 20:24:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iuMXy-0006NU-0H for xen-devel@lists.xenproject.org; Wed, 22 Jan 2020 20:24:18 +0000 Received: from mail-wr1-x441.google.com (unknown [2a00:1450:4864:20::441]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1b43a186-3d55-11ea-8e9a-bc764e2007e4; Wed, 22 Jan 2020 20:23:53 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id g17so528341wro.2 for ; Wed, 22 Jan 2020 12:23:53 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id r6sm60267992wrq.92.2020.01.22.12.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 12:23:51 -0800 (PST) X-Inumbo-ID: 1b43a186-3d55-11ea-8e9a-bc764e2007e4 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 :mime-version:content-transfer-encoding; bh=BC91hdyPWV2hM/+wf0AJs+FRr6HNGJISWFhaN0f9Tb0=; b=AqG8fBZPBYp8jfoKXSZCsN7epFOY5v1w1Sa8ukbc/KRcnw+8Y0iCtlLfPHukMrxsR8 7Tg+g0RTIVCdvr1DyjVAKduyBqGHQC/jGvGM4zLd6trMoUFWGyzu0TDreHCPUz0926c8 MFElRQPtJE4IC9Tn0upJPkm+BOlAoosqpFTiGqexfiUfjYPh6Qv2r85iaE7CKKbieI2T l9mfdBt4a7pKHXYtO5RCV75aTGVxxHaoOaBA4hRMKpDLuTC0qWN2IVDLo5qX0lVe1d2q uGGXwerQKD44cz4+HMOQtnY8lXiUCeB/c3cO76abhRm+UozcFuEZ8WmHIZwtF0OEcs9J LFIw== 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:mime-version:content-transfer-encoding; bh=BC91hdyPWV2hM/+wf0AJs+FRr6HNGJISWFhaN0f9Tb0=; b=PQ/zurYpf/Y4nXPhvwxwFD+8Lmf393zZ4cZVfLJtgm3n2KDlvUeM+1wjwbpS6hBTOp RfxUvxcEsLwLkvsdvMc7hXoiS4gsqwJKQCN9yGNGI7z1DqA7NA6YqV+15LLkiy2jWoo8 Lw85nJqKVNKTBD0ePX4ELqxTlneM4Mn5M2CHiR0YEgvjmGKDarE9xSMECxD/dlTDnyUT YH/7zX+MbiwcsAUNj5aIpqWXaxXvfG2AsJlnIjHcEsugsVpHhOC+H5bL+ZjnPmEGNWY9 UxwiursGS6ljiqzXDOOCHIosV9yJ3w9eU8Bks6VsIc2UxAlvidRKhiFwo9ooXL4p8tfA HZDg== X-Gm-Message-State: APjAAAViPLb5oqT/Yo9Fudp2IIdprv4uZBfDsSfthZwE45Wn7OtgK8qA CSy5eLPY7kTk1/Fqn6O4c4+R8dU/j1fJ6w== X-Google-Smtp-Source: APXvYqwk6HQpf+44L7I2MA22dHt5tir2BvnV1QjBKthOuxwqexeCAGNnBdYOsvYCBn4ao7WqLwa2ag== X-Received: by 2002:a5d:46c1:: with SMTP id g1mr12965981wrs.200.1579724632194; Wed, 22 Jan 2020 12:23:52 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Wed, 22 Jan 2020 20:23:42 +0000 Message-Id: <20200122202343.5703-7-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122202343.5703-1-liuwe@microsoft.com> References: <20200122202343.5703-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 6/7] x86/hyperv: retrieve vp_index from Hyper-V X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Paul Durrant , Andrew Cooper , Michael Kelley , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This will be useful when invoking hypercall that targets specific vcpu(s). Signed-off-by: Wei Liu Reviewed-by: Paul Durrant Acked-by: Jan Beulich --- v4: 1. Use private.h 2. Add Paul's review tag v2: 1. Fold into setup_pcpu_arg function --- xen/arch/x86/guest/hyperv/hyperv.c | 5 +++++ xen/arch/x86/guest/hyperv/private.h | 1 + 2 files changed, 6 insertions(+) diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv= /hyperv.c index c5195af948..085e646dc6 100644 --- a/xen/arch/x86/guest/hyperv/hyperv.c +++ b/xen/arch/x86/guest/hyperv/hyperv.c @@ -31,6 +31,7 @@ =20 struct ms_hyperv_info __read_mostly ms_hyperv; DEFINE_PER_CPU_READ_MOSTLY(void *, hv_pcpu_input_arg); +DEFINE_PER_CPU_READ_MOSTLY(unsigned int, hv_vp_index); =20 static uint64_t generate_guest_id(void) { @@ -125,6 +126,7 @@ static void __init setup_hypercall_page(void) static void setup_hypercall_pcpu_arg(void) { void *mapping; + uint64_t vp_index_msr; =20 if ( this_cpu(hv_pcpu_input_arg) ) return; @@ -135,6 +137,9 @@ static void setup_hypercall_pcpu_arg(void) smp_processor_id()); =20 this_cpu(hv_pcpu_input_arg) =3D mapping; + + rdmsrl(HV_X64_MSR_VP_INDEX, vp_index_msr); + this_cpu(hv_vp_index) =3D vp_index_msr; } =20 static void __init setup(void) diff --git a/xen/arch/x86/guest/hyperv/private.h b/xen/arch/x86/guest/hyper= v/private.h index b6902b5639..da70990401 100644 --- a/xen/arch/x86/guest/hyperv/private.h +++ b/xen/arch/x86/guest/hyperv/private.h @@ -25,5 +25,6 @@ #include =20 DECLARE_PER_CPU(void *, hv_pcpu_input_arg); +DECLARE_PER_CPU(unsigned int, hv_vp_index); =20 #endif /* __XEN_HYPERV_PRIVIATE_H__ */ --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel