[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SA1PR21MB1335B3A3622A80526E68A28ABF15A@SA1PR21MB1335.namprd21.prod.outlook.com>
Date: Wed, 16 Aug 2023 19:57:40 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: Tianyu Lan <ltykernel@...il.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
"daniel.lezcano@...aro.org" <daniel.lezcano@...aro.org>,
"arnd@...db.de" <arnd@...db.de>,
"Michael Kelley (LINUX)" <mikelley@...rosoft.com>
CC: Tianyu Lan <Tianyu.Lan@...rosoft.com>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
vkuznets <vkuznets@...hat.com>,
"Michael Kelley (LINUX)" <mikelley@...rosoft.com>
Subject: RE: [PATCH v6 2/8] x86/hyperv: Set Virtual Trust Level in VMBus init
message
> From: Tianyu Lan <ltykernel@...il.com>
> Sent: Wednesday, August 16, 2023 8:59 AM
> [...]
> @@ -378,6 +378,36 @@ static void __init hv_get_partition_id(void)
> local_irq_restore(flags);
> }
>
> +static u8 __init get_vtl(void)
> +{
> + u64 control = HV_HYPERCALL_REP_COMP_1 |
> HVCALL_GET_VP_REGISTERS;
> + struct hv_get_vp_registers_input *input;
> + struct hv_get_vp_registers_output *output;
> + unsigned long flags;
> + u64 ret = 0;
Nitpick: we don't have to initialize 'ret' here.
Reviewed-by: Dexuan Cui <decui@...rosoft.com>
> +
> + local_irq_save(flags);
> + input = *this_cpu_ptr(hyperv_pcpu_input_arg);
> + output = (struct hv_get_vp_registers_output *)input;
> +
> + memset(input, 0, struct_size(input, element, 1));
> + input->header.partitionid = HV_PARTITION_ID_SELF;
> + input->header.vpindex = HV_VP_INDEX_SELF;
> + input->header.inputvtl = 0;
> + input->element[0].name0 = HV_X64_REGISTER_VSM_VP_STATUS;
> +
> + ret = hv_do_hypercall(control, input, output);
'ret' is always initialized here.
> + if (hv_result_success(ret)) {
> + ret = output->as64.low & HV_X64_VTL_MASK;
> + } else {
> + pr_err("Failed to get VTL(%lld) and set VTL to zero by
> default.\n", ret);
> + ret = 0;
> + }
> +
> + local_irq_restore(flags);
> + return ret;
> +}
Powered by blists - more mailing lists