From patchwork Tue Apr 4 09:01:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurabh Singh Sengar X-Patchwork-Id: 78941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2881780vqo; Tue, 4 Apr 2023 02:09:22 -0700 (PDT) X-Google-Smtp-Source: AKy350bAo89PnG1Yp6Hkc+tksttD31X6evWp1w4DbggJRuAnwkeBsg9e4qa5bHIg+kwyGdqHo985 X-Received: by 2002:a17:903:2015:b0:1a2:4efa:fcc0 with SMTP id s21-20020a170903201500b001a24efafcc0mr1698786pla.1.1680599362011; Tue, 04 Apr 2023 02:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680599361; cv=none; d=google.com; s=arc-20160816; b=xwfps/dXbghQDYyPHQBltMorcnlxXMUE35Y+mZdk/15abmCvUJ3arqy1fSIDYO3+9d aIW/HCgZ2euhhAvw/qeo0xBB8ifsmztW309Il4fV4E733ZsFlPZFVanCHNezg25zwp3D k9P7cg9rXwbnU6N665lhr8+1NcCZa3KyZTuvr1kE8GAd7m4HiWgiJAmv3jx2dnRABRLj znRzjl/aahWDaNIwywOX9eFNlkQWepcPFDDooSZzQG1W9907QK12PL7GETJPCcFG/Z1q r5r9iHIWMaVnTLpsLEFvYxdwpoVRZ0JoZBH3F1rHyQCPi0ePV8Qx2YEKWTZGktGydy6q Dx/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter; bh=ZJSNDxHuoCpxuFP6EwKcvSgo1VZVW6Qhmfhsxpz/kw8=; b=taNK34ImMJcr25XqUaB05VHeULfVwHvbfCQWI9HTq0h51wgSLaw8AHJt5G6wCGWVE3 DgXCE5JOUSqYZH0Ro3YimgqpODhcEk/74sfk+15+rUqiTxzxaDHWtMZyWOewGzLO6vtd DGYsX3joNr50baUm+3WPcWOcuGFMoVwO0t40Mes73mahILBSzTvk213iNBMgvgcA2S1g +EQ4iXMgEZJ6bMo8nd3v3c2VPLuvVynqVcNae/UyNaypaiRjiFdbW9g7mwAHo/ryyIun cGi3XhYRlm4WxEyfKtkCuravDkZvtLH4Z41hBStJi4ZgGB1gvL1ScFpCX/s/jOF65E7M OIdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=qEkczgNL; 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 z8-20020a63e548000000b0050fa04005e6si10250814pgj.412.2023.04.04.02.09.09; Tue, 04 Apr 2023 02:09:21 -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=qEkczgNL; 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 S234199AbjDDJBR (ORCPT + 99 others); Tue, 4 Apr 2023 05:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233809AbjDDJBL (ORCPT ); Tue, 4 Apr 2023 05:01:11 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12E1710EA; Tue, 4 Apr 2023 02:01:09 -0700 (PDT) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 5CFFE210DD92; Tue, 4 Apr 2023 02:01:09 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5CFFE210DD92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1680598869; bh=ZJSNDxHuoCpxuFP6EwKcvSgo1VZVW6Qhmfhsxpz/kw8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qEkczgNLHrbA3o4tZ+Z2OJTojDuZCgYBbC4JUHLVLlm9IEDH/xDJaOOiAFH5w/7uA 8RKrcuhqYvQcMR/0bSt3NtXGYOuggo2pdnvscFehVu8M8zkwZNGGolVa66zPHtnram OllAPOZgFB2eTgPPFoaMwU52Xbi4uBfhLqcTRxlk= From: Saurabh Sengar To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, arnd@arndb.de, tiala@microsoft.com, mikelley@microsoft.com, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-arch@vger.kernel.org, jgross@suse.com, mat.jonczyk@o2.pl Subject: [PATCH v4 4/5] Drivers: hv: Kconfig: Add HYPERV_VTL_MODE Date: Tue, 4 Apr 2023 02:01:03 -0700 Message-Id: <1680598864-16981-5-git-send-email-ssengar@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1680598864-16981-1-git-send-email-ssengar@linux.microsoft.com> References: <1680598864-16981-1-git-send-email-ssengar@linux.microsoft.com> X-Spam-Status: No, score=-17.9 required=5.0 tests=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=unavailable 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?1762236156440493349?= X-GMAIL-MSGID: =?utf-8?q?1762236156440493349?= Add HYPERV_VTL_MODE Kconfig flag for VTL mode. Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley --- drivers/hv/Kconfig | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 0747a8f1fcee..511f2e012c59 100644 --- a/drivers/hv/Kconfig +++ b/drivers/hv/Kconfig @@ -13,6 +13,30 @@ config HYPERV Select this option to run Linux as a Hyper-V client operating system. +config HYPERV_VTL_MODE + bool "Enable Linux to boot in VTL context" + depends on X86_64 && HYPERV + default n + help + Virtual Secure Mode (VSM) is a set of hypervisor capabilities and + enlightenments offered to host and guest partitions which enables + the creation and management of new security boundaries within + operating system software. + + VSM achieves and maintains isolation through Virtual Trust Levels + (VTLs). Virtual Trust Levels are hierarchical, with higher levels + being more privileged than lower levels. VTL0 is the least privileged + level, and currently only other level supported is VTL2. + + Select this option to build a Linux kernel to run at a VTL other than + the normal VTL0, which currently is only VTL2. This option + initializes the x86 platform for VTL2, and adds the ability to boot + secondary CPUs directly into 64-bit context as required for VTLs other + than 0. A kernel built with this option must run at VTL2, and will + not run as a normal guest. + + If unsure, say N + config HYPERV_TIMER def_bool HYPERV && X86