From nobody Wed Dec 17 09:45:06 2025 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 D6B9FCDB474 for ; Fri, 20 Oct 2023 10:29:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376859AbjJTK3E (ORCPT ); Fri, 20 Oct 2023 06:29:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376843AbjJTK3A (ORCPT ); Fri, 20 Oct 2023 06:29:00 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B0CD53; Fri, 20 Oct 2023 03:28:58 -0700 (PDT) Date: Fri, 20 Oct 2023 10:28:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697797736; 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; bh=ryI+sETQfH56NeQ9taaTVEPrYa8hd8IGX1KE8MVorwE=; b=1WV+HfZpH5662UaeVeD9KsqGvZ13OqZucDjRDqt1/W554Lx16VOTIpPnWYhZeGQhGnzYCy l8hsXEO90NBCmNuLa7fCzCc8RzcX5IIRc7q086BZJQ6Azz4pk4XayMzyj9zJ2eekKGt0Uy LE7frxOixwnBjWRjtrVHbwcyGeFf5RzqnpwfRkSgk7HU2eFMS+Jm/iiniwt2KMvWyYkmPR CGf5InUcTwFyOIhYPsIrBcI3zCzvfJ4wZAKV1gbBeZ3hit46lon6krRruKMzFAc8RIxmka mwn1/nCzeZVb1arqdNiBH6MF45WGQaEoQUbIF9Kr6Cj0dzbyNRXMQ4tMt8RDsQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697797736; 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; bh=ryI+sETQfH56NeQ9taaTVEPrYa8hd8IGX1KE8MVorwE=; b=L1nmvbQ2ryEmmdgEKbWvTPcH/BYqJR9vexF4CQZVVi6KwClTLPCg2Pa0+NZhqVDZ3ecoJQ uvf5qNkHzkjv4LDw== 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/percpu] x86/percpu: Correct PER_CPU_VAR() usage to include symbol and its addend Cc: Uros Bizjak , Ingo Molnar , linux-kernel@vger.kernel.org, Brian Gerst , "H. Peter Anvin" , Linus Torvalds , Sean Christopherson , x86@kernel.org MIME-Version: 1.0 Message-ID: <169779773584.3135.2298093434527491915.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/percpu branch of tip: Commit-ID: 39d64ee59ceee0fb61243eab3c4b7b4492f80df2 Gitweb: https://git.kernel.org/tip/39d64ee59ceee0fb61243eab3c4b7b449= 2f80df2 Author: Uros Bizjak AuthorDate: Tue, 17 Oct 2023 18:27:32 +02:00 Committer: Ingo Molnar CommitterDate: Fri, 20 Oct 2023 12:19:51 +02:00 x86/percpu: Correct PER_CPU_VAR() usage to include symbol and its addend The PER_CPU_VAR() macro should be applied to a symbol and its addend. Inconsistent usage is currently harmless, but needs to be corrected before %rip-relative addressing is introduced to the PER_CPU_VAR() macro. No functional changes intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org Cc: Brian Gerst Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Sean Christopherson --- arch/x86/entry/calling.h | 2 +- arch/x86/entry/entry_32.S | 2 +- arch/x86/entry/entry_64.S | 2 +- arch/x86/kernel/head_64.S | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h index f690762..47368ab 100644 --- a/arch/x86/entry/calling.h +++ b/arch/x86/entry/calling.h @@ -173,7 +173,7 @@ For 32-bit we have the following conventions - kernel i= s built with .endm =20 #define THIS_CPU_user_pcid_flush_mask \ - PER_CPU_VAR(cpu_tlbstate) + TLB_STATE_user_pcid_flush_mask + PER_CPU_VAR(cpu_tlbstate + TLB_STATE_user_pcid_flush_mask) =20 .macro SWITCH_TO_USER_CR3_NOSTACK scratch_reg:req scratch_reg2:req ALTERNATIVE "jmp .Lend_\@", "", X86_FEATURE_PTI diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index 6e6af42..d4e094b 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -305,7 +305,7 @@ .macro CHECK_AND_APPLY_ESPFIX #ifdef CONFIG_X86_ESPFIX32 #define GDT_ESPFIX_OFFSET (GDT_ENTRY_ESPFIX_SS * 8) -#define GDT_ESPFIX_SS PER_CPU_VAR(gdt_page) + GDT_ESPFIX_OFFSET +#define GDT_ESPFIX_SS PER_CPU_VAR(gdt_page + GDT_ESPFIX_OFFSET) =20 ALTERNATIVE "jmp .Lend_\@", "", X86_BUG_ESPFIX =20 diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index b940e92..6d23665 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -252,7 +252,7 @@ SYM_FUNC_START(__switch_to_asm) =20 #ifdef CONFIG_STACKPROTECTOR movq TASK_stack_canary(%rsi), %rbx - movq %rbx, PER_CPU_VAR(fixed_percpu_data) + FIXED_stack_canary + movq %rbx, PER_CPU_VAR(fixed_percpu_data + FIXED_stack_canary) #endif =20 /* diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index ea69959..bfe5ec2 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -449,7 +449,7 @@ SYM_CODE_START(soft_restart_cpu) UNWIND_HINT_END_OF_STACK =20 /* Find the idle task stack */ - movq PER_CPU_VAR(pcpu_hot) + X86_current_task, %rcx + movq PER_CPU_VAR(pcpu_hot + X86_current_task), %rcx movq TASK_threadsp(%rcx), %rsp =20 jmp .Ljump_to_C_code