On 9/1/2026 9:16 PM, Wei Liu wrote:
> On Tue, Sep 01, 2026 at 09:55:20AM -0700, Thara Gopinath wrote:
>> Linux VBS (LVBS) uses Hyper-V's Virtual Secure Mode to run a small
>> trusted kernel in VTL1 alongside the regular VTL0 kernel, so that
>> security-sensitive state (e.g. hypervisor-enforced code integrity,
>> credential isolation) can live behind a higher-privilege boundary
>> that VTL0 compromise cannot cross. Bringing that up from Linux
>> requires the VTL0 kernel to drive the VSM setup itself.
>>
>> Add drivers/hv/hv_vsm_boot.c as the entry point for that sequence.
>> This first step handles partition-level VTL1 enable only:
>>
>>   - Probe VSM / VP-register privileges and SynIC availability before
>>     doing anything.
>>   - Pin init to the VTL0 boot CPU so VTL1 comes up on the same CPU
>>     (later patches rely on this).
>>   - Read HV_REGISTER_VSM_PARTITION_STATUS, and if VTL1 is not already
>>     enabled, issue HVCALL_ENABLE_PARTITION_VTL with MBEC and confirm
>>     by re-reading the register.
>>
>> Signed-off-by: Thara Gopinath <[email protected]>
>> ---
> [...]
>> +static int __init hv_vsm_boot_init(void)
>> +{
>> +    cpumask_var_t mask;
>> +    unsigned int boot_cpu;
>> +    int ret;
>> +
>> +    if (!vsm_arch_has_vsm_access())
>> +            return 0;
>> +
>> +    /*
>> +     * Copy the current cpu mask and pin rest of the running code to boot 
>> cpu.
>> +     * Important since we want boot cpu of VTL0 to be the boot cpu for VTL1.
>> +     * ToDo: Check if copying and restoring current->cpus_mask is enough
>> +     * ToDo: Verify the assumption that cpumask_first(cpu_online_mask) is
>> +     * the boot cpu
> 
> Can we get closures on these todos?
> 
> I see a bunch of todos in other patches, too. It would be good to close
> them as well.

Sorry about those. Most of them are remnants from the when the dev work was
started and are closed or taken care of. I will ensure that these are fixed
and the comments are edited properly in the next revision.

Warm Regards
Thara
> 
> Wei



Reply via email to