Message ID | b5ea40f7e84e17a4338a313ab74292a293b1efa4.1667406350.git.jinankjain@linux.microsoft.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp17546wru; Wed, 2 Nov 2022 09:43:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WaqLKhZzZt1lKO/UGquzEHeU0wAoDXR0tUT098vyWGH1TL4YCag0x0pcL8UD6uGjDne0G X-Received: by 2002:aa7:d710:0:b0:463:bd7b:2b44 with SMTP id t16-20020aa7d710000000b00463bd7b2b44mr8896237edq.385.1667407396185; Wed, 02 Nov 2022 09:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667407396; cv=none; d=google.com; s=arc-20160816; b=vmVg8+9qsz1o2ZXotfI68GKkVE2MqXSPs97KvfW/bzpqX/BNzrvkdoJO+R5ZhzUY9r I3ZGZfGOVrFov7BpBLQzA9EmqsFozMkvtCAp03zVCakiYfHQyuSzNtQjrFzwN/oGmDnk NdK1B6vTU3DSIQbub2+TL9hU/mNaCCG9dmBVn7rsKCKqwLvFENt15wFo1inf/r7vxFOy LP1lJu61sHbhIbhcLwygSl4ND7QM0oWEIYGhcELg3sbYWS/jtAIRQRDLAOuET9jT0oQ0 5t4yC+3waVB6XQ5bnikpPzpEXxecOCagAvUPdDnAEaEa0gky+20aBp8M6MxkTfTMQ8ju H55A== 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=1B9p6pFN0yHl6pLuVEuKSNR9XxSBhvzkr5T1mlusw7Q=; b=sTmwDTOplS5KAB1XT+LKwd3A/rZRtNR1cdtEeJKzTEjTB/u7qP/WfAvv8aGcSsZ1bh Xr69aam5P+O7Yf1l9qbBBD0uZVLj3x3Yur2TDd5NSONIcAxEBgoD6kWvePypfXu+Ji8F alVUuNaOOcpykqyGtHtXgLufBhtkxsBd+28ZoAFiZvfR0jHCiy69GJqC8b4cxvO/PfUJ 2Gyruduwdo0fuCe2+xsHwRdoEVQkoR9u64d5Hf3z9UZzam3mosikaCrB46g+Csjazk// MjTAGIKn5l5Mf1LqCVkaXoFfMWuviPOWPGu67dWQfssPU0yDsLcoz7TflgJcECvPFU0y ej+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=bEfUmfGA; 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 dp20-20020a170906c15400b0078df19995e4si17384315ejc.241.2022.11.02.09.42.47; Wed, 02 Nov 2022 09:43:16 -0700 (PDT) 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=bEfUmfGA; 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 S232102AbiKBQmG (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Wed, 2 Nov 2022 12:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231944AbiKBQlU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Nov 2022 12:41:20 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D24082EF47; Wed, 2 Nov 2022 09:36:25 -0700 (PDT) Received: from jinankjain-dranzer.zrrkmle5drku1h0apvxbr2u2ee.ix.internal.cloudapp.net (unknown [20.188.121.5]) by linux.microsoft.com (Postfix) with ESMTPSA id AD76720C333D; Wed, 2 Nov 2022 09:36:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AD76720C333D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1667406985; bh=1B9p6pFN0yHl6pLuVEuKSNR9XxSBhvzkr5T1mlusw7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEfUmfGAOBS5gITdkhShpUgdIYz8e+w/nnho/XxjusjA2Kkf5dnpHM4P8CHymhhL8 8HCaxw248anAGvGRKkFoo8Qmn43xKnKtKQfY9wCv17wcfD2JfZKky368V8dGvXvmkG ak3Witv1f52bZtBBpaQGXphevowOygPlmqzZFDeg= From: Jinank Jain <jinankjain@linux.microsoft.com> To: jinankjain@microsoft.com Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@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 Subject: [PATCH v2 4/5] hv: Enable vmbus driver for nested root partition Date: Wed, 2 Nov 2022 16:36:01 +0000 Message-Id: <b5ea40f7e84e17a4338a313ab74292a293b1efa4.1667406350.git.jinankjain@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1667406350.git.jinankjain@linux.microsoft.com> References: <cover.1667406350.git.jinankjain@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748403377674383072?= X-GMAIL-MSGID: =?utf-8?q?1748403377674383072?= |
Series |
Add support running nested Microsoft Hypervisor
|
|
Commit Message
Jinank Jain
Nov. 2, 2022, 4:36 p.m. UTC
Currently VMBus driver is not initialized for root partition but we need
to enable the VMBus driver for nested root partition. This is required
to expose VMBus devices to the L2 guest in the nested setup.
Signed-off-by: Jinank Jain <jinankjain@linux.microsoft.com>
---
drivers/hv/vmbus_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
From: Jinank Jain <jinankjain@linux.microsoft.com> Sent: Wednesday, November 2, 2022 9:36 AM > > Currently VMBus driver is not initialized for root partition but we need > to enable the VMBus driver for nested root partition. This is required > to expose VMBus devices to the L2 guest in the nested setup. > > Signed-off-by: Jinank Jain <jinankjain@linux.microsoft.com> > --- > drivers/hv/vmbus_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > index 8b2e413bf19c..2f0cf75e811b 100644 > --- a/drivers/hv/vmbus_drv.c > +++ b/drivers/hv/vmbus_drv.c > @@ -2723,7 +2723,7 @@ static int __init hv_acpi_init(void) > if (!hv_is_hyperv_initialized()) > return -ENODEV; > > - if (hv_root_partition) > + if (hv_root_partition && !hv_nested) Note that this code must compile and run when Linux is built to run as a guest on Hyper-V for ARM64. There's currently no definition for hv_nested on the ARM64 side, so the compile will fail. But per my comments in Patch 1 in this series, using the same technique as for hv_root_partition in hv_common.c should solve the ARM64 problem as well. > return 0; > > /* > -- > 2.25.1
On Wed, Nov 02, 2022 at 04:36:01PM +0000, Jinank Jain wrote: > Currently VMBus driver is not initialized for root partition but we need > to enable the VMBus driver for nested root partition. This is required > to expose VMBus devices to the L2 guest in the nested setup. Perhaps more importantly, this is required so that L2 _root_ can use the VMBus devices. > > Signed-off-by: Jinank Jain <jinankjain@linux.microsoft.com> > --- > drivers/hv/vmbus_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > index 8b2e413bf19c..2f0cf75e811b 100644 > --- a/drivers/hv/vmbus_drv.c > +++ b/drivers/hv/vmbus_drv.c > @@ -2723,7 +2723,7 @@ static int __init hv_acpi_init(void) > if (!hv_is_hyperv_initialized()) > return -ENODEV; > > - if (hv_root_partition) > + if (hv_root_partition && !hv_nested) > return 0; > > /* > -- > 2.25.1
On Thu, Nov 03, 2022 at 03:30:35AM +0000, Michael Kelley (LINUX) wrote: > From: Jinank Jain <jinankjain@linux.microsoft.com> Sent: Wednesday, November 2, 2022 9:36 AM > > > > Currently VMBus driver is not initialized for root partition but we need > > to enable the VMBus driver for nested root partition. This is required > > to expose VMBus devices to the L2 guest in the nested setup. > > > > Signed-off-by: Jinank Jain <jinankjain@linux.microsoft.com> > > --- > > drivers/hv/vmbus_drv.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > > index 8b2e413bf19c..2f0cf75e811b 100644 > > --- a/drivers/hv/vmbus_drv.c > > +++ b/drivers/hv/vmbus_drv.c > > @@ -2723,7 +2723,7 @@ static int __init hv_acpi_init(void) > > if (!hv_is_hyperv_initialized()) > > return -ENODEV; > > > > - if (hv_root_partition) > > + if (hv_root_partition && !hv_nested) > > Note that this code must compile and run when Linux is built > to run as a guest on Hyper-V for ARM64. There's currently > no definition for hv_nested on the ARM64 side, so the compile > will fail. But per my comments in Patch 1 in this series, using the > same technique as for hv_root_partition in hv_common.c should > solve the ARM64 problem as well. Jinank, you can use the following commands to cross-compile Linux. make ARCH=arm64 mshv_defconfig make -j$(nproc) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image I think there are some follow-up patches in the internal tree which fixed the arm64 build. You may be able to squash some of those patches into series. Thanks, Wei.
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 8b2e413bf19c..2f0cf75e811b 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -2723,7 +2723,7 @@ static int __init hv_acpi_init(void) if (!hv_is_hyperv_initialized()) return -ENODEV; - if (hv_root_partition) + if (hv_root_partition && !hv_nested) return 0; /*