* [PATCH v2] x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()
@ 2024-11-22 20:23 Kevin Loughlin
2024-11-25 2:40 ` kernel test robot
2025-02-27 22:16 ` [tip: x86/sev] " tip-bot2 for Kevin Loughlin
0 siblings, 2 replies; 3+ messages in thread
From: Kevin Loughlin @ 2024-11-22 20:23 UTC (permalink / raw)
To: ardb
Cc: ardb+git, bp, kevinloughlin, kirill.shutemov, sidtelang, pgonda,
thomas.lendacky, x86, stable, linux-kernel
commit 1c811d403afd ("x86/sev: Fix position dependent variable
references in startup code") introduced RIP_REL_REF() to force RIP-
relative accesses to global variables, as needed to prevent crashes
during early SEV/SME startup code. For completeness, RIP_REL_REF()
should be used with additional variables during sme_enable() [0].
Access these vars with RIP_REL_REF() to prevent problem reoccurence.
[0] https://lore.kernel.org/all/CAMj1kXHnA0fJu6zh634=fbJswp59kSRAbhW+ubDGj1+NYwZJ-Q@mail.gmail.com/
Fixes: 1c811d403afd ("x86/sev: Fix position dependent variable references in startup code")
Signed-off-by: Kevin Loughlin <kevinloughlin@google.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
---
v1 -> v2: Fix typo in commit message, add Ard's and Tom's "Reviewed-by"
arch/x86/mm/mem_encrypt_identity.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c
index e6c7686f443a..9fce5b87b8c5 100644
--- a/arch/x86/mm/mem_encrypt_identity.c
+++ b/arch/x86/mm/mem_encrypt_identity.c
@@ -565,7 +565,7 @@ void __head sme_enable(struct boot_params *bp)
}
RIP_REL_REF(sme_me_mask) = me_mask;
- physical_mask &= ~me_mask;
- cc_vendor = CC_VENDOR_AMD;
+ RIP_REL_REF(physical_mask) &= ~me_mask;
+ RIP_REL_REF(cc_vendor) = CC_VENDOR_AMD;
cc_set_mask(me_mask);
}
--
2.47.0.371.ga323438b13-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()
2024-11-22 20:23 [PATCH v2] x86/sev: Add missing RIP_REL_REF() invocations during sme_enable() Kevin Loughlin
@ 2024-11-25 2:40 ` kernel test robot
2025-02-27 22:16 ` [tip: x86/sev] " tip-bot2 for Kevin Loughlin
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2024-11-25 2:40 UTC (permalink / raw)
To: Kevin Loughlin; +Cc: stable, oe-kbuild-all
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: stable@vger.kernel.org" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v2] x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()
Link: https://lore.kernel.org/stable/20241122202322.977678-1-kevinloughlin%40google.com
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: x86/sev] x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()
2024-11-22 20:23 [PATCH v2] x86/sev: Add missing RIP_REL_REF() invocations during sme_enable() Kevin Loughlin
2024-11-25 2:40 ` kernel test robot
@ 2025-02-27 22:16 ` tip-bot2 for Kevin Loughlin
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Kevin Loughlin @ 2025-02-27 22:16 UTC (permalink / raw)
To: linux-tip-commits
Cc: Kevin Loughlin, Ingo Molnar, Ard Biesheuvel, Tom Lendacky,
Dave Hansen, x86, linux-kernel
The following commit has been merged into the x86/sev branch of tip:
Commit-ID: 72dafb567760320f2de7447cd6e979bf9d4e5d17
Gitweb: https://git.kernel.org/tip/72dafb567760320f2de7447cd6e979bf9d4e5d17
Author: Kevin Loughlin <kevinloughlin@google.com>
AuthorDate: Fri, 22 Nov 2024 20:23:22
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Thu, 27 Feb 2025 23:01:33 +01:00
x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()
The following commit:
1c811d403afd ("x86/sev: Fix position dependent variable references in startup code")
introduced RIP_REL_REF() to force RIP-relative accesses to global variables,
as needed to prevent crashes during early SEV/SME startup code.
For completeness, RIP_REL_REF() should be used with additional variables during
sme_enable():
https://lore.kernel.org/all/CAMj1kXHnA0fJu6zh634=fbJswp59kSRAbhW+ubDGj1+NYwZJ-Q@mail.gmail.com/
Access these vars with RIP_REL_REF() to prevent problem reoccurence.
Fixes: 1c811d403afd ("x86/sev: Fix position dependent variable references in startup code")
Signed-off-by: Kevin Loughlin <kevinloughlin@google.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/r/20241122202322.977678-1-kevinloughlin@google.com
---
arch/x86/mm/mem_encrypt_identity.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c
index e6c7686..9fce5b8 100644
--- a/arch/x86/mm/mem_encrypt_identity.c
+++ b/arch/x86/mm/mem_encrypt_identity.c
@@ -565,7 +565,7 @@ void __head sme_enable(struct boot_params *bp)
}
RIP_REL_REF(sme_me_mask) = me_mask;
- physical_mask &= ~me_mask;
- cc_vendor = CC_VENDOR_AMD;
+ RIP_REL_REF(physical_mask) &= ~me_mask;
+ RIP_REL_REF(cc_vendor) = CC_VENDOR_AMD;
cc_set_mask(me_mask);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-27 22:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-22 20:23 [PATCH v2] x86/sev: Add missing RIP_REL_REF() invocations during sme_enable() Kevin Loughlin
2024-11-25 2:40 ` kernel test robot
2025-02-27 22:16 ` [tip: x86/sev] " tip-bot2 for Kevin Loughlin
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.