[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a7ek7fqk.fsf@vitty.brq.redhat.com>
Date: Fri, 14 Jun 2019 10:06:43 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Dmitry Safonov <dima@...sta.com>, linux-kernel@...r.kernel.org,
Prasanna Panchamukhi <panchamukhi@...sta.com>,
Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Cathy Avery <cavery@...hat.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
"Michael Kelley \(EOSG\)" <Michael.H.Kelley@...rosoft.com>,
Mohammed Gamal <mmorsy@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Radim Krčmář <rkrcmar@...hat.com>,
Roman Kagan <rkagan@...tuozzo.com>,
Sasha Levin <sashal@...nel.org>,
Stephen Hemminger <sthemmin@...rosoft.com>,
devel@...uxdriverproject.org, kvm@...r.kernel.org,
linux-hyperv@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH] x86/hyperv: Disable preemption while setting reenlightenment vector
Thomas Gleixner <tglx@...utronix.de> writes:
> On Wed, 12 Jun 2019, Vitaly Kuznetsov wrote:
>> Dmitry Safonov <dima@...sta.com> writes:
>> > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
>> > index 1608050e9df9..0bdd79ecbff8 100644
>> > --- a/arch/x86/hyperv/hv_init.c
>> > +++ b/arch/x86/hyperv/hv_init.c
>> > @@ -91,7 +91,7 @@ EXPORT_SYMBOL_GPL(hv_max_vp_index);
>> > static int hv_cpu_init(unsigned int cpu)
>> > {
>> > u64 msr_vp_index;
>> > - struct hv_vp_assist_page **hvp = &hv_vp_assist_page[smp_processor_id()];
>> > + struct hv_vp_assist_page **hvp = &hv_vp_assist_page[cpu];
>> > void **input_arg;
>> > struct page *pg;
>> >
>> > @@ -103,7 +103,7 @@ static int hv_cpu_init(unsigned int cpu)
>> >
>> > hv_get_vp_index(msr_vp_index);
>> >
>> > - hv_vp_index[smp_processor_id()] = msr_vp_index;
>> > + hv_vp_index[cpu] = msr_vp_index;
>> >
>> > if (msr_vp_index > hv_max_vp_index)
>> > hv_max_vp_index = msr_vp_index;
>>
>> The above is unrelated cleanup (as cpu == smp_processor_id() for
>> CPUHP_AP_ONLINE_DYN callbacks), right? As I'm pretty sure these can'd be
>> preempted.
>
> They can be preempted, but they are guaranteed to run on the upcoming CPU,
> i.e. smp_processor_id() is allowed even in preemptible context as the task
> cannot migrate.
>
Ah, right, thanks! The guarantee that they don't migrate should be enough.
--
Vitaly
Powered by blists - more mailing lists