From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E7B63EDAA5; Thu, 23 Apr 2026 12:43:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776948233; cv=none; b=kyDfttBG5vMRAxTUIDGtCP7luZqR3pqrU18iRcY4c99jA7LGIrkRn5VC+PY5f24KmF9sJD3P528n88EWkgS1LTITT+B1dn6k0zzRXkGlBpdf+1aHi+tmWvB7JqcxnRWzXroTgTDDlmARrgPae1CZJ3TjNlIuHmyU+McllzcWQX0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776948233; c=relaxed/simple; bh=G6rRZTfAM29k5zPVR/ARwkGaN/9gK2H/QSOjtVbIZj0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r0vUGpxHtluSuhe7tHjdxsE+qunJeiL+xtms2b9a4dhj4JZwfng9QJ0PvSdCpaJddQgzwGZ8szc4axkJD0MBwU4pZgITBAe9kjRzPDZB2llQerVHFQB3v2PYAF5gVdGQ4K/Mz7abd3esZFWe1DRDiHGbewsQtIdE9O2W8Qc07xQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=YxO7hPzN; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="YxO7hPzN" Received: from CPC-namja-026ON.redmond.corp.microsoft.com (unknown [4.213.232.18]) by linux.microsoft.com (Postfix) with ESMTPSA id EF51020B716B; Thu, 23 Apr 2026 05:43:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com EF51020B716B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1776948232; bh=KqEEuEXQvpD/kvIiGjagKYi0LOOzLGoRJMfm2FtbD3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YxO7hPzNELzGH9P0Z2ujovLhGRHcJDfzVksL8WlejF6Q0UKhR2rFbwJGoIu8dXiV2 MYu+15iX7h+FJfSOE3IiGnlOzUBYnjy3nkG/aE/HMExXqJdFMKYcIjIOfsVZ9M6lw2 YyVElBj/tFqH5GtAW4RPqFMZ6+qEIS6LP4RrqOH4= From: Naman Jain To: "K . Y . Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Arnd Bergmann , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Michael Kelley Cc: Marc Zyngier , Timothy Hayes , Lorenzo Pieralisi , Sascha Bischoff , mrigendrachaubey , Naman Jain , linux-hyperv@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org, vdso@mailbox.org, ssengar@linux.microsoft.com Subject: [PATCH v2 11/15] mshv_vtl: Let userspace do VSM configuration Date: Thu, 23 Apr 2026 12:42:01 +0000 Message-ID: <20260423124206.2410879-12-namjain@linux.microsoft.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260423124206.2410879-1-namjain@linux.microsoft.com> References: <20260423124206.2410879-1-namjain@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The kernel currently sets the VSM configuration register, thereby imposing certain VSM configuration on the userspace (OpenVMM). The userspace (OpenVMM) has the capability to configure this register, and it is already doing it using the generic hypercall interface. The configuration can vary based on the use case or architectures, so let userspace take care of configuring it and remove this logic in the kernel driver. Signed-off-by: Roman Kisel Reviewed-by: Michael Kelley Reviewed-by: Roman Kisel Signed-off-by: Naman Jain --- drivers/hv/mshv_vtl_main.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c index c79d24317b8e..4c9ae65ad3e8 100644 --- a/drivers/hv/mshv_vtl_main.c +++ b/drivers/hv/mshv_vtl_main.c @@ -222,30 +222,6 @@ static int mshv_vtl_get_vsm_regs(void) return ret; } -static int mshv_vtl_configure_vsm_partition(struct device *dev) -{ - union hv_register_vsm_partition_config config; - struct hv_register_assoc reg_assoc; - - config.as_uint64 = 0; - config.default_vtl_protection_mask = HV_MAP_GPA_PERMISSIONS_MASK; - config.enable_vtl_protection = 1; - config.zero_memory_on_reset = 1; - config.intercept_vp_startup = 1; - config.intercept_cpuid_unimplemented = 1; - - if (mshv_vsm_capabilities.intercept_page_available) { - dev_dbg(dev, "using intercept page\n"); - config.intercept_page = 1; - } - - reg_assoc.name = HV_REGISTER_VSM_PARTITION_CONFIG; - reg_assoc.value.reg64 = config.as_uint64; - - return hv_call_set_vp_registers(HV_VP_INDEX_SELF, HV_PARTITION_ID_SELF, - 1, input_vtl_zero, ®_assoc); -} - static void mshv_vtl_vmbus_isr(void) { struct hv_per_cpu_context *per_cpu; @@ -1168,11 +1144,6 @@ static int __init mshv_vtl_init(void) ret = -ENODEV; goto free_dev; } - if (mshv_vtl_configure_vsm_partition(dev)) { - dev_emerg(dev, "VSM configuration failed !!\n"); - ret = -ENODEV; - goto free_dev; - } mshv_vtl_return_call_init(mshv_vsm_page_offsets.vtl_return_offset); ret = hv_vtl_setup_synic(); -- 2.43.0