From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32DFCC433FE for ; Tue, 1 Mar 2022 08:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233364AbiCAI1i (ORCPT ); Tue, 1 Mar 2022 03:27:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiCAI1h (ORCPT ); Tue, 1 Mar 2022 03:27:37 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CE477A998; Tue, 1 Mar 2022 00:26:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E87A0B817D0; Tue, 1 Mar 2022 08:26:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F136C340EE; Tue, 1 Mar 2022 08:26:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646123212; bh=TwhJPmV9y9c3eqT3zE3wD0HQcup9gYh9eXtwtOtu4EQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=w7cJw0GLrgvMVletWXAGP6NYKkLVc9SJg4Anj/PRy87gWz9cM9TPHo2vyESw4fNin WAUrVotZQVMP0A/c4VFlWPbg10DELaJEYtCFptAvCdTTi0FzoKnV9aqag/LwB+daVd Ag/8qLqQqiBEjuXASy363BhMQb7wiyxSd3Gb/kRI= Date: Tue, 1 Mar 2022 09:26:49 +0100 From: Greg KH To: Ammar Faizi Cc: Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , Tony Luck , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, gwml@vger.gnuweeb.org, x86@kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] x86/delay: Fix the wrong asm constraint in `delay_loop()` Message-ID: References: <20220301073223.98236-1-ammarfaizi2@gnuweeb.org> <20220301073223.98236-2-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220301073223.98236-2-ammarfaizi2@gnuweeb.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 01, 2022 at 02:32:22PM +0700, 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 change > the @loops. > > If by any chance the compiler inlines this function, it may clobber > random stuff (e.g. local variable, important temporary value in reg, > etc.). > > Fortunately, delay_loop() is only called indirectly (so it can't > inline), and then the register it clobbers is %rax (which is by the > nature of the calling convention, it's a caller saved register), so it > didn't yield any bug. > > ^ That shouldn't be an excuse for using the wrong constraint anyway. > > This changes "a" (as an input) to "+a" (as an input and output). > > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: "H. Peter Anvin" > Fixes: e01b70ef3eb3080fecc35e15f68cd274c0a48163 ("x86: fix bug in arch/i386/lib/delay.c file, delay_loop function") You only need 12 characters here :) > Signed-off-by: Ammar Faizi > --- Why is this one not tagged for stable?