mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: x86@kernel.org, linux-kernel@vger.kernel.org
Cc: Uros Bizjak <ubizjak@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: [PATCH -tip v2 1/3] x86/percpu: Define PER_CPU_VAR macro also for !__ASSEMBLY__
Date: Sun,  5 Nov 2023 22:34:35 +0100	[thread overview]
Message-ID: <20231105213731.1878100-2-ubizjak@gmail.com> (raw)
In-Reply-To: <20231105213731.1878100-1-ubizjak@gmail.com>

Some C source files define 'asm' statements that use PER_CPU_VAR,
so make PER_CPU_VAR macro available also without __ASSEMBLY__.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
v2: Make PER_CPU_VAR macro available in 'asm' statements
    instead of moving 'asm' statements to *.S assembly files.
---
 arch/x86/include/asm/percpu.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index b86b27d15e52..0f12b2004b94 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -84,10 +84,15 @@
 })
 #endif /* CONFIG_USE_X86_SEG_SUPPORT */
 
+#define PER_CPU_VAR(var)	%__percpu_seg:(var)__percpu_rel
+
 #else /* CONFIG_SMP */
 #define __percpu_seg_override
 #define __percpu_prefix		""
 #define __force_percpu_prefix	""
+
+#define PER_CPU_VAR(var)	(var)__percpu_rel
+
 #endif /* CONFIG_SMP */
 
 #define __my_cpu_type(var)	typeof(var) __percpu_seg_override
-- 
2.41.0


  reply	other threads:[~2023-11-05 21:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-05 21:34 [PATCH -tip v2 0/3] x86/callthunks: Fix and unify call thunk assembly snippets Uros Bizjak
2023-11-05 21:34 ` Uros Bizjak [this message]
2023-11-30 21:16   ` [tip: x86/percpu] x86/percpu: Define PER_CPU_VAR macro also for !__ASSEMBLY__ tip-bot2 for Uros Bizjak
2023-11-05 21:34 ` [PATCH -tip v2 2/3] x86/callthunks: Handle %rip-relative relocations in call thunk template Uros Bizjak
2023-11-30 21:16   ` [tip: x86/percpu] x86/callthunks: Mark apply_relocation() as __init_or_module tip-bot2 for Ingo Molnar
2023-12-07 11:15     ` Borislav Petkov
2023-11-30 21:16   ` [tip: x86/percpu] x86/callthunks: Handle %rip-relative relocations in call thunk template tip-bot2 for Uros Bizjak
2023-12-01  3:54   ` [PATCH -tip v2 2/3] " Nathan Chancellor
2023-12-01  7:48     ` Uros Bizjak
2023-11-05 21:34 ` [PATCH -tip v2 3/3] x86/callthunks: Fix and unify call thunks assembly snippets Uros Bizjak
2023-11-30 21:16   ` [tip: x86/percpu] " tip-bot2 for Uros Bizjak

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=20231105213731.1878100-2-ubizjak@gmail.com \
    --to=ubizjak@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome