All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xin Li <xin3.li@intel.com>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	luto@kernel.org, ravi.v.shankar@intel.com,
	andrew.cooper3@citrix.com
Subject: [PATCH v1A 1/2] x86/fred: Fix build with clang
Date: Sun, 28 Jan 2024 22:45:21 -0800	[thread overview]
Message-ID: <20240129064521.5168-1-xin3.li@intel.com> (raw)
In-Reply-To: <882e400f-913b-4ed5-9611-ef87cd8b58b2@zytor.com>

Remove the .fill statement that referneces asm_fred_entrypoint_kernel()
before it's defined, which breaks clang build.

Use the .org directive instead to fill "int3" into the memory between
asm_fred_entrypoint_user() and asm_fred_entrypoint_kernel().

Fixes: 5e0636a41485 ("x86/fred: FRED entry/exit and dispatch code")
Reported-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/lkml/20240126100050.GAZbOC0g3Rlr6otZcT@fat_crate.local/
Signed-off-by: Xin Li <xin3.li@intel.com>
---

Change since v1:
* Use ".org ..., 0xcc" to fill "int3" into memory (H. Peter Anvin).
---
 arch/x86/entry/entry_64_fred.S | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S
index eedf98de7538..a02bc6f3d2e6 100644
--- a/arch/x86/entry/entry_64_fred.S
+++ b/arch/x86/entry/entry_64_fred.S
@@ -43,14 +43,12 @@ SYM_INNER_LABEL(asm_fred_exit_user, SYM_L_GLOBAL)
 	_ASM_EXTABLE_TYPE(1b, asm_fred_entrypoint_user, EX_TYPE_ERETU)
 SYM_CODE_END(asm_fred_entrypoint_user)
 
-.fill asm_fred_entrypoint_kernel - ., 1, 0xcc
-
 /*
  * The new RIP value that FRED event delivery establishes is
  * (IA32_FRED_CONFIG & ~FFFH) + 256 for events that occur in
  * ring 0, i.e., asm_fred_entrypoint_user + 256.
  */
-	.org asm_fred_entrypoint_user + 256
+	.org asm_fred_entrypoint_user + 256, 0xcc
 SYM_CODE_START_NOALIGN(asm_fred_entrypoint_kernel)
 	FRED_ENTER
 	call	fred_entry_from_kernel
-- 
2.43.0


  parent reply	other threads:[~2024-01-29  7:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-27  9:37 [PATCH 0/2] x86/fred: Fix two build issues Xin Li
2024-01-27  9:37 ` [PATCH 1/2] x86/fred: Fix build with clang Xin Li
2024-01-27 18:14   ` H. Peter Anvin
2024-01-27 19:46     ` Li, Xin3
2024-01-28 19:33       ` H. Peter Anvin
2024-01-28 20:27         ` Li, Xin3
2024-01-29  6:45         ` Xin Li [this message]
2024-01-30 10:34           ` [PATCH v1A " Borislav Petkov
2024-01-27  9:37 ` [PATCH 2/2] x86/fred: Fix build with CONFIG_IA32_EMULATION=n Xin Li
2024-01-30 12:48   ` Borislav Petkov
2024-01-30 15:22     ` Li, Xin3
2024-01-30 15:31       ` Borislav Petkov
2024-01-30 16:30         ` Li, Xin3
2024-01-30 16:34           ` Borislav Petkov
2024-01-30 17:17       ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240129064521.5168-1-xin3.li@intel.com \
    --to=xin3.li@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=ravi.v.shankar@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.