[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNak31AH7u7rR9oS@liuwe-devbox-debian-v2>
Date: Fri, 11 Aug 2023 21:15:11 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Dexuan Cui <decui@...rosoft.com>
Cc: 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>,
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>
Subject: Re: [PATCH V5 2/8] x86/hyperv: Set Virtual Trust Level in VMBus init
message
On Thu, Aug 10, 2023 at 10:59:35PM +0000, Dexuan Cui wrote:
> > From: Tianyu Lan <ltykernel@...il.com>
> > Sent: Thursday, August 10, 2023 9:04 AM
> > [...]
> > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> > @@ -378,6 +378,41 @@ 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;
>
> This should be
> u64 ret = 0;
>
> > + local_irq_save(flags);
> > + input = *this_cpu_ptr(hyperv_pcpu_input_arg);
> > + output = (struct hv_get_vp_registers_output *)input;
> > + if (!input) {
> > + local_irq_restore(flags);
> > + goto done;
>
> Here the uninitialized 'ret' is returned.
>
> If we move the "done:" label one line earlier, we won't need the
> the above " local_irq_restore(flags);"
> Maybe we should add a WARN_ON_ONCE(1) before "goto done"?
Out of interest why will input be NULL here?
Thanks,
Wei.
Powered by blists - more mailing lists