public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Gonda <pgonda@google.com>
To: x86@kernel.org
Cc: Peter Gonda <pgonda@google.com>, Borislav Petkov <bp@alien8.de>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Joerg Roedel <jroedel@suse.de>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate()
Date: Thu, 17 Mar 2022 14:19:13 -0700	[thread overview]
Message-ID: <20220317211913.1397427-1-pgonda@google.com> (raw)

Replace the hlt loop in handle_vc_boot_ghcb() with an
sev_es_terminate(). The hlt gives the system no indication the guest is
unhappy. The termination request will signal there was an error during
VC handling during boot.


Cc: Borislav Petkov <bp@alien8.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: x86@kernel.org
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Peter Gonda <pgonda@google.com>
---
 arch/x86/kernel/sev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c
index e6d316a01fdd..ae87fbf27724 100644
--- a/arch/x86/kernel/sev.c
+++ b/arch/x86/kernel/sev.c
@@ -1425,6 +1425,5 @@ bool __init handle_vc_boot_ghcb(struct pt_regs *regs)
 fail:
 	show_regs(regs);
 
-	while (true)
-		halt();
+	sev_es_terminate(GHCB_SEV_ES_GEN_REQ);
 }
-- 
2.35.1.894.gb6a874cedc-goog


             reply	other threads:[~2022-03-17 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 21:19 Peter Gonda [this message]
2022-03-18  8:51 ` [PATCH] x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate() Joerg Roedel
2022-04-05 19:27 ` [tip: x86/sev] " tip-bot2 for Peter Gonda
2022-04-08  9:08 ` tip-bot2 for Peter Gonda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220317211913.1397427-1-pgonda@google.com \
    --to=pgonda@google.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=jroedel@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox