lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <07fd3a6cea0abfa794483fa40feb0bfec0410efe.camel@infradead.org>
Date:   Sat, 11 Mar 2023 10:21:12 +0000
From:   David Woodhouse <dwmw2@...radead.org>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Usama Arif <usama.arif@...edance.com>, kim.phillips@....com,
        brgerst@...il.com
Cc:     piotrgorski@...hyos.org, oleksandr@...alenko.name,
        arjan@...ux.intel.com, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, x86@...nel.org,
        pbonzini@...hat.com, paulmck@...nel.org,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        rcu@...r.kernel.org, mimoja@...oja.de, hewenliang4@...wei.com,
        thomas.lendacky@....com, seanjc@...gle.com, pmenzel@...gen.mpg.de,
        fam.zheng@...edance.com, punit.agrawal@...edance.com,
        simon.evans@...edance.com, liangma@...ngbit.com,
        "Guilherme G . Piccoli" <gpiccoli@...lia.com>
Subject: Re: [PATCH v14 05/12] x86/smpboot: Split up native_cpu_up into
 separate phases and document them

On Sat, 2023-03-11 at 11:19 +0200, Thomas Gleixner wrote:
> On Wed, Mar 08 2023 at 17:13, Usama Arif wrote:
> >  
> > +int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
> > +{
> > +       int ret;
> > +
> > +       ret = do_cpu_up(cpu, tidle);
> > +       if (ret)
> > +               return ret;
> 
> In case of error this leaves the warm reset vector dangling.
> 
> > +       ret = do_wait_cpu_initialized(cpu);
> > +       if (ret)
> > +               return ret;
> > +
> > +       ret = do_wait_cpu_callin(cpu);
> > +       if (ret)
> > +               return ret;
> 
> Same for these two error returns.
> 
> Thanks,
> 
>         tglx

On top of the idle_thread_get() one. Pushed to 
https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/parallel-6.2-v15

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 980cc2c4a84f..895395787afc 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1347,25 +1347,23 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 	if (!do_parallel_bringup) {
 		ret = do_cpu_up(cpu, tidle);
 		if (ret)
-			return ret;
+			goto out;
 	}
 
 	ret = do_wait_cpu_initialized(cpu);
 	if (ret)
-		return ret;
+		goto out;
 
 	ret = do_wait_cpu_callin(cpu);
 	if (ret)
-		return ret;
+		goto out;
 
 	ret = do_wait_cpu_online(cpu);
 
-	if (x86_platform.legacy.warm_reset) {
-		/*
-		 * Cleanup possible dangling ends...
-		 */
+ out:
+	/* Cleanup possible dangling ends... */
+	if (x86_platform.legacy.warm_reset)
 		smpboot_restore_warm_reset_vector();
-	}
 
 	return ret;
 }
@@ -1373,7 +1371,7 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 /* Bringup step one: Send INIT/SIPI to the target AP */
 static int native_cpu_kick(unsigned int cpu)
 {
-	return do_cpu_up(cpu, idle_thread_get(cpu));
+	return do_cpu_up(cpu, idle_thread_get(cpu, true));
 }
 
 /**


Download attachment "smime.p7s" of type "application/pkcs7-signature" (5965 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ