From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ED8020B7F2 for ; Tue, 12 Nov 2024 20:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731442419; cv=none; b=jjT3DrXUoRWwrxw7Sz38TREhIq0g+lkmr+1gaStv+QFvoDfx0iUru+sR+P6HbQLnDpxK52/fBoGTuA23gTcaWlCvI31E82gHiNn+hUfyoHemnQ6JEe+wkZthecfaU+BoObgVOm0lQ8li1Wz6TdTR4Oe7LNeWOClKZKTwmu/xLOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731442419; c=relaxed/simple; bh=QY+lZkSp4pEMsOH5ViLZZ71ACCvNupC89gqwzm36rVk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=c5Dp27qErD4Br03WKbpC4/BqJ3YAd1pCV+v0kxeenNFAVnB5s+87UgAsIELq0SimQYXEdsIsUfkXSfklnLvwdENP+QXipCRW7xC8+Eenpgv7HVn+DycvFRSbzBE5waw6N0CYE9btfiwZu9nMO68Qj/Hj3Cg9zwjol/GJTKBmjJI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=OdO18lPB; arc=none smtp.client-ip=209.85.160.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OdO18lPB" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-4608dddaa35so50521cf.0 for ; Tue, 12 Nov 2024 12:13:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1731442415; x=1732047215; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ok3qcHy+me2Jj8oTM9OE18MgpCpWLeklNFe0Xu3psIY=; b=OdO18lPBo5qORwZj/3PVqK06R8y3jZZ8+yIx6rAIojUQdnvwzHf09Fbhw/UUkIk3dV dWXwNP3Xkhi3z4sVkW3KudtMhWrBJz4ZtVra3Zmawx8zNO5lTyzkcYrRDA9hCtrBdthR /SAKmtiA1IETUMkg4nt0LrmB+gYpchqCaVcEWxMrJVnbWVYYSHusxI0Iy3mS2mEGD7/b h+F7Ylwu1aTKwBT0U6bHRvLM0fAuSWN72IgICbhMD4saSHFl3bPpZHeusFLLB/4IsHzv iptWosQ1aiDYT7jBk4oDWYR4eAGUMw2Er0rSqCy2JAg9qI9zcK+g3NTLiBHxoB7HgRoX mfeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731442415; x=1732047215; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ok3qcHy+me2Jj8oTM9OE18MgpCpWLeklNFe0Xu3psIY=; b=SpCrnLwo/quPtRaLZiACAKJqCVixbZx5h2t0netkFLCutBJMy4lHK7dLTDB9jjmhhL r9p7WWBWCxFOEk9oMCO1D76JPElpqAu6pK2+J8nM41DHmkatyYmRnI84ZUEAQlcB/o8B YvjWxg4FoKWD6TR+FY5FCkWwGcUHSmT5w33kYCuZsUQ5f5jAkx3ZVEP/gXE89rr3Ih+/ tH2tferFYd+6vsr7fO6bx8Ma8tDsVYusghoYbEWyFlG/6FYEaw3jrg/2dL42Sko3XEA9 gH3PheY8r8+QCfCc+6zEm0VdfDG6c/+aeSIM+OgS9V8DjXKCwR/Jwm2yveTPbDoXyhFu YDHg== X-Forwarded-Encrypted: i=1; AJvYcCXrjJBgG2p3m5Kyo6L/ahbn1F42Sm5O4QyATsKvLu6KDQAIBfC2/SzNDzaFojX9ifIIim4Oq0y254c=@vger.kernel.org X-Gm-Message-State: AOJu0YztOOk2FmcQkVT5kTamyTOfxQma2YegB3eeTkHGBsEjK2IV3k5W JMWonIPKuxxWGPaz1f6Fea+PgSa+sBuJ0ZxLVF79a4rSW6Mzt1FXgDHp9LeutVG2263M7qFL33c gxHF51xstgS2nc/CSAE8KxXf8Gb42z2YR0okX X-Gm-Gg: ASbGncuPog/MWWG0EKPpTf5ZskuUuEZ6MYuoySa5XRS6IoTw4sTn90igPpL6lgPCyOD eXxY8I2rE09pZzcV59dVDDHblI5h2ChEMwvaL8+FiNQE/45PL1XepiAIi+GGG X-Google-Smtp-Source: AGHT+IHEhri+khloSfLyc9f+kn+S0I//KWGpBCIikR491QgXS5ZsJTa+TGjEAvCX7DRA5b9a6+qU8vYdidxIcZgIBaA= X-Received: by 2002:a05:622a:47c6:b0:461:679f:f1ba with SMTP id d75a77b69052e-4634bca4e56mr371601cf.20.1731442415109; Tue, 12 Nov 2024 12:13:35 -0800 (PST) Precedence: bulk X-Mailing-List: workflows@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20241026051410.2819338-1-xur@google.com> <20241026051410.2819338-4-xur@google.com> <44193ca7-9d31-4b58-99cc-3300a6ad5289@gmail.com> <70772ce5-9dca-418e-9714-80ba4ae28959@gmail.com> In-Reply-To: <70772ce5-9dca-418e-9714-80ba4ae28959@gmail.com> From: Rong Xu Date: Tue, 12 Nov 2024 12:13:22 -0800 Message-ID: Subject: Re: [PATCH v6 3/7] Adjust symbol ordering in text output section To: Klara Modin Cc: Alice Ryhl , Andrew Morton , Arnd Bergmann , Bill Wendling , Borislav Petkov , Breno Leitao , Brian Gerst , Dave Hansen , David Li , Han Shen , Heiko Carstens , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jonathan Corbet , Josh Poimboeuf , Juergen Gross , Justin Stitt , Kees Cook , Masahiro Yamada , "Mike Rapoport (IBM)" , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , "Paul E. McKenney" , Peter Zijlstra , Sami Tolvanen , Thomas Gleixner , Wei Yang , workflows@vger.kernel.org, Miguel Ojeda , Maksim Panchenko , "David S. Miller" , Andreas Larsson , Yonghong Song , Yabin Cui , Krzysztof Pszeniczny , Sriraman Tallam , Stephane Eranian , x86@kernel.org, linux-arch@vger.kernel.org, sparclinux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I sent the following patch for review: https://lkml.org/lkml/2024/11/12/1565 Thanks! -Rong On Mon, Nov 11, 2024 at 11:45=E2=80=AFPM Klara Modin wrote: > > On 2024-11-12 06:38, Rong Xu wrote: > > I compared the System.map files from Klara Modin. The linker script is > > doing what I expected: relocating the unlikely executed functions to th= e > > beginning of the .text section. > > > > However, the problem is with the _stext symbol. It belongs to the > > .text section, so > > it is positioned after the unlikely (or hot) functions. But it really > > needs to be > > the start of the text section. > > > > I checked all vmlinux.lds.S in arch/, I found that most archs > > explicitly assign _stext to the same address as _text, with the > > following 3 exceptions: > > arch/sh/kernel/vmlinux.lds.S > > arch/mips/kernel/vmlinux.lds.S > > arch/sparc/kernel/vmlinux.lds.S > > > > Note that we already partially handled arch/sparc/kernel/vmlinux.lds.S > > for sparc64. > > But we need to handle sparc32 also. > > > > Additionally, the boot/compressed/vmlinux.lds.S also the TEXT_TEXT > > template. However, > > I presume these files do not generate the .text.unlikely. or > > .text.hot.* sections. > > > > I sent the following patch to Klara because I don't have an > > environment to build and test. > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.= lds.S > > index 9ff55cb80a64..5f130af44247 100644 > > --- a/arch/mips/kernel/vmlinux.lds.S > > +++ b/arch/mips/kernel/vmlinux.lds.S > > @@ -61,6 +61,7 @@ SECTIONS > > /* read-only */ > > _text =3D .; /* Text and read-only data */ > > .text : { > > + _stext =3D .; > > TEXT_TEXT > > SCHED_TEXT > > LOCK_TEXT > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > If Klara confirms the fix, I will send the patch for review. > > > > Thanks, > > > > -Rong > > > > This does indeed fix the issue for me. > > Thanks, > Tested-by: Klara Modin