From patchwork Fri Dec 9 05:32:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinank Jain X-Patchwork-Id: 2802 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp593295wrr; Thu, 8 Dec 2022 21:34:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4647rrCOAEaQZW4QJ3n5O1hJNNgrEsTSn3QMM8YLVcx/ygIC67FxU79/MeTlp97h3O++mZ X-Received: by 2002:a17:906:b28d:b0:7c1:2fc4:939 with SMTP id q13-20020a170906b28d00b007c12fc40939mr3201152ejz.28.1670564068999; Thu, 08 Dec 2022 21:34:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670564068; cv=none; d=google.com; s=arc-20160816; b=PhVu/24IIiF+eKiVXqqlln72Kfk/mpltJ1FU7rndK2nB2Lxz292a9rjoOmzPcmLain d0dY6cp/q6OURYhORu3czteHDccUxfpfimAEbJcyuCNWZmmWgzU0/LctlwVw1g5GnLUD +9WxFcEnvspZQ92A/sUxY/GTqYXAxcbBoO3J135Ke6CSY20gKu/YOXn5P1zH3ZvH9gSL ziybNkcQFl3hv3iV/KRs3yHIT/e2eUyyGgHzodfA02lQNZmYrrm+lfA6632TEk58XQ8C XwkYgsx5N6dYksnWP3CyMZmGgvWHH7bYi9U6cKYVI0/Mr6FxoToRB5dgdPsoGNVP2qbK QCBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=386SbrNrhbQDnyCUyTnw3kjM1xfS5uk71VzyZuTA4GA=; b=yAOMQBc+HADe1JcaYAOlklJlLZITLGe/oYzAhMh4GwL+vBgE7hrqB4gBm6BO+9N6GP Fct4gzq0oEqi+4q8FxH4+a+4rg7GnHoPFk4If8jOQDIO8bB8qu0V4u+aRWfAwgpobDYZ D6DHKrS2v0KWBhLry7ys0bx+Y94mU4aflSCiwIiHCvTrSA8xiiGws0bVCdFdaVqXu5QZ 2FZ1AuUwQtDCezT1zkR2YkjB7zuaCgrMs7zXn2mM6iiGHDOE4RHWVVG8KWbCiaIRxGJU A2E/O1Ac31t+bCWiOkTcHei8/wncl5d4mLoahKjpyViHCPO5NVEKMKHtOARtfH8gk4cA oC+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=DDzdmSUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp8-20020a1709073e0800b007c0a9aca484si444375ejc.755.2022.12.08.21.34.00; Thu, 08 Dec 2022 21:34:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=DDzdmSUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbiLIFcq (ORCPT + 99 others); Fri, 9 Dec 2022 00:32:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbiLIFcm (ORCPT ); Fri, 9 Dec 2022 00:32:42 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 76992C76F; Thu, 8 Dec 2022 21:32:39 -0800 (PST) Received: from jinankjain-dranzer.zrrkmle5drku1h0apvxbr2u2ee.ix.internal.cloudapp.net (unknown [20.188.121.5]) by linux.microsoft.com (Postfix) with ESMTPSA id 1C67920B6C40; Thu, 8 Dec 2022 21:32:33 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1C67920B6C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1670563959; bh=386SbrNrhbQDnyCUyTnw3kjM1xfS5uk71VzyZuTA4GA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DDzdmSUo9EjMiWaSmAkT2k8pPEcoO8LU1/RdndTIHq4EN0ULzNYZGC+4BoYOzbGil J+Tu5NAXnsurPa3569S2ybV0CcljxIkbQEGiK26uB0pvtMcGJzP/xKDolg/g+BKYS4 114tzgDmfxmndIaDC2jadr1fLJLaw/knma39tuu0= From: Jinank Jain To: jinankjain@microsoft.com Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, arnd@arndb.de, peterz@infradead.org, jpoimboe@kernel.org, jinankjain@linux.microsoft.com, seanjc@google.com, kirill.shutemov@linux.intel.com, ak@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, anrayabh@linux.microsoft.com, mikelley@microsoft.com Subject: [PATCH v8 0/5] Add support running nested Microsoft Hypervisor Date: Fri, 9 Dec 2022 05:32:26 +0000 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748403299597734940?= X-GMAIL-MSGID: =?utf-8?q?1751713389168597813?= This patch series plans to add support for running nested Microsoft Hypervisor. In case of nested Microsoft Hypervisor there are few privileged hypercalls which need to go L0 Hypervisor instead of L1 Hypervisor. This patches series basically identifies such hypercalls and replace them with nested hypercalls. Jinank Jain (5): x86/hyperv: Add support for detecting nested hypervisor Drivers: hv: Setup synic registers in case of nested root partition x86/hyperv: Add an interface to do nested hypercalls Drivers: hv: Enable vmbus driver for nested root partition x86/hyperv: Change interrupt vector for nested root partition [v4] - Fix ARM64 compilation [v5] - Fix comments from Michael Kelly [v6] - Send the correct patches from the right folder [v7] - Fix linker issues for CONFIG_HYPERV=n pointed out by Michael - Fix comments from Nuno: created two separate functions for fetching nested vs non-nested registers. [v8] - Refactor as per the recommendation from Michael Kelly arch/x86/include/asm/hyperv-tlfs.h | 17 +++++- arch/x86/include/asm/idtentry.h | 2 + arch/x86/include/asm/irq_vectors.h | 6 +++ arch/x86/include/asm/mshyperv.h | 72 ++++++++++++++++---------- arch/x86/kernel/cpu/mshyperv.c | 83 ++++++++++++++++++++++++++++++ arch/x86/kernel/idt.c | 10 ++++ drivers/hv/hv.c | 32 ++++++++---- drivers/hv/hv_common.c | 9 ++-- drivers/hv/vmbus_drv.c | 5 +- include/asm-generic/hyperv-tlfs.h | 1 + include/asm-generic/mshyperv.h | 1 + 11 files changed, 193 insertions(+), 45 deletions(-)