[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220112211258.21115-6-chang.seok.bae@intel.com>
Date: Wed, 12 Jan 2022 13:12:51 -0800
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: linux-crypto@...r.kernel.org, dm-devel@...hat.com,
herbert@...dor.apana.org.au, ebiggers@...nel.org, ardb@...nel.org,
x86@...nel.org, luto@...nel.org, tglx@...utronix.de, bp@...e.de,
dave.hansen@...ux.intel.com, mingo@...nel.org
Cc: linux-kernel@...r.kernel.org, dan.j.williams@...el.com,
charishma1.gairuboyina@...el.com, kumar.n.dwarakanath@...el.com,
ravi.v.shankar@...el.com, chang.seok.bae@...el.com
Subject: [PATCH v5 05/12] x86/msr-index: Add MSRs for Key Locker internal wrapping key
The CPU state that contains the internal wrapping key is in the same power
domain as the cache. So any sleep state that would invalidate the cache
(like S3) also invalidates the state of the wrapping key.
But, since the state is inaccessible to software, it needs a special
mechanism to save and restore the key during deep sleep.
A set of new MSRs are provided as an abstract interface to save and restore
the wrapping key, and to check the key status.
The wrapping key is saved in a platform-scoped state of non-volatile media.
The backup itself and its path from the CPU are encrypted and integrity
protected.
But this storage's non-volatility is not architecturally guaranteed across
off states, such as S5 and G3.
The MSRs will be used to back up the key for S3/4 sleep states. Then the
kernel code writes one of them to restore the key in each CPU state.
Signed-off-by: Chang S. Bae <chang.seok.bae@...el.com>
Reviewed-by: Dan Williams <dan.j.williams@...el.com>
Cc: x86@...nel.org
Cc: linux-kernel@...r.kernel.org
---
Changes from RFC v2:
* Update the changelog. (Dan Williams)
* Rename the MSRs. (Dan Williams)
---
arch/x86/include/asm/msr-index.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 01e2650b9585..7f11a3b3a75b 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -941,4 +941,10 @@
#define MSR_VM_IGNNE 0xc0010115
#define MSR_VM_HSAVE_PA 0xc0010117
+/* MSRs for managing an internal wrapping key for Key Locker. */
+#define MSR_IA32_IWKEY_COPY_STATUS 0x00000990
+#define MSR_IA32_IWKEY_BACKUP_STATUS 0x00000991
+#define MSR_IA32_BACKUP_IWKEY_TO_PLATFORM 0x00000d91
+#define MSR_IA32_COPY_IWKEY_TO_LOCAL 0x00000d92
+
#endif /* _ASM_X86_MSR_INDEX_H */
--
2.17.1
Powered by blists - more mailing lists