From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gnuweeb.org (Postfix) with ESMTPS id 62DDB7E342 for ; Sun, 3 Apr 2022 17:14:36 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=zrAVVRGg; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=OHeTqdUk; dkim-atps=neutral From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649006074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qeX5ZeUnYTOArgEzqA+VxeAnatsMOvwz4R2yQNo81VE=; b=zrAVVRGgr3aLJGVv3hyhk7jnTYXWEIm5dkZ1fNM/Bl0C5OsG7ffPPegKCPzQIIZvCWz7Kd yjpFVF6N02aEtM3sE0c2vEVQrYRQCW8xt2d4DHW11kJx2Hjoc6RIYk1zasv1JD3iTjpQhQ my7nUQz9l3iRI0fcio+vWu6jBcj9QwgnNIemcV0flUUBNbK6FWYXjaJgobwKbquOTrFSIf 2Y9TdDwmaYLvZfYYXqRhl6WMeqpYYdeZr4rDsqi7FgpHWaO8TbKjxFF4wcxqKYH9K+p7x4 sRRBRIkiVAKQH8rkYw2fafSDCdMvXaBKGBVQMU3Jz3p1TM1TQj2jEv+UXJI18Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649006074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qeX5ZeUnYTOArgEzqA+VxeAnatsMOvwz4R2yQNo81VE=; b=OHeTqdUkuo3lHP2BLD7waUl18HFf0uDFgPug2zkqP+lUEQiUeA60vBhtipqIHO+7vOONC3 ofaPs7DvC1IHkbBg== To: Ammar Faizi , Borislav Petkov Cc: Ammar Faizi , Alviro Iskandar Setiawan , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Tony Luck , Yazen Ghannam , Linux Edac Mailing List , Linux Kernel Mailing List , Stable Kernel , GNU/Weeb Mailing List , x86 Mailing List , David Laight , Jiri Hladky Subject: Re: [PATCH v6 1/2] x86/delay: Fix the wrong asm constraint in `delay_loop()` In-Reply-To: <87zgl2ksu3.ffs@tglx> References: <20220329104705.65256-1-ammarfaizi2@gnuweeb.org> <20220329104705.65256-2-ammarfaizi2@gnuweeb.org> <87zgl2ksu3.ffs@tglx> Date: Sun, 03 Apr 2022 19:14:34 +0200 Message-ID: <87tubaks1x.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain List-Id: On Sun, Apr 03 2022 at 18:57, Thomas Gleixner wrote: > On Tue, Mar 29 2022 at 17:47, Ammar Faizi wrote: >> The asm constraint does not reflect that the asm statement can modify >> the value of @loops. But the asm statement in delay_loop() does modify >> the @loops. >> >> Specifiying the wrong constraint may lead to undefined behavior, it may >> clobber random stuff (e.g. local variable, important temporary value in >> regs, etc.). This is especially dangerous when the compiler decides to >> inline the function and since it doesn't know that the value gets >> modified, it might decide to use it from a register directly without >> reloading it. Ignore me, I misread this part of the explanation. Thanks, tglx