From patchwork Fri Jan 3 16:08:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316977 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7B7C138D for ; Fri, 3 Jan 2020 16:10:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B45E3222C4 for ; Fri, 3 Jan 2020 16:10:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gx/+v4Cd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B45E3222C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVX-0005RC-Al; Fri, 03 Jan 2020 16:09:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVW-0005R6-KU for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:02 +0000 X-Inumbo-ID: 58a495d8-2e43-11ea-88e7-bc764e2007e4 Received: from mail-wm1-x331.google.com (unknown [2a00:1450:4864:20::331]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 58a495d8-2e43-11ea-88e7-bc764e2007e4; Fri, 03 Jan 2020 16:08:57 +0000 (UTC) Received: by mail-wm1-x331.google.com with SMTP id b19so8784734wmj.4 for ; Fri, 03 Jan 2020 08:08:57 -0800 (PST) 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=Lzk7QT42x4Bu7yTXlGHeGQsXy2o8S3NY1hIpuuMaZPg=; b=gx/+v4CdSMB+xrjc75vD3ZDNiL8126npbFc9alC4qtaab8Vm58o/WqSDbzU2mf7e96 6KWhLdK1W5a44ItW5kkY6fKssQUMpQXUH0Jq6ZOtUN2UpxToer5xd/OQRc2vzNAqXg+o vlEUpgq/gt6NpxDm4Q6BgMthkFmg+M0fIHM2xkFK8kOWJ1QKvvrcTLIfiy3T498podoS HxPQ/C1g673GjiB/gnW/fybUNeTEWfxAae+WQrQgaXduz7Ba+rjh90nOBt0b7UTivO03 4VH9+dY+De7HnX91j4vOdh7BytkzQ3iDvSqt5P5Chr1TrW7fDFgTlShqCrViuqSm/fQI U/wQ== 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=Lzk7QT42x4Bu7yTXlGHeGQsXy2o8S3NY1hIpuuMaZPg=; b=TS4P6gM2dkdeBF1snmczgv/bbiItAczVJqwMO/ScMyBGDeE3rTVjZUthLVhmXscLia 8pZjWlXtHI2UZ0CO7SgI/MQUk3IOcb5rHKfQ312NqJ0c9qIPzTWIDbSfN/R4Sl4+VUu/ CJxfFVnMBseunLQHw7a1HG3qInX7J5eiEoyvF8Sh7EGRVuUazuDS1D6YfwslfKNSn9KP fga3hJLN0UBtIoGBlPrJ6YM1Id2FbGBJImWBHwfc3tjdNTrIDrR90HF0GRe25Ib0ke4v 1JImyixo+c87NbUsZhJ4nNzW3eouAlizDEYg0pwXRj/9oB7hu0Aetnsjoof4OTa87hTl 182w== X-Gm-Message-State: APjAAAUHz1MzrOXcqhdptU2WmZs7rYVUZKsbJuNcZN/B61Yeg+8c9FG6 QW+qsg6iCkPSEblqZQdH6FLrOy4BV0Syqg== X-Google-Smtp-Source: APXvYqwVlJzNuW6gI1Cd20+TFIp4Lb9cRdIKKgrnL9ZcpvRM98xluSSt+IeUcyJZwS27AYbrAtQiJQ== X-Received: by 2002:a1c:4c5:: with SMTP id 188mr20367174wme.82.1578067736826; Fri, 03 Jan 2020 08:08:56 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:08:56 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:18 +0000 Message-Id: <20200103160825.19377-2-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 1/8] x86: include xen/lib.h in guest/pvh-boot.h 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" It needs ASSERT_UNREACHABLE. Signed-off-by: Wei Liu --- xen/include/asm-x86/guest/pvh-boot.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/include/asm-x86/guest/pvh-boot.h b/xen/include/asm-x86/guest/pvh-boot.h index b8a76c4eed..48ffd1a0b1 100644 --- a/xen/include/asm-x86/guest/pvh-boot.h +++ b/xen/include/asm-x86/guest/pvh-boot.h @@ -30,6 +30,8 @@ void pvh_print_info(void); #else +#include + #define pvh_boot 0 static inline void pvh_init(multiboot_info_t **mbi, module_t **mod) From patchwork Fri Jan 3 16:08:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316981 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35A21139A for ; Fri, 3 Jan 2020 16:10:21 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12DD3222C4 for ; Fri, 3 Jan 2020 16:10:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RQoC+pso" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12DD3222C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVc-0005Rk-KJ; Fri, 03 Jan 2020 16:09:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVb-0005RW-KW for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:07 +0000 X-Inumbo-ID: 5939d5d0-2e43-11ea-88e7-bc764e2007e4 Received: from mail-wr1-x42a.google.com (unknown [2a00:1450:4864:20::42a]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5939d5d0-2e43-11ea-88e7-bc764e2007e4; Fri, 03 Jan 2020 16:08:58 +0000 (UTC) Received: by mail-wr1-x42a.google.com with SMTP id y17so42927624wrh.5 for ; Fri, 03 Jan 2020 08:08:58 -0800 (PST) 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=lOdhYFEVelSK6Ytux96+pcbc6B3h71rDSrm39/P7N80=; b=RQoC+pso/dCEYUaDHg9flDKa37SjRprUJMgemtpKRxCsPrvxs9iJkn7WeC7HPW0Ylv ctfJD4pZLNqk8J7cnwGjzIhrTxkvNvkpCI6qfv3noYM21lC3ah0jlh9Pu8LzgaEo9OCI R4fV0hlpTKt07b58i16PSq/+49RFYSIBEhZgjwW/45syTKuV/Uj0O60/HLaOpTYxY8Nl ZaNl66pPGp+mdqB4o9WMNzEIQZXuEnuKjTfV6hOTTAQddUrTvg75IueLOlm22Yqkte1F rZvrmpjoC+fm4z0BkHdj66WPLdYU/LEpPwYOMzElxnsLyht8XbA4d3xAQlarb6O9QSx7 kJ/w== 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=lOdhYFEVelSK6Ytux96+pcbc6B3h71rDSrm39/P7N80=; b=IzKTxuluHu1IaPwIfVz5S0B0OLlh17gULalhXUtTbp7BKyLhI/aEyTbVaG+V1+8QUG pdVJ50UStmUB9qjXIe4IJona4lnZ5WAuhhxiWbOo+VSzIUQcR75rdSnryBNypzfyDQvj +7TkqA63e4OYcuDNtnY5vS+k5ebpdyrqVYR3qMeAKFct2GQ+tnZIdMARmb2zOI07ow3j WrsSiT5u3qC85/JcUMXH6DEEtxmSbytYAOWF9tYBMOK4qGO62mk4aqCJLRPHGpnwPQCv GhrzFDk0zS8H+RjeYgY0HcB5t1j/hrAy3t4ZV3LAiGQg3Ox+WJw3tCc7JXzGnfUT2bjr ByzA== X-Gm-Message-State: APjAAAXe085P6ZdNT/jZsM0zglcuhjsWOcAwJh5jclWmTzImnquXVxGA 0fMmLTcIhhkGf1H5FErP0IFD2zVIERIRFQ== X-Google-Smtp-Source: APXvYqwdsSwb9hd2N7DiC6+ZLYhBc1aNVFNbCK+TvaRkPAFWFvi8P4cLv1psIRtr5DGKdEpmHEKg5w== X-Received: by 2002:adf:df8e:: with SMTP id z14mr87620646wrl.190.1578067737706; Fri, 03 Jan 2020 08:08:57 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:08:57 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:19 +0000 Message-Id: <20200103160825.19377-3-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 2/8] x86/hyperv: detect absolutely necessary MSRs 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" If they are not available, disable Hyper-V related features. Signed-off-by: Wei Liu --- v2: 1. Fix comment style --- xen/arch/x86/guest/hyperv/hyperv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c index 2e70b4aa82..8d38313d7a 100644 --- a/xen/arch/x86/guest/hyperv/hyperv.c +++ b/xen/arch/x86/guest/hyperv/hyperv.c @@ -32,6 +32,8 @@ static const struct hypervisor_ops ops = { const struct hypervisor_ops *__init hyperv_probe(void) { uint32_t eax, ebx, ecx, edx; + uint64_t required_msrs = HV_X64_MSR_HYPERCALL_AVAILABLE | + HV_X64_MSR_VP_INDEX_AVAILABLE; cpuid(0x40000000, &eax, &ebx, &ecx, &edx); if ( !((ebx == 0x7263694d) && /* "Micr" */ @@ -57,6 +59,16 @@ const struct hypervisor_ops *__init hyperv_probe(void) ms_hyperv.max_vp_index = eax; ms_hyperv.max_lp_index = ebx; + if ( (ms_hyperv.features & required_msrs) != required_msrs ) + { + /* + * Oops, required MSRs are not available. Treat this as + * "Hyper-V is not available". + */ + memset(&ms_hyperv, 0, sizeof(ms_hyperv)); + return NULL; + } + return &ops; } From patchwork Fri Jan 3 16:08:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316979 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 286031395 for ; Fri, 3 Jan 2020 16:10:21 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05568222C3 for ; Fri, 3 Jan 2020 16:10:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pQCRr8JY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05568222C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVi-0005T7-4l; Fri, 03 Jan 2020 16:09:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVg-0005Sk-Kd for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:12 +0000 X-Inumbo-ID: 5a81d460-2e43-11ea-a914-bc764e2007e4 Received: from mail-wm1-x342.google.com (unknown [2a00:1450:4864:20::342]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5a81d460-2e43-11ea-a914-bc764e2007e4; Fri, 03 Jan 2020 16:09:00 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id a5so8826475wmb.0 for ; Fri, 03 Jan 2020 08:09:00 -0800 (PST) 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=gvmWC2BuiVkIzJZx/luRPH2eJYAdGqz17W1cKVo4/9M=; b=pQCRr8JYbHc7z9/csugoZ8r2OsoJObDGeZwtWzlm+h4/c56uBeSnh2etlJafkCPZ/k 90cEuhNz5dmd9UUM6UmfMn9AlXONJl45NDU9lYTznVM4Gc+KadRd2TI7iq+jruWZqPIF SS1N8rVo+iZL4r538feNOwxOegTND+yqqJVzIX7VBUxIrsBS7qEu/gKCl7TuaaXco3Uz 9ie6elVpSt+0fTWv10wNOm9PmIhNOMyN31JMNyY/dJDBA7man20O0EzE7Oxgas0CJWFC bkyLtb2Qm2d38F9vIqTxYbHiJERf2j3X2zn/LjqaAs5bbvus4zJ5FNZla124FETzRIdM l0Jw== 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=gvmWC2BuiVkIzJZx/luRPH2eJYAdGqz17W1cKVo4/9M=; b=q6tqBR0sM+FGO2ZzEGf+Yt7wGsJjeU2kuVkLbuhkv46zswKJpuwstckEEzII9Rd10j RnpYNmC22SWYtp9SluaTqDqusb+xVwCKvaQRpkZ1AwmpZRLeG5rLNaevjfre3Trgy7Q7 EsLUbCd/gVgURmTnUBT/AFNn6Rl0zg7PCJLMF8ChfU5bJbmiM/0IRxjBN0K0WoyF++iM TvvVWLo/8FfeqIQ1GVe+573Ks+it24724la5CDcEfGovPrPdzylq+yqmxQhqk/S67l9E rxktubvDGVYOrxNfTJ6Pt3daUsNjvHBm7JumbFUuBdAz49GYTJENwIE7DCQubjETsa+Q i8WQ== X-Gm-Message-State: APjAAAV4kxoGDNvsCfXIWoUXcfn4RVQp/exL4iHxECo6zJsVfsqlkTck iw1ZgBShDyauH80/46Y/h1hHWPcGXgRjGA== X-Google-Smtp-Source: APXvYqxXGcegu67DdeDDmrIBAqf0He81OqI/mFhZxL9RUkqd15Px0MdQG+NXibrZluj6waOysHZFFg== X-Received: by 2002:a05:600c:409:: with SMTP id q9mr20365834wmb.19.1578067740002; Fri, 03 Jan 2020 08:09:00 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:08:59 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:20 +0000 Message-Id: <20200103160825.19377-4-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 3/8] x86: rename guest/hypercall.h to guest/xen-hypercall.h 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" We will provide a header file for Hyper-V hypercalls. No functional change. Signed-off-by: Wei Liu Reviewed-by: Paul Durrant --- xen/include/asm-x86/guest.h | 2 +- xen/include/asm-x86/guest/{hypercall.h => xen-hypercall.h} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename xen/include/asm-x86/guest/{hypercall.h => xen-hypercall.h} (99%) diff --git a/xen/include/asm-x86/guest.h b/xen/include/asm-x86/guest.h index 94448606d4..7f09c643d4 100644 --- a/xen/include/asm-x86/guest.h +++ b/xen/include/asm-x86/guest.h @@ -19,11 +19,11 @@ #ifndef __X86_GUEST_H__ #define __X86_GUEST_H__ -#include #include #include #include #include +#include #include #endif /* __X86_GUEST_H__ */ diff --git a/xen/include/asm-x86/guest/hypercall.h b/xen/include/asm-x86/guest/xen-hypercall.h similarity index 99% rename from xen/include/asm-x86/guest/hypercall.h rename to xen/include/asm-x86/guest/xen-hypercall.h index d0d2f5022d..681d3aecd7 100644 --- a/xen/include/asm-x86/guest/hypercall.h +++ b/xen/include/asm-x86/guest/xen-hypercall.h @@ -1,5 +1,5 @@ /****************************************************************************** - * asm-x86/guest/hypercall.h + * asm-x86/guest/xen-hypercall.h * * This program is free software; you can redistribute it and/or * modify it under the terms and conditions of the GNU General Public From patchwork Fri Jan 3 16:08:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316985 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F04951395 for ; Fri, 3 Jan 2020 16:10:26 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC1C42084D for ; Fri, 3 Jan 2020 16:10:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f4X1oyi9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC1C42084D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVm-0005Ua-Ek; Fri, 03 Jan 2020 16:09: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 1inPVl-0005UK-Lp for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:17 +0000 X-Inumbo-ID: 5afe3b9a-2e43-11ea-88e7-bc764e2007e4 Received: from mail-wm1-x329.google.com (unknown [2a00:1450:4864:20::329]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5afe3b9a-2e43-11ea-88e7-bc764e2007e4; Fri, 03 Jan 2020 16:09:01 +0000 (UTC) Received: by mail-wm1-x329.google.com with SMTP id b19so8784888wmj.4 for ; Fri, 03 Jan 2020 08:09:01 -0800 (PST) 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=AeVdaCAPZTMCoRydrJF1kMnbXuo4DmKCUTwBKEx4Ftg=; b=f4X1oyi9sh1zTPgxK6RoOIEv5yHCPevuLRvYvmGuDyfr9FjEB0LxhAwbi8Exzfzy4v mzjBfnW5J7mE5yx3GHq2mSMGHPzXu3X+D6RlXQQxzlGJx5UH53s4Lg7DRRoS/P1yk7/Z c1mk6hbHBh1aNg6LSgTIDkB52V68a7SMx54j+Uv5/xq8+WgAbcFptDjceC9euxe/lA1l 0QHdrX+oB4XrfMHud3UZYDi8dEjFia9ymeOmnbiNlNBtkvXJ/0r9K/QdVvGZqG0OoMgI hRtLfCm99Hk2jzKoBHVj4DjhMz6FRiXAB86P6OBolTwy2Fqv2JHfV/8YhjVSDlWs/oRr W71A== 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=AeVdaCAPZTMCoRydrJF1kMnbXuo4DmKCUTwBKEx4Ftg=; b=XyfSTd9fKbDSEzDLvroDqw1Gxs+ghiuHJz0LK0rCiHp+zaWhDz4XTaas4xKMCk9tXh Hmly2z98Hyh60347vOmlXHLisW7V+T8vieXy55HoUQim6Z6C08p+yAsDuHX4sJ+ff+AV +IckcdqifCePajrigEYmeTs7Nv9RT01oVYA9iLPMo40W38IKcRVBsOx2LizCuG/4g8Be OWq7Wfba/PggMtxW78pUMKNboPqQDKsJAl6ODasf1iANVvp21K+3h6qYd9QUZZoqGR8N 4EFWL5HIG15Jne8PhB8nhhy+9dNC8wXup4FzFbFUmVTnDjJF1GeX0QCAhDYoWHnNcVV3 koSQ== X-Gm-Message-State: APjAAAXe1EdVGB6A/79Gq8bJsmEc0586U7IgjtRDiVdfBxop/jHeK4Rx VOvnineyHve6W/06ooQrPDfXBRUSWkdBkQ== X-Google-Smtp-Source: APXvYqxbMR8RYP5sL+FAKCqyBnntlD2gxHmRqxI+cznR9X69weUoxjSyDz5vfC81rfyr/nYC37V8VQ== X-Received: by 2002:a1c:a949:: with SMTP id s70mr20167401wme.69.1578067740767; Fri, 03 Jan 2020 08:09:00 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:09:00 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:21 +0000 Message-Id: <20200103160825.19377-5-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 4/8] x86/hyperv: setup hypercall page 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Wei Liu --- v2: 1. Fix issue discovered by Michael 2. Use a statically allocated page as hypercall page --- xen/arch/x86/guest/hyperv/Makefile | 1 + xen/arch/x86/guest/hyperv/hypercall_page.S | 21 +++++++++++++++++ xen/arch/x86/guest/hyperv/hyperv.c | 27 +++++++++++++++++++--- 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 xen/arch/x86/guest/hyperv/hypercall_page.S diff --git a/xen/arch/x86/guest/hyperv/Makefile b/xen/arch/x86/guest/hyperv/Makefile index 68170109a9..1a8887d2f4 100644 --- a/xen/arch/x86/guest/hyperv/Makefile +++ b/xen/arch/x86/guest/hyperv/Makefile @@ -1 +1,2 @@ +obj-y += hypercall_page.o obj-y += hyperv.o diff --git a/xen/arch/x86/guest/hyperv/hypercall_page.S b/xen/arch/x86/guest/hyperv/hypercall_page.S new file mode 100644 index 0000000000..6d6ab913be --- /dev/null +++ b/xen/arch/x86/guest/hyperv/hypercall_page.S @@ -0,0 +1,21 @@ +#include +#include + + .section ".text.page_aligned", "ax", @progbits + .p2align PAGE_SHIFT +GLOBAL(hv_hypercall_page) + /* Return -1 for "not yet ready" state */ + mov -1, %rax + ret +1: + /* Fill the rest with `ret` */ + .fill PAGE_SIZE - (1b - hv_hypercall_page), 1, 0xc3 + .type hv_hypercall_page, STT_OBJECT + .size hv_hypercall_page, PAGE_SIZE + +/* + * Local variables: + * tab-width: 8 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c index 8d38313d7a..381be2a68c 100644 --- a/xen/arch/x86/guest/hyperv/hyperv.c +++ b/xen/arch/x86/guest/hyperv/hyperv.c @@ -19,16 +19,16 @@ * Copyright (c) 2019 Microsoft. */ #include +#include #include #include struct ms_hyperv_info __read_mostly ms_hyperv; -static const struct hypervisor_ops ops = { - .name = "Hyper-V", -}; +extern char hv_hypercall_page[]; +static const struct hypervisor_ops ops; const struct hypervisor_ops *__init hyperv_probe(void) { uint32_t eax, ebx, ecx, edx; @@ -72,6 +72,27 @@ const struct hypervisor_ops *__init hyperv_probe(void) return &ops; } +static void __init setup_hypercall_page(void) +{ + union hv_x64_msr_hypercall_contents hypercall_msr; + + rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); + hypercall_msr.enable = 1; + hypercall_msr.guest_physical_address = + __pa(hv_hypercall_page) >> HV_HYP_PAGE_SHIFT; + wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); +} + +static void __init setup(void) +{ + setup_hypercall_page(); +} + +static const struct hypervisor_ops ops = { + .name = "Hyper-V", + .setup = setup, +}; + /* * Local variables: * mode: C From patchwork Fri Jan 3 16:08:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316983 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43943138D for ; Fri, 3 Jan 2020 16:10:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 203F9222C3 for ; Fri, 3 Jan 2020 16:10:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tUbHi0Dp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 203F9222C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVr-0005Wl-OM; Fri, 03 Jan 2020 16:09:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVq-0005WC-LG for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:22 +0000 X-Inumbo-ID: 5b7ce030-2e43-11ea-a914-bc764e2007e4 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5b7ce030-2e43-11ea-a914-bc764e2007e4; Fri, 03 Jan 2020 16:09:02 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id p17so9045937wma.1 for ; Fri, 03 Jan 2020 08:09:02 -0800 (PST) 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=RUfnlZlwFuHWpde6sRvjxDfadwPtw2oJdC3k1kQv/fc=; b=tUbHi0DpRaYWZ3lxVGLFpcaSMEAc4PBWX+py0GYk/V1mca4StnwqTGD2Z8bGwK0gHF TP0q8tHZ1laPI1bmR1NaekYETPtGvI/oDtHmd9u0I/nTOFwudnzDUBjQ2rSAuQyfEH0X EbD4j5U0WdVJ1bOFO1IUN0bYFvMBgO0yWjWyFtadcVgF06PxsXKCxX4FrDmsmm35YuOT c/jT/Ups37cbNsCJNfZaBFqzPK5Y2tzG08cGxkiqLb1wQXLrJTF4eZ07XEhlIEou0ziz Rgu9RM3A8Ran/Goz8ne0+v3qZ1I4AmDZRM5qLX3qlx9e3RJhxNRyYS8+FktP4OMVES2t ASzQ== 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=RUfnlZlwFuHWpde6sRvjxDfadwPtw2oJdC3k1kQv/fc=; b=YLXS77vRzpJfoJ39+ceA06ITZhwkFdpk0lh+8JxadXFNy7gF5kqnQFtzqOyaolWsH+ Fp7eZtRcIz4cfnhXD02E58G4Ixun5rC8cQ2iwSO29XNCwR30jJ/2xO+BZKMAwkAssLCR jhuVk65fo2v/HPj/PUGKcVyp4cqnGUsf5YUuZ7aomUEvdW05D7CNMUtKMuoAJNAPGMSy 4ZIaDgXjqSPgcoonY7Fvr9Og5hYo5d16nWfpn81qTNT6wfKB5k0MsDKNS53p02oab+XD OlM/rEDMau2jBAaP9xaxMo0qlR4yAx4LWCj87kdgLgS2Dt/P8tME7Q2K7/O/qKVMVw+X dwEg== X-Gm-Message-State: APjAAAW5YAST86MrsxCxHquqR8BPf88pH8eicJp7KX8zYGsCs29GjPgR 7ANcS13juMadq697VC0vYbqLLOKrMg7YWA== X-Google-Smtp-Source: APXvYqxOVtQLjKCVbZacFTlx6nzgZtiAYBluSMVrihTmit9tKrvWHb/2hHm9MhvYZCCKCRH5ezfz1A== X-Received: by 2002:a7b:cf12:: with SMTP id l18mr21771776wmg.66.1578067741581; Fri, 03 Jan 2020 08:09:01 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:09:01 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:22 +0000 Message-Id: <20200103160825.19377-6-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 5/8] x86/hyperv: provide Hyper-V hypercall functions 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" These functions will be used later to make hypercalls to Hyper-V. I couldn't find reference in TLFS that Hyper-V clobbers flags and r9-r11, but Linux's commit message says it does. Err on the safe side. Signed-off-by: Wei Liu --- v2: 1. Use direct call --- xen/include/asm-x86/guest/hyperv-hypercall.h | 95 ++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 xen/include/asm-x86/guest/hyperv-hypercall.h diff --git a/xen/include/asm-x86/guest/hyperv-hypercall.h b/xen/include/asm-x86/guest/hyperv-hypercall.h new file mode 100644 index 0000000000..928d85ae7e --- /dev/null +++ b/xen/include/asm-x86/guest/hyperv-hypercall.h @@ -0,0 +1,95 @@ +/****************************************************************************** + * asm-x86/guest/hyperv-hypercall.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms and conditions of the GNU General Public + * License, version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; If not, see . + * + * Copyright (c) 2019 Microsoft. + */ + +#ifndef __X86_HYPERV_HYPERCALL_H__ +#define __X86_HYPERV_HYPERCALL_H__ + +#include + +#include +#include +#include + +static inline uint64_t hv_do_hypercall(uint64_t control, paddr_t input, paddr_t output) +{ + uint64_t status; + + asm volatile ("mov %[output], %%r8\n" + "call hv_hypercall_page" + : "=a" (status), "+c" (control), + "+d" (input) ASM_CALL_CONSTRAINT + : [output] "rm" (output) + : "cc", "memory", "r8", "r9", "r10", "r11"); + + return status; +} + +static inline uint64_t hv_do_fast_hypercall(uint16_t code, + uint64_t input1, uint64_t input2) +{ + uint64_t status; + uint64_t control = (uint64_t)code | HV_HYPERCALL_FAST_BIT; + + asm volatile ("mov %[input2], %%r8\n" + "call hv_hypercall_page" + : "=a" (status), "+c" (control), + "+d" (input1) ASM_CALL_CONSTRAINT + : [input2] "rm" (input2) + : "cc", "r8", "r9", "r10", "r11"); + + return status; +} + +static inline uint64_t hv_do_rep_hypercall(uint16_t code, uint16_t rep_count, + uint16_t varhead_size, + paddr_t input, paddr_t output) +{ + uint64_t control = code; + uint64_t status; + uint16_t rep_comp; + + control |= (uint64_t)varhead_size << HV_HYPERCALL_VARHEAD_OFFSET; + control |= (uint64_t)rep_count << HV_HYPERCALL_REP_COMP_OFFSET; + + do { + status = hv_do_hypercall(control, input, output); + if ( (status & HV_HYPERCALL_RESULT_MASK) != HV_STATUS_SUCCESS ) + break; + + rep_comp = (status & HV_HYPERCALL_REP_COMP_MASK) >> + HV_HYPERCALL_REP_COMP_OFFSET; + + control &= ~HV_HYPERCALL_REP_START_MASK; + control |= (uint64_t)rep_comp << HV_HYPERCALL_REP_COMP_OFFSET; + + } while ( rep_comp < rep_count ); + + return status; +} + +#endif /* __X86_HYPERV_HYPERCALL_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Fri Jan 3 16:08:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316991 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97370139A for ; Fri, 3 Jan 2020 16:10:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7428F222C3 for ; Fri, 3 Jan 2020 16:10:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gmCFLGnF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7428F222C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVx-0005aG-2X; Fri, 03 Jan 2020 16:09:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPVv-0005ZG-Lo for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:27 +0000 X-Inumbo-ID: 5c099f48-2e43-11ea-88e7-bc764e2007e4 Received: from mail-wr1-x444.google.com (unknown [2a00:1450:4864:20::444]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5c099f48-2e43-11ea-88e7-bc764e2007e4; Fri, 03 Jan 2020 16:09:03 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id y17so42927838wrh.5 for ; Fri, 03 Jan 2020 08:09:03 -0800 (PST) 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=CQAPrwZ6zHYdeecjna9SU+ovWbg6SlC0hmlnmabw3K0=; b=gmCFLGnFcf+29R1n5v0xIWDuW3zWHEzSWuTJErOBQYqfjFbu4+LY+8t0UDm6Scl4d+ Yb/BlmUMcNvH7G0tXDLB/0tpUmsIolrrwTd04qfX+uGSzVJxqe3obvWDdGq1UMOj2WLG l43pZD3fIx+5+t2UTf9T8BCKPftCDDaSyGCILETg+EQFtbpAWoVN0dPi5WWMakKXwVfx wvQZlImx2HGb0irF7dkRPvCFVoLBoZGifjOUZyyL1ObNhhaugvhOGTPc1Zy0jrk5y7dW jO9RUQ7Ntve/jPdROGyoPeKaGINVS1M0Yo0uk30SNsLyGB0mZLiQoOidu6KeUTRHG0S3 M5Eg== 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=CQAPrwZ6zHYdeecjna9SU+ovWbg6SlC0hmlnmabw3K0=; b=BmvHGAxUiOmOEjdhfA/scbq7l98V0yxSnZsAlh1Q63wgfix/wNlqt1lOT4WOThH2tV XgRQm0Nt7apEs3wAPx0hVbQ02MqRs+C/pYE2rKhHlJzQLxt13zN6/mKLjMSH2qpT4UuL ygMBvw/QwNpEAcYL6vS3mc4fIDjpnR6gvEihtB4Lh+edXVQiMgwceB1Q9QTcN+bWLHQW fCD1yXSLAx7l45LlaP5HXJvFuzV9kdCl10TEnh+tao55mGzuf7RDtqEg9lyeuxwqQJJg tCoORGFC+6ku5Inakce9GY+bjab9Y+3qiorAbg+n7ejgx1dzJN8ELAj+yCRWnyCkb/T+ KtYA== X-Gm-Message-State: APjAAAV367xutEqH07KFLI/6RgEX4p89dLLWNbZdxfC5c52Lbsbx0A2V lIxENzakYCV1mdbYMtYFwUU0gbdyZ/D3DQ== X-Google-Smtp-Source: APXvYqyWeqNbXCdXFT2fFknZH+3j9VXX2ry3FTDYp8zpb2KWhKVx4hj6hXbMX0G6+30mCzVZ/fLI/g== X-Received: by 2002:adf:fd07:: with SMTP id e7mr86811193wrr.21.1578067742550; Fri, 03 Jan 2020 08:09:02 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:09:02 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:23 +0000 Message-Id: <20200103160825.19377-7-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 6/8] x86/hyperv: provide percpu hypercall input page 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hyper-V's input / output argument must be 8 bytes aligned an not cross page boundary. The easiest way to satisfy those requirements is to use percpu page. For the foreseeable future we only need to provide input for TLB and APIC hypercalls, so skip setting up an output page. The page tracking structure is not bound to hypercall because it is a common pattern for Xen to write guest physical address to Hyper-V while at the same time accessing the page via a pointer. We will also need to provide an ap_setup hook for secondary cpus to setup its own input page. Signed-off-by: Wei Liu Reviewed-by: Paul Durrant --- xen/arch/x86/guest/hyperv/hyperv.c | 26 ++++++++++++++++++++++++++ xen/include/asm-x86/guest/hyperv.h | 8 ++++++++ 2 files changed, 34 insertions(+) diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c index 381be2a68c..03027bd453 100644 --- a/xen/arch/x86/guest/hyperv/hyperv.c +++ b/xen/arch/x86/guest/hyperv/hyperv.c @@ -27,6 +27,7 @@ struct ms_hyperv_info __read_mostly ms_hyperv; extern char hv_hypercall_page[]; +DEFINE_PER_CPU_READ_MOSTLY(struct hyperv_pcpu_page, hv_pcpu_input_arg); static const struct hypervisor_ops ops; const struct hypervisor_ops *__init hyperv_probe(void) @@ -83,14 +84,39 @@ static void __init setup_hypercall_page(void) wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); } +static void setup_hypercall_pcpu_arg(void) +{ + struct page_info *pg; + void *mapping; + unsigned int cpu = smp_processor_id(); + + pg = alloc_domheap_page(NULL, 0); + if ( !pg ) + panic("Failed to setup hypercall input page for %u\n", cpu); + + mapping = __map_domain_page_global(pg); + if ( !mapping ) + panic("Failed to map hypercall input page for %u\n", cpu); + + this_cpu(hv_pcpu_input_arg).maddr = page_to_maddr(pg); + this_cpu(hv_pcpu_input_arg).mapping = mapping; +} + static void __init setup(void) { setup_hypercall_page(); + setup_hypercall_pcpu_arg(); +} + +static void ap_setup(void) +{ + setup_hypercall_pcpu_arg(); } static const struct hypervisor_ops ops = { .name = "Hyper-V", .setup = setup, + .ap_setup = ap_setup, }; /* diff --git a/xen/include/asm-x86/guest/hyperv.h b/xen/include/asm-x86/guest/hyperv.h index c7a7f32bd5..83f297468f 100644 --- a/xen/include/asm-x86/guest/hyperv.h +++ b/xen/include/asm-x86/guest/hyperv.h @@ -51,6 +51,8 @@ static inline uint64_t hv_scale_tsc(uint64_t tsc, uint64_t scale, #ifdef CONFIG_HYPERV_GUEST +#include + #include struct ms_hyperv_info { @@ -63,6 +65,12 @@ struct ms_hyperv_info { }; extern struct ms_hyperv_info ms_hyperv; +struct hyperv_pcpu_page { + paddr_t maddr; + void *mapping; +}; +DECLARE_PER_CPU(struct hyperv_pcpu_page, hv_pcpu_input_arg); + const struct hypervisor_ops *hyperv_probe(void); #else From patchwork Fri Jan 3 16:08:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316987 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DF721395 for ; Fri, 3 Jan 2020 16:10:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3AAA42084D for ; Fri, 3 Jan 2020 16:10:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M7QorUtb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AAA42084D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPW2-0005e1-Dh; Fri, 03 Jan 2020 16:09:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPW0-0005cS-Lv for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:32 +0000 X-Inumbo-ID: 5ce7faea-2e43-11ea-a1e1-bc764e2007e4 Received: from mail-wm1-x32a.google.com (unknown [2a00:1450:4864:20::32a]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5ce7faea-2e43-11ea-a1e1-bc764e2007e4; Fri, 03 Jan 2020 16:09:04 +0000 (UTC) Received: by mail-wm1-x32a.google.com with SMTP id f129so9033350wmf.2 for ; Fri, 03 Jan 2020 08:09:04 -0800 (PST) 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=LMFPYGrcm7BM/XK1EMrwljwKrMIeS9V+k4JmcGsTosc=; b=M7QorUtbzSu5vyn70UvJR7qvQ3056ecP9mQDPqnTvieFdUEipkc8BzYae6CM5fMgYR r0rx2pqX7OgDWHxukofI48aJt/s29s2AluJP8hJcD1EjOuT/y+qcDc6ubE3JsGARF0ks j3QxPAvsmUt624E4sCjyGtQkX/YhrzEooJCL/eh/l9ZO0y79N5e7DR4MGUTf3fiHu9ko ZHkfpK1HWLw+2dhziymQ5IYIAkeAHXfCKKYAsE/c/1lUWLGV8EeStwsmc2YAZCNA9quz 1/3LQMcW8KwzzeagqTasNnvyVpJ/kNhL0QCS+izN3bs0UU63N9vfmCspVZFPa65wlKQz LBHw== 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=LMFPYGrcm7BM/XK1EMrwljwKrMIeS9V+k4JmcGsTosc=; b=fWgRel29kGTN9UfN20Qo8/xPWcYmyXc4FIwFDBO3w74hs8F/KsmN3woc/LiKO1rHcd ur+hAD+tSmZNJe2kx/KWpLok3cTqZ27Ejn8/YVNMi/kRphnkr7bB/ZIE2MxKw3G9vMlU 4yZ7GICTBcBL1KLIgCHSijPyAK9YZw6vQXBgqh557ojg3ZfrY3Y8qT7E0Yt4mfzdIIFs IjZzf2FiTo75GDcsP0O3uP4gd6Hf3BTO59iLCqsN+zGhL5XNm21/tSvkEHxoKTx55JcP n5BRT+uuI4UUbnzCy2Wwo83zd98ynijpk0hAJ4ks/EiH6Mu0r/tpskRXKzKZ0Aan4z1I Wyng== X-Gm-Message-State: APjAAAVuauRXuOoNV2ufgaoLqd9u3puowECvC3S++Z9xtt+yWUNResUS 0HGjpBKLDDiKrS1Sddq4ZcBFAj+3+KL02g== X-Google-Smtp-Source: APXvYqwbmx3bwNOOo/1sV5t8b4Apt1cPAv+VYMDE0eRYPgCRC1vooxFDz8tYUy6sNtuRw7ttVlMrMw== X-Received: by 2002:a05:600c:23c9:: with SMTP id p9mr20631914wmb.160.1578067744026; Fri, 03 Jan 2020 08:09:04 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:09:02 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:24 +0000 Message-Id: <20200103160825.19377-8-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 7/8] 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This will be useful when invoking hypercall that targets specific vcpu(s). Signed-off-by: Wei Liu --- v2: 1. Fold into setup_pcpu_arg function --- xen/arch/x86/guest/hyperv/hyperv.c | 5 +++++ xen/include/asm-x86/guest/hyperv.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 03027bd453..5c5aed46cb 100644 --- a/xen/arch/x86/guest/hyperv/hyperv.c +++ b/xen/arch/x86/guest/hyperv/hyperv.c @@ -28,6 +28,7 @@ struct ms_hyperv_info __read_mostly ms_hyperv; extern char hv_hypercall_page[]; DEFINE_PER_CPU_READ_MOSTLY(struct hyperv_pcpu_page, hv_pcpu_input_arg); +DEFINE_PER_CPU_READ_MOSTLY(unsigned int, hv_vp_index); static const struct hypervisor_ops ops; const struct hypervisor_ops *__init hyperv_probe(void) @@ -89,6 +90,7 @@ static void setup_hypercall_pcpu_arg(void) struct page_info *pg; void *mapping; unsigned int cpu = smp_processor_id(); + uint64_t vp_index_msr; pg = alloc_domheap_page(NULL, 0); if ( !pg ) @@ -100,6 +102,9 @@ static void setup_hypercall_pcpu_arg(void) this_cpu(hv_pcpu_input_arg).maddr = page_to_maddr(pg); this_cpu(hv_pcpu_input_arg).mapping = mapping; + + rdmsrl(HV_X64_MSR_VP_INDEX, vp_index_msr); + this_cpu(hv_vp_index) = vp_index_msr; } static void __init setup(void) diff --git a/xen/include/asm-x86/guest/hyperv.h b/xen/include/asm-x86/guest/hyperv.h index 83f297468f..4b635829f3 100644 --- a/xen/include/asm-x86/guest/hyperv.h +++ b/xen/include/asm-x86/guest/hyperv.h @@ -70,6 +70,7 @@ struct hyperv_pcpu_page { void *mapping; }; DECLARE_PER_CPU(struct hyperv_pcpu_page, hv_pcpu_input_arg); +DECLARE_PER_CPU(unsigned int, hv_vp_index); const struct hypervisor_ops *hyperv_probe(void); From patchwork Fri Jan 3 16:08:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11316989 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9392C138D for ; Fri, 3 Jan 2020 16:10:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FB4A2084D for ; Fri, 3 Jan 2020 16:10:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aLHpkybu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FB4A2084D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPW6-0005hZ-SI; Fri, 03 Jan 2020 16:09:38 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1inPW5-0005gn-Mf for xen-devel@lists.xenproject.org; Fri, 03 Jan 2020 16:09:37 +0000 X-Inumbo-ID: 5d648e3e-2e43-11ea-b6f1-bc764e2007e4 Received: from mail-wr1-x443.google.com (unknown [2a00:1450:4864:20::443]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5d648e3e-2e43-11ea-b6f1-bc764e2007e4; Fri, 03 Jan 2020 16:09:05 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id d16so42885705wre.10 for ; Fri, 03 Jan 2020 08:09:05 -0800 (PST) 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=QxvxkFsBq9Bc5+7I063/jL+c+OhXWyTgW7n8J0N8R6s=; b=aLHpkybuVzC/g9a2pgPZck1nlSkeJ97bBZ6COKF2fLL1RNsJYXZymDjD+k39c6qEUk uqdbh6qeBxDoH8k+DmbPlECAckHel9QdG2FcqakMg7d0/jQfJBQvccYiE8MJhC5bZDqz 5Lglb4UZHpa3gatpwAcAk9zhglDtVXk93iKmwcU8Hpo5TlJsVtX/Syx4gqfYaYdSlJX+ obqS0vT2BGiv/ft4QWF8w42503Vt8f4wajzSZZNdSQ8wgTaGHwJMi21IA1TfFqDia4gE IFyBE3J6ANtY3u6bAvPhKX8DlgWvYJNVoqNs2bVeMwJbwCz1uZ4Wii0N4esk0JYp67FT YV2g== 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=QxvxkFsBq9Bc5+7I063/jL+c+OhXWyTgW7n8J0N8R6s=; b=IJY1rnVoMrgMhv563bmJTC7mXAUi67XU61iYBnZQMAD+WjQ+jiLE7TJ89zSBp/u0/9 9HIvo5p/Fz5hF9u4qyCj0UD0D028SozkyDkdk5lz9QVEV54WwpoGSVkafGMtbivNOTWd 43w5sBgyJOJEAMdwmC2YN6Oh89h58B3XdltukFieTO/kzqX7lfmhZ9CFwWj6SOZilypR XxyQAXIJ/snalXeCLRULJqmgVzqNozMeFkJA8Px0eG8rkiGHzRI3pGj1DQ6hrAW9xs94 t6bLzG9Ux2sqgIbDdT9jmH6SZhbO6eRRTDCbPXt6tGYSGgVB702TheKddZS4YXt3TkVv yk2g== X-Gm-Message-State: APjAAAXEFIOycpiral3uE1zYw241Zz+aqcPfMdNJgWQQh0yC8ZgKparn Q/n/WJuimv9+K3QDEeTGNSj0yOWet/uFag== X-Google-Smtp-Source: APXvYqzg54U/jtCaQ8LIaT9EwOnit73cCh1PWTZ+FGutrIgePQed6FkLIv3g+t3ZdHIQNRrVsnxhPA== X-Received: by 2002:a5d:608a:: with SMTP id w10mr83549018wrt.136.1578067744831; Fri, 03 Jan 2020 08:09:04 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id z11sm61000235wrt.82.2020.01.03.08.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 08:09:04 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 3 Jan 2020 16:08:25 +0000 Message-Id: <20200103160825.19377-9-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200103160825.19377-1-liuwe@microsoft.com> References: <20200103160825.19377-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 8/8] x86/hyperv: setup VP assist page 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 , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" VP assist page is rather important as we need to toggle some bits in for efficient nested virtualisation. Preemptively split out set_vp_assist page which will be used in the resume path. Signed-off-by: Wei Liu --- v2: 1. Use HV_HYP_PAGE_SHIFT instead --- xen/arch/x86/guest/hyperv/hyperv.c | 34 ++++++++++++++++++++++++++++++ xen/include/asm-x86/guest/hyperv.h | 1 + 2 files changed, 35 insertions(+) diff --git a/xen/arch/x86/guest/hyperv/hyperv.c b/xen/arch/x86/guest/hyperv/hyperv.c index 5c5aed46cb..cf6ad13e48 100644 --- a/xen/arch/x86/guest/hyperv/hyperv.c +++ b/xen/arch/x86/guest/hyperv/hyperv.c @@ -29,6 +29,7 @@ struct ms_hyperv_info __read_mostly ms_hyperv; extern char hv_hypercall_page[]; DEFINE_PER_CPU_READ_MOSTLY(struct hyperv_pcpu_page, hv_pcpu_input_arg); DEFINE_PER_CPU_READ_MOSTLY(unsigned int, hv_vp_index); +DEFINE_PER_CPU_READ_MOSTLY(struct hyperv_pcpu_page, hv_vp_assist); static const struct hypervisor_ops ops; const struct hypervisor_ops *__init hyperv_probe(void) @@ -107,15 +108,48 @@ static void setup_hypercall_pcpu_arg(void) this_cpu(hv_vp_index) = vp_index_msr; } +static void set_vp_assist(void) +{ + uint64_t val = paddr_to_pfn(this_cpu(hv_vp_assist).maddr); + + val = (val << HV_HYP_PAGE_SHIFT) | HV_X64_MSR_VP_ASSIST_PAGE_ENABLE; + + wrmsrl(HV_X64_MSR_VP_ASSIST_PAGE, val); +} + +static void setup_vp_assist(void) +{ + struct page_info *pg; + void *mapping; + unsigned int cpu = smp_processor_id(); + + pg = alloc_domheap_page(NULL, 0); + if ( !pg ) + panic("Failed to allocate vp_assist page for %u\n", cpu); + + mapping = __map_domain_page_global(pg); + if ( !mapping ) + panic("Failed to map vp_assist page for %u\n", cpu); + + clear_page(mapping); + + this_cpu(hv_vp_assist).maddr = page_to_maddr(pg); + this_cpu(hv_vp_assist).mapping = mapping; + + set_vp_assist(); +} + static void __init setup(void) { setup_hypercall_page(); setup_hypercall_pcpu_arg(); + setup_vp_assist(); } static void ap_setup(void) { setup_hypercall_pcpu_arg(); + setup_vp_assist(); } static const struct hypervisor_ops ops = { diff --git a/xen/include/asm-x86/guest/hyperv.h b/xen/include/asm-x86/guest/hyperv.h index 4b635829f3..917f4e02c2 100644 --- a/xen/include/asm-x86/guest/hyperv.h +++ b/xen/include/asm-x86/guest/hyperv.h @@ -71,6 +71,7 @@ struct hyperv_pcpu_page { }; DECLARE_PER_CPU(struct hyperv_pcpu_page, hv_pcpu_input_arg); DECLARE_PER_CPU(unsigned int, hv_vp_index); +DECLARE_PER_CPU(struct hyperv_pcpu_page, hv_vp_assist); const struct hypervisor_ops *hyperv_probe(void);