x86/sev: Define the Linux-specific guest termination reasons
authorBrijesh Singh <brijesh.singh@amd.com>
Wed, 9 Feb 2022 18:10:04 +0000 (12:10 -0600)
committerBorislav Petkov <bp@suse.de>
Wed, 6 Apr 2022 11:02:41 +0000 (13:02 +0200)
commit6c0f74d678c94060932683738b3e227995b363d3
treedf594cefbfe1428235f461516e9ffbcbe0452a37
parentf742b90e61bb53b27771f64bdae05db03a6ab1f2
x86/sev: Define the Linux-specific guest termination reasons

The GHCB specification defines the reason code for reason set 0. The
reason codes defined in the set 0 do not cover all possible causes for a
guest to request termination.

The reason sets 1 to 255 are reserved for the vendor-specific codes.
Reserve the reason set 1 for the Linux guest. Define the error codes for
reason set 1 so that one can have meaningful termination reasons and thus
better guest failure diagnosis.

While at it, change sev_es_terminate() to accept a reason set parameter.

  [ bp: Massage commit message. ]

Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Venu Busireddy <venu.busireddy@oracle.com>
Link: https://lore.kernel.org/r/20220307213356.2797205-11-brijesh.singh@amd.com
arch/x86/boot/compressed/sev.c
arch/x86/include/asm/sev-common.h
arch/x86/kernel/sev-shared.c
arch/x86/kernel/sev.c