Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp164792pxw; Fri, 8 Apr 2022 04:25:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSyDcPZiNm0fKPPvyVt5we8ZHKTc7+pG6k8I3fZZEhMD4Hb2qH1Z3vwHrB/26Lr4KRBgZ3 X-Received: by 2002:a17:902:f64c:b0:156:7ceb:b579 with SMTP id m12-20020a170902f64c00b001567cebb579mr18122103plg.73.1649417111464; Fri, 08 Apr 2022 04:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649417111; cv=none; d=google.com; s=arc-20160816; b=AtdjRw23dqnV1AyrY2eHQ3ZB0mNPTaLq8l7xxwGBst01jLSELLQw1wTYAOxP4mu/aJ p9i50YQ/bEPhOJPcJ1qbLo0G/+BRsX76pTdcBLsXOOuxKJM/cujLNQw2CXvMVyS3TvMt mLZAB/x3HceQ7j44HSVgczf8rr7ty7SjBZuX3fgBz60ZFJmAn8HTYlXvZmVgLv9U2xnI KxgdpypJJ6QsptZkKcf2fvQy64Vws/UuXGMl4j7sfiCVm2CdOJi8/D4KgViKfxGP/bAA KyPGe6hlvq/dolXQnx/yHkZG1LD9Qt+DaHJJg+A3DYCuTKauYj6bbtOqE0WIRvZvTGKX bSvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=6iT0dUCpKXd93Cim/gg7O05ni3UqWXOaBw9BFAlaO4k=; b=zQ+aIkCFPNGibBWb0XDrW5Uh6Mh2lt9MVv3mgN8CYgyyIlEFXKGRP3KFvK1+dWOVYS fkBpdWahegjot7tGycXcS89vOA5vL6GzxnrKJb4ioTKBKXi3bkEP4o2A5MRzPnDSV7yX bR24/oVQp9kj3NDTWzjyVxSPwWV4c4JxlO9uEt4PkVOO9U/kKsrLjH6eb6tYu84eLqAt 9T+1JqaAzm/+HrFiniPFN3ciWrUsT8ARLqFi8rktgAOXlbvsqNETMHSaExh0SrqCFtI6 w2E8zOn45gVq6iVDFW/A2nDfALU+Jcw1IaYvw8F8sizKrx/BwX2keBhMztihpVabz09m H2Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TQvC8Gey; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 23-20020a631157000000b00397f965a779si1067834pgr.128.2022.04.08.04.24.58; Fri, 08 Apr 2022 04:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TQvC8Gey; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232705AbiDHJKu (ORCPT + 99 others); Fri, 8 Apr 2022 05:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbiDHJKm (ORCPT ); Fri, 8 Apr 2022 05:10:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9331104A77; Fri, 8 Apr 2022 02:08:38 -0700 (PDT) Date: Fri, 08 Apr 2022 09:08:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649408916; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6iT0dUCpKXd93Cim/gg7O05ni3UqWXOaBw9BFAlaO4k=; b=TQvC8Gey5qQmq50Bflp5Hrcy67okTrJ+IjN/pdbOrDPnvXrpL+gJlqlloCel0RR30LvlE9 6bNRMFjDfEOx6CWTuDvCmtcWJS4iHI7qJDbOlVyLliNa1K33nKbhIUMqaZQAem/INcYYdu jFz1Ww3xuqNABK8bIvNO9/Hev7dZ8DVFhWEbVva9RNeZnsKROH/iCi2b+Isq26ub/4UOwp dofGrzxh48cl/ddpjl/t4CKvgEC0UGybg3Pf2F91LKW3aOg/YOfkndzHB6aPCge7ZIRCYn RD53E0pq25uWvaVAwLaFDdXYyUxObNzL5NczMvrkc76piWDWfkkiOGTqwuBdTg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649408916; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6iT0dUCpKXd93Cim/gg7O05ni3UqWXOaBw9BFAlaO4k=; b=Fxx7PfSLqRoiQ3+3HGf7gZBtobylCUU+Iv6bgMjXX16PMLKMe/LHT+QsMRUT4Q8u91TR/6 +nkJur9TZVRhROCA== From: "tip-bot2 for Peter Gonda" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate() Cc: Peter Gonda , Borislav Petkov , Joerg Roedel , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220317211913.1397427-1-pgonda@google.com> References: <20220317211913.1397427-1-pgonda@google.com> MIME-Version: 1.0 Message-ID: <164940891535.389.15036684109710307726.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/sev branch of tip: Commit-ID: e720ea52e85c9d00cf8c5769795d0a3e585524f6 Gitweb: https://git.kernel.org/tip/e720ea52e85c9d00cf8c5769795d0a3e585524f6 Author: Peter Gonda AuthorDate: Thu, 17 Mar 2022 14:19:13 -07:00 Committer: Borislav Petkov CommitterDate: Fri, 08 Apr 2022 10:57:35 +02:00 x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate() Replace the halt 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. [ bp: Update it to pass the reason set too. ] Signed-off-by: Peter Gonda Signed-off-by: Borislav Petkov Reviewed-by: Joerg Roedel Link: https://lore.kernel.org/r/20220317211913.1397427-1-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 ace43e1..f01f455 100644 --- a/arch/x86/kernel/sev.c +++ b/arch/x86/kernel/sev.c @@ -1982,8 +1982,7 @@ bool __init handle_vc_boot_ghcb(struct pt_regs *regs) fail: show_regs(regs); - while (true) - halt(); + sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ); } /*