Skip to content

Commit 18c3933

Browse files
codomaniasuryasaimadhu
authored andcommitted
x86/sev: Shorten GHCB terminate macro names
Shorten macro names for improved readability. Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Brijesh Singh <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Venu Busireddy <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent fa55b7d commit 18c3933

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

arch/x86/boot/compressed/sev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static enum es_result vc_read_mem(struct es_em_ctxt *ctxt,
122122
static bool early_setup_sev_es(void)
123123
{
124124
if (!sev_es_negotiate_protocol())
125-
sev_es_terminate(GHCB_SEV_ES_REASON_PROTOCOL_UNSUPPORTED);
125+
sev_es_terminate(GHCB_SEV_ES_PROT_UNSUPPORTED);
126126

127127
if (set_page_decrypted((unsigned long)&boot_ghcb_page))
128128
return false;
@@ -175,7 +175,7 @@ void do_boot_stage2_vc(struct pt_regs *regs, unsigned long exit_code)
175175
enum es_result result;
176176

177177
if (!boot_ghcb && !early_setup_sev_es())
178-
sev_es_terminate(GHCB_SEV_ES_REASON_GENERAL_REQUEST);
178+
sev_es_terminate(GHCB_SEV_ES_GEN_REQ);
179179

180180
vc_ghcb_invalidate(boot_ghcb);
181181
result = vc_init_em_ctxt(&ctxt, regs, exit_code);
@@ -202,5 +202,5 @@ void do_boot_stage2_vc(struct pt_regs *regs, unsigned long exit_code)
202202
if (result == ES_OK)
203203
vc_finish_insn(&ctxt);
204204
else if (result != ES_RETRY)
205-
sev_es_terminate(GHCB_SEV_ES_REASON_GENERAL_REQUEST);
205+
sev_es_terminate(GHCB_SEV_ES_GEN_REQ);
206206
}

arch/x86/include/asm/sev-common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
(((((u64)reason_set) & GHCB_MSR_TERM_REASON_SET_MASK) << GHCB_MSR_TERM_REASON_SET_POS) | \
6969
((((u64)reason_val) & GHCB_MSR_TERM_REASON_MASK) << GHCB_MSR_TERM_REASON_POS))
7070

71-
#define GHCB_SEV_ES_REASON_GENERAL_REQUEST 0
72-
#define GHCB_SEV_ES_REASON_PROTOCOL_UNSUPPORTED 1
71+
#define GHCB_SEV_ES_GEN_REQ 0
72+
#define GHCB_SEV_ES_PROT_UNSUPPORTED 1
7373

7474
#define GHCB_RESP_CODE(v) ((v) & GHCB_MSR_INFO_MASK)
7575

arch/x86/kernel/sev-shared.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ void __init do_vc_no_ghcb(struct pt_regs *regs, unsigned long exit_code)
221221

222222
fail:
223223
/* Terminate the guest */
224-
sev_es_terminate(GHCB_SEV_ES_REASON_GENERAL_REQUEST);
224+
sev_es_terminate(GHCB_SEV_ES_GEN_REQ);
225225
}
226226

227227
static enum es_result vc_insn_string_read(struct es_em_ctxt *ctxt,

arch/x86/kernel/sev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ DEFINE_IDTENTRY_VC_KERNEL(exc_vmm_communication)
14111411
show_regs(regs);
14121412

14131413
/* Ask hypervisor to sev_es_terminate */
1414-
sev_es_terminate(GHCB_SEV_ES_REASON_GENERAL_REQUEST);
1414+
sev_es_terminate(GHCB_SEV_ES_GEN_REQ);
14151415

14161416
/* If that fails and we get here - just panic */
14171417
panic("Returned from Terminate-Request to Hypervisor\n");
@@ -1459,7 +1459,7 @@ bool __init handle_vc_boot_ghcb(struct pt_regs *regs)
14591459

14601460
/* Do initial setup or terminate the guest */
14611461
if (unlikely(boot_ghcb == NULL && !sev_es_setup_ghcb()))
1462-
sev_es_terminate(GHCB_SEV_ES_REASON_GENERAL_REQUEST);
1462+
sev_es_terminate(GHCB_SEV_ES_GEN_REQ);
14631463

14641464
vc_ghcb_invalidate(boot_ghcb);
14651465

0 commit comments

Comments
 (0)