From patchwork Thu Dec 1 11:03:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinank Jain X-Patchwork-Id: 2475 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp196774wrr; Thu, 1 Dec 2022 03:06:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TyIiWuJ/MOwfxUVz5qOGy/POGVo6QBRJi70m7Cmzqok6sczQeHFXiPT0lAnR0928oEoml X-Received: by 2002:a17:906:da0f:b0:7ad:95cf:726e with SMTP id fi15-20020a170906da0f00b007ad95cf726emr39842866ejb.60.1669892787929; Thu, 01 Dec 2022 03:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669892787; cv=none; d=google.com; s=arc-20160816; b=pfSTTo+bKz41aSYXDZzTrKv3qLC2ETV5+mEbKDKTv/LyhjASK6sshucCxe+3DEOvsr XnVG++xz9aP4xzPucV4l5K1GlPr2ljO8XMMg82snWV7OvQrLSUuGvNyA6Wz4FwkM3B1b pYUAwC8MT+hbxwQi7GPfIyCaoJ1EK0CdW7MmM2CfsLZUQ45WayqFQh4LB2wRJ7/iNO/5 14vWeq4C55v6QOqVRiSG5cQQqL6UyQn2peihZkWQ7tL0DLyywNNiaRtxFJ/BcYZV6OQb Ou7yr4G3XHZaC59wxsgqRT0YvDoqzF6eazxZA0ivxVV8rlTJvjBHYOuThCEUkI5AyIrD 16AA== 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=3tomXufxwo6Fq4U6Mhi3QbG5IOffUz8BLm6xAs40j8s=; b=x9txjjf0PvQbvaP3LILDyHBjlLOai5xH1f7xpL8GQ2sZaihcSUreBtl/KntzQaBopo Vi5kiV9WiGyBzvfNBAMEnqjTwI2SBazc48rPH9pUZ5gNl9lm+6TRmkkXNvjusVaJIrzJ IeBqupIxY/zWh+zuEyaNA16H635daufopJJuWAl9LPB6LLEqs7RgRzxpGBlNzSZGiVb5 sqXSFBxFD1kM+EiML2h/doR7wqn8XouzZYCe/cIsqxj/zZEbKWvOlLq/OxomuDnTEnIy hlS8qbx0LeQF1jLVumKgWxmZAqqyA32YI/KaPlcAj4m5uPjtiVmY5dbcZaYnuZp2rI7S Vlag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=qGwBvdOJ; 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 jg41-20020a170907972900b0078e0e850902si3910713ejc.868.2022.12.01.03.05.57; Thu, 01 Dec 2022 03:06:27 -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=qGwBvdOJ; 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 S230227AbiLALE2 (ORCPT + 99 others); Thu, 1 Dec 2022 06:04:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbiLALDu (ORCPT ); Thu, 1 Dec 2022 06:03:50 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E348EAB002; Thu, 1 Dec 2022 03:03:46 -0800 (PST) Received: from jinankjain-dranzer.zrrkmle5drku1h0apvxbr2u2ee.ix.internal.cloudapp.net (unknown [20.188.121.5]) by linux.microsoft.com (Postfix) with ESMTPSA id 8811020B83C2; Thu, 1 Dec 2022 03:03:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8811020B83C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1669892626; bh=3tomXufxwo6Fq4U6Mhi3QbG5IOffUz8BLm6xAs40j8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qGwBvdOJBGYPQc4tSFjNvAkB3nSmOgT/Unfa5JHYTmxiJOjqKuadEL3m7ZbqNHn3t Ee4khXSO+BdUPnZGBK+PXuuvGpXX5QaE+H71XvVIrBtjhmpUHBrnXAisX5PB/hbUNz RNrbHhEzMvyEU9UIUsuxKnhcJsV0kJaBuUi5CCo0= 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 v7 0/5] Add support running nested Microsoft Hypervisor Date: Thu, 1 Dec 2022 11:03:34 +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?1751009500012058408?= 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. 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 | 91 +++++++++++++++++++++++++++ arch/x86/kernel/idt.c | 9 +++ drivers/hv/hv.c | 99 ++++++++++++++++++++++-------- drivers/hv/hv_common.c | 9 ++- drivers/hv/vmbus_drv.c | 5 +- include/asm-generic/hyperv-tlfs.h | 1 + include/asm-generic/mshyperv.h | 6 +- 11 files changed, 258 insertions(+), 59 deletions(-)