Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1698613pxp; Thu, 17 Mar 2022 14:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy50Rhgmib1p7579V8w4gLw1KSh3o/ZIPnBs4JS7EwPAs9W6GdoVzigDviOVGNRl8Ssrzf X-Received: by 2002:a17:902:8492:b0:14d:5ddc:9df6 with SMTP id c18-20020a170902849200b0014d5ddc9df6mr6910815plo.15.1647553921767; Thu, 17 Mar 2022 14:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647553921; cv=none; d=google.com; s=arc-20160816; b=0KM/vtk+HA0q8JXdfyhXeQJo0zk6BM64r9Q1Rptmx7swzM0NbqgC17gt/2uj4hvVg+ aZbhXZr++IxX0Y71DW9uhwpM+JGQrFOtXVZ+dm5thwVTSXYoUj4JRRaDGtO7UchzpUkE qlmWAIIA6xzrZaE7oeVxjfJtFEqROBXITcomO9w5q+DH+z/DfTQpNd0EEhYFU8NKh7EY NXiaBDxukkCGDV3WeQwiKfA2kjq4YiwAwJWz0mfT91Gz1JHG/TOBB/KBNA17TzAKo4DZ atrKyhmiur7aTgAgpW1pZ5+EE3i+J1P+r7bZcCMRuTUmnU8YfzCrbRTAv0owvLBiCHHd 3AFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=6mHysSGkjSaV0ili798Q1zLL9ynUJ9JmihmTcdCLIZY=; b=uniM5lpTOEWGM6rvu4Qx+qOD4cjprLqUwraceiCso3D6Zi8Pr+iwhcGOJNFXh+u49v xBycxG50I06ADZbqrgMmJSIEAfFLHjiQdBh6jq83AT2ZONzYOsjw/3qJVwWhISS33xop bo2jxAQLowklXXDhVOORyC5rWnfTXoCPBFS4xI2ym48a5Djh8tjkF5Ito8Wf4eDbiaE3 V6BTY+uH1JFWKWwMzwfKmEbYqN0RowyyqChCndk9b3+/tAAzgqCLiUQ/6V1buikxb1al vVoMWUy+4t+bKnh281etRYOxK9VACiWUB7HRNjBhUafO2Ht5AK7YIWqXqlOcp/Mvmbi+ LF1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kgTRMhvO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v19-20020a1709028d9300b00153b2d164f6si267565plo.254.2022.03.17.14.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 14:52:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kgTRMhvO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 005B8E4385; Thu, 17 Mar 2022 14:19:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbiCQVUi (ORCPT + 99 others); Thu, 17 Mar 2022 17:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbiCQVUe (ORCPT ); Thu, 17 Mar 2022 17:20:34 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EADBEB2455 for ; Thu, 17 Mar 2022 14:19:16 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id b18-20020a63d812000000b0037e1aa59c0bso2312030pgh.12 for ; Thu, 17 Mar 2022 14:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=6mHysSGkjSaV0ili798Q1zLL9ynUJ9JmihmTcdCLIZY=; b=kgTRMhvOjKo0YDi1oWQ8YuJ3ZeMPo74qt+/vjGdCcuqs8dkrP0TRKHe74cxBTHRisY pXpC7Ow+2tv6+LH3Y4J+kRigvMhRBwP34m3TIOywj5vMh3PHyuS2pozWWwFAF+JxmyQI ijSEtzxiCCln73+qzuFQho1qJyA+9K7PlXH2aic3sOO5/pXWtBiwYCpg7UtF2Nc/mZ0y leTXS0J1RZwoak/k4U9aNUICFCK2CU74Zziu/oRs7R4IMrbpMQExf1frRcDqN5tTsem9 7Y9xQ2+RG8tgUfvE4x3Xa2sLU0ccGllxOI/YzO8blwRuY/8ZXvt3XFGf8gf/N8V/mUXi VhHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=6mHysSGkjSaV0ili798Q1zLL9ynUJ9JmihmTcdCLIZY=; b=jYknUa3FcELtmKVMWrBpchRhk3ef5gQPddJ2h23jkwmOZ1QlOY8cKttrrPnHiLDM+t 8MOFIfq3caoz17MV3oFFmXzWNfH2O+J9uj1kALURlD/HmFakwbOpAhFcTaD/j4Qjrfl7 uBMFUT4XLYJGFiS2JaA+fOO8evulV49230ydwKHDh93ALYMgfLDdpZzRypHEulZqTJz0 HHdcJiANO8Ad6CBC1rtNWKDgTXOFI3Dkw7qaMUmpghj5uW6eV8K4PI7sNXslX2Q9qRIQ c9Z9QK+y77bMllGyCER0FoaluvZPEr9vu6s79WfKVTT7+byj4NAnoXvCDscYWkN/IbjI 7MbA== X-Gm-Message-State: AOAM532vxw346IBpTH7AfpRALLRotHNiB4MRMgzYmVtrHaCtPHHsSp4e Zcrg5QEiK7orfn63YjzW7WnEE0mSUHk= X-Received: from pgonda1.kir.corp.google.com ([2620:15c:29:203:ef70:31aa:2364:9dda]) (user=pgonda job=sendgmr) by 2002:a17:902:e74f:b0:151:c20b:5f39 with SMTP id p15-20020a170902e74f00b00151c20b5f39mr6866669plf.43.1647551956388; Thu, 17 Mar 2022 14:19:16 -0700 (PDT) Date: Thu, 17 Mar 2022 14:19:13 -0700 Message-Id: <20220317211913.1397427-1-pgonda@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.894.gb6a874cedc-goog Subject: [PATCH] x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate() From: Peter Gonda To: x86@kernel.org Cc: Peter Gonda , Borislav Petkov , Tom Lendacky , Brijesh Singh , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 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 Cc: Tom Lendacky Cc: Brijesh Singh Cc: Joerg Roedel Cc: x86@kernel.org Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Peter Gonda --- 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