Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3026221lqo; Tue, 21 May 2024 04:57:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdgzvq1hA+EqbGwias3cfPqsyg8UwOg8icFZ+lbjL/int/52zVR71Mt+lWX0IPK7UwqlT468JZUTGmVFefVr3PaCzB+B4KZiOwSs8MpQ== X-Google-Smtp-Source: AGHT+IGuj4vitPQdQ8zq60l2+qskQq+fA9sRM42jB5C3qBelzkZQMH9GsP+ZOSBidZiQaYYu/3T6 X-Received: by 2002:a17:906:fe4a:b0:a59:a8a4:a59d with SMTP id a640c23a62f3a-a5a2d66aa6dmr2467458966b.62.1716292632777; Tue, 21 May 2024 04:57:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716292632; cv=pass; d=google.com; s=arc-20160816; b=bWhYmtBxxPB+D3Fr0wIkoT7W07Kh1tfrhADImr3mMA9vBJA7fk/DfWzjgyqFRSk6TL XlgCXuepOAzUCZ1HIEnEEqioc7UfB1Sx1xJp/3cpBxBCS1Fl0LLw+M6gpOvjmMZckLlI bQHdFBQ4OCw07v0r4Bc1ECP2gH2qqp77lkuZOdKTKtFdQzq/dv/X+0jTktyEU2/lPCS2 VS1p0H7CkG3ul1A6XVGqhUxS8asVmJXSy4IFM6IK+d5UQoiDTDWGn5phfTcApiNoCY2+ Ck+6ssz04HhstkalFCUJ0Ew+gd78050meshOydT2h2g94bJCHGVTAa9vDrHWLVoeiDIN pUbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=aEI4SdcRYabaSTOLSIeu7XfK6qRDcKJ8S+m9FjIEDsE=; fh=lC3L+tLu9jMrTwLXdci/D+zTDmYl6oRylGrfIkeVy60=; b=iW0fLyKrDfQyWmbpzrvBgbia5jkQaNvl6964o8q6N2iKKFYH9Uy08Vzqna9BVMq8Cr 491Ac1/C98shp1kSkOmfih+DJ2mnQxz8abVS4QmxVwBDArAnAzkAcuYUcmi/IPoHhYaV oKAHmsfUggmaigFlRw9gTtepqtbSJG9861gGRrJW22FQUHNdSRzChdu+gnsimTUa9IAA vbNOAUVxjK4uNu0cPF2CeZYldYIHGOW/vbEpt+Gmoh0Kz+CA0IFITkRlb8wasjfb7yD5 m+/UnIKDQW8BsF8boJO6RW89aUIdzntN7RUXC4MkxxNxRoxtXNxhEcczxiLXCaWSAZ8g N4lw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=j2koresz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-184912-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184912-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be8becsi1392745066b.871.2024.05.21.04.57.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 04:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184912-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=j2koresz; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-184912-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184912-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5BEEE1F23583 for ; Tue, 21 May 2024 11:57:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F40B675817; Tue, 21 May 2024 11:57:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="j2koresz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kvToPjsn" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0BB96CDC4; Tue, 21 May 2024 11:57:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716292624; cv=none; b=i3aGxXTE3Dq6WR+9oqDO6VY2p2ltqLaxxrSTfBVZyl5fmusfQto05uMAgMywap4Bwgt3gUAyPFT8Hnv1iSYDHJIgQvn6mVUWSkQTCw+HJXxxOMXH5mdRAi/3im0CXGeFxhjKyO9l7t2CYFE3N8hz/nI0x/UH5pgo/PAQYd1RYuM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716292624; c=relaxed/simple; bh=Xrdr431T0DFBXM3LLa9LNptGoGbSvbG9e7q6cs2jaos=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=fKuvlWQyIq+XhZuzbk9bn2czR4PL1cT3btqng+NowL2jIyrt25Txw0NGZrdjlYLWslxAn6wi4MWKGeCmbLSIyBoUwR+9Mj4fTWWwWhe9KUMN+QuFOdsPe20RjIZuUN9TPZcBAjc53owRvBMLkgILIT9Jx0CQpWb9tTkJtoNbCY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=j2koresz; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kvToPjsn; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 21 May 2024 11:57:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716292621; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aEI4SdcRYabaSTOLSIeu7XfK6qRDcKJ8S+m9FjIEDsE=; b=j2koresz79STAkDRiSELqUKw+gbjU3/99gHjPIdEEwn0uUfKhH+FSA5AVv3cBGxm+znhrr MbMpBsY3P1AY/jltgSWFtMyv0XQkSPewypgXD9l3MlxWl4O4lP01xhmoLyCY1OPN0Ic5TP H/JqsIuuRnvt0r79WnDwfM47dbsZugkePioerVIso/nq1dyN3CSZgF+V5bnLv5moAFDxj7 lIf3yYIcyD0no87zGEPke2TcYHlQyXb+9Kyo+oVwiJ6fMrZfNHNR8oO/rmIC8+yULSUISn 7Xb/7nuGXGHxLIEqeGuvkQ6SJke9zrs3qKN0tP/FrItIumGp/8PQ6HEmEEhkMQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716292621; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aEI4SdcRYabaSTOLSIeu7XfK6qRDcKJ8S+m9FjIEDsE=; b=kvToPjsntBrKF4129XhctlOeddi12pjV5qcQrTcgNrR7WHECl+nSaCeMIlJKIVV2ckDabV q/EazoIrJ7d9OUDg== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/boot: Use current_stack_pointer to avoid asm() in init_heap() Cc: Uros Bizjak , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240520083011.135342-1-ubizjak@gmail.com> References: <20240520083011.135342-1-ubizjak@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171629262087.10875.8849677586858232819.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/boot branch of tip: Commit-ID: b855cc58fc93c175fd5bb868d5e3a45cb3e1a42b Gitweb: https://git.kernel.org/tip/b855cc58fc93c175fd5bb868d5e3a45cb3e1a42b Author: Uros Bizjak AuthorDate: Mon, 20 May 2024 10:29:55 +02:00 Committer: Ingo Molnar CommitterDate: Tue, 21 May 2024 13:36:36 +02:00 x86/boot: Use current_stack_pointer to avoid asm() in init_heap() Use current_stack_pointer to avoid asm() in the calculation of stack_end in init_heap(). The new code is more readable and results in exactly the same object file. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20240520083011.135342-1-ubizjak@gmail.com --- arch/x86/boot/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c index 9049f39..ac78f8c 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c @@ -119,9 +119,8 @@ static void init_heap(void) char *stack_end; if (boot_params.hdr.loadflags & CAN_USE_HEAP) { - asm("leal %n1(%%esp),%0" - : "=r" (stack_end) : "i" (STACK_SIZE)); - + stack_end = (char *) + (current_stack_pointer - STACK_SIZE); heap_end = (char *) ((size_t)boot_params.hdr.heap_end_ptr + 0x200); if (heap_end > stack_end)