forked from gregkh/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/…
…linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: "The three SEV commits are not really urgent material. But we figured since getting them in now will avoid a huge amount of conflicts between future SEV changes touching tip, the kvm and probably other trees, sending them to you now would be best. The idea is that the tip, kvm etc branches for 5.14 will all base ontop of -rc2 and thus everything will be peachy. What is more, those changes are purely mechanical and defines movement so they should be fine to go now (famous last words). Summary: - Enable -Wundef for the compressed kernel build stage - Reorganize SEV code to streamline and simplify future development" * tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot/compressed: Enable -Wundef x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG x86/sev: Move GHCB MSR protocol and NAE definitions in a common header x86/sev-es: Rename sev-es.{ch} to sev.{ch}
- Loading branch information
Showing
29 changed files
with
124 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* | ||
* AMD SEV header common between the guest and the hypervisor. | ||
* | ||
* Author: Brijesh Singh <[email protected]> | ||
*/ | ||
|
||
#ifndef __ASM_X86_SEV_COMMON_H | ||
#define __ASM_X86_SEV_COMMON_H | ||
|
||
#define GHCB_MSR_INFO_POS 0 | ||
#define GHCB_MSR_INFO_MASK (BIT_ULL(12) - 1) | ||
|
||
#define GHCB_MSR_SEV_INFO_RESP 0x001 | ||
#define GHCB_MSR_SEV_INFO_REQ 0x002 | ||
#define GHCB_MSR_VER_MAX_POS 48 | ||
#define GHCB_MSR_VER_MAX_MASK 0xffff | ||
#define GHCB_MSR_VER_MIN_POS 32 | ||
#define GHCB_MSR_VER_MIN_MASK 0xffff | ||
#define GHCB_MSR_CBIT_POS 24 | ||
#define GHCB_MSR_CBIT_MASK 0xff | ||
#define GHCB_MSR_SEV_INFO(_max, _min, _cbit) \ | ||
((((_max) & GHCB_MSR_VER_MAX_MASK) << GHCB_MSR_VER_MAX_POS) | \ | ||
(((_min) & GHCB_MSR_VER_MIN_MASK) << GHCB_MSR_VER_MIN_POS) | \ | ||
(((_cbit) & GHCB_MSR_CBIT_MASK) << GHCB_MSR_CBIT_POS) | \ | ||
GHCB_MSR_SEV_INFO_RESP) | ||
#define GHCB_MSR_INFO(v) ((v) & 0xfffUL) | ||
#define GHCB_MSR_PROTO_MAX(v) (((v) >> GHCB_MSR_VER_MAX_POS) & GHCB_MSR_VER_MAX_MASK) | ||
#define GHCB_MSR_PROTO_MIN(v) (((v) >> GHCB_MSR_VER_MIN_POS) & GHCB_MSR_VER_MIN_MASK) | ||
|
||
#define GHCB_MSR_CPUID_REQ 0x004 | ||
#define GHCB_MSR_CPUID_RESP 0x005 | ||
#define GHCB_MSR_CPUID_FUNC_POS 32 | ||
#define GHCB_MSR_CPUID_FUNC_MASK 0xffffffff | ||
#define GHCB_MSR_CPUID_VALUE_POS 32 | ||
#define GHCB_MSR_CPUID_VALUE_MASK 0xffffffff | ||
#define GHCB_MSR_CPUID_REG_POS 30 | ||
#define GHCB_MSR_CPUID_REG_MASK 0x3 | ||
#define GHCB_CPUID_REQ_EAX 0 | ||
#define GHCB_CPUID_REQ_EBX 1 | ||
#define GHCB_CPUID_REQ_ECX 2 | ||
#define GHCB_CPUID_REQ_EDX 3 | ||
#define GHCB_CPUID_REQ(fn, reg) \ | ||
(GHCB_MSR_CPUID_REQ | \ | ||
(((unsigned long)reg & GHCB_MSR_CPUID_REG_MASK) << GHCB_MSR_CPUID_REG_POS) | \ | ||
(((unsigned long)fn) << GHCB_MSR_CPUID_FUNC_POS)) | ||
|
||
#define GHCB_MSR_TERM_REQ 0x100 | ||
#define GHCB_MSR_TERM_REASON_SET_POS 12 | ||
#define GHCB_MSR_TERM_REASON_SET_MASK 0xf | ||
#define GHCB_MSR_TERM_REASON_POS 16 | ||
#define GHCB_MSR_TERM_REASON_MASK 0xff | ||
#define GHCB_SEV_TERM_REASON(reason_set, reason_val) \ | ||
(((((u64)reason_set) & GHCB_MSR_TERM_REASON_SET_MASK) << GHCB_MSR_TERM_REASON_SET_POS) | \ | ||
((((u64)reason_val) & GHCB_MSR_TERM_REASON_MASK) << GHCB_MSR_TERM_REASON_POS)) | ||
|
||
#define GHCB_SEV_ES_REASON_GENERAL_REQUEST 0 | ||
#define GHCB_SEV_ES_REASON_PROTOCOL_UNSUPPORTED 1 | ||
|
||
#define GHCB_RESP_CODE(v) ((v) & GHCB_MSR_INFO_MASK) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.