Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1615447pxb; Mon, 11 Oct 2021 09:32:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygVelLS3TQYGICCH7x4XTcLEnpGHSbuhENXNCZ9Tq3wOkO3HOQRGDjmRC9+mOTlYUxRUfB X-Received: by 2002:a17:90a:d801:: with SMTP id a1mr22116364pjv.109.1633969937661; Mon, 11 Oct 2021 09:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633969937; cv=none; d=google.com; s=arc-20160816; b=0LOO3lVEXhYQ+APrEZXiuzvTPCHmMFjjV4xrgGHBEcErg7BLtP4n/yWPu7ivawKs51 s4R1dpJIZ8XxqXPJfJkUtyniicmfPj7qY96M9ewsUtT+axSfMPh7weUQzQqfBdFI8f3y HlPgcSAq8csvfhautgW1dop+0q42rrrQbVHNw+xzu6+Hcwq6AF3SNVp6xDyE92BOrp/l yPvauHWAVaiuJw3cNNJKUZrcKtFzrSHeR9+wucrIRmfcMtlBgrVxpFYBX8m4k7iWgf5C 2K1cm5ZNyiVgd8ehO365AGqyqmRCOJUIcIocmoOm3SZNXMYlk+bjLYOp8VNgEkQczHP3 tYZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SRQWGiylCZ8PcZU5I6E3Sf2MlEEl9MFytEBTEUPj/bk=; b=NpvWZasF+2GXzKhbJL0z7QSHcGpHGQnvd2gnkNwUsAFe+lQmgOqJJQstvc4d61JlOq /uUH56tUi2BGq81Qz6fGX3u/75jtbnZnoXM9Jkyz8phI+WMqoYVBv9vhAR4E5AOnDlIw QXpBX4v2UYAqiQ7PK8ESgbOpbgo8fekY0q2HkDhZOkV6vSkYBy9mhCatWEyrMbxv9ArA 1o3Frlgsoc7SxVvTSfvRJhjecgvcs137DXDt8FEdRAXojWeH7PxeUvu3ChqPtAsTUC6h VaQlCoWh8wo8sIgdtAL19tnhOfXii1DziyPM5HED0I8bJznCjK1ojDeeQTgKE8Ey+tmA z7JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VV9HHPpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si12621842pgv.352.2021.10.11.09.32.05; Mon, 11 Oct 2021 09:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VV9HHPpP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238282AbhJKOAe (ORCPT + 99 others); Mon, 11 Oct 2021 10:00:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:50336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238339AbhJKN6e (ORCPT ); Mon, 11 Oct 2021 09:58:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C64E261177; Mon, 11 Oct 2021 13:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960504; bh=IGSPMQ94m6QRJaETwIl1g4OGInw2B27TU2vgGoZMGCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VV9HHPpPYjkCoESAjFcbyw9H2j6gfHDft4fJ6NfgHCjkninEkwTT7ZU7MP7nISwRE GI4MilGX+OCZMG8ZY78GafQCIFwS1dux6Q5/46EytLptHzxNxJUsAw14tHZBghgH+1 zfgNXIFXceh8V6cG0h35BUY63qGqkSga7VjnkuHo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Lendacky , Borislav Petkov Subject: [PATCH 5.10 79/83] x86/sev: Return an error on a returned non-zero SW_EXITINFO1[31:0] Date: Mon, 11 Oct 2021 15:46:39 +0200 Message-Id: <20211011134511.100106783@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134508.362906295@linuxfoundation.org> References: <20211011134508.362906295@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Lendacky commit 06f2ac3d4219bbbfd93d79e01966a42053084f11 upstream. After returning from a VMGEXIT NAE event, SW_EXITINFO1[31:0] is checked for a value of 1, which indicates an error and that SW_EXITINFO2 contains exception information. However, future versions of the GHCB specification may define new values for SW_EXITINFO1[31:0], so really any non-zero value should be treated as an error. Fixes: 597cfe48212a ("x86/boot/compressed/64: Setup a GHCB-based VC Exception handler") Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov Cc: # 5.10+ Link: https://lkml.kernel.org/r/efc772af831e9e7f517f0439b13b41f56bad8784.1633063321.git.thomas.lendacky@amd.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/sev-es-shared.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/x86/kernel/sev-es-shared.c +++ b/arch/x86/kernel/sev-es-shared.c @@ -130,6 +130,8 @@ static enum es_result sev_es_ghcb_hv_cal } else { ret = ES_VMM_ERROR; } + } else if (ghcb->save.sw_exit_info_1 & 0xffffffff) { + ret = ES_VMM_ERROR; } else { ret = ES_OK; }