From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16EADC4363D for ; Fri, 25 Sep 2020 15:25:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD9532311D for ; Fri, 25 Sep 2020 15:25:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Zm/kmWYE"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="G/1Fve2M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729342AbgIYPZC (ORCPT ); Fri, 25 Sep 2020 11:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728678AbgIYPZC (ORCPT ); Fri, 25 Sep 2020 11:25:02 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43697C0613CE; Fri, 25 Sep 2020 08:25:02 -0700 (PDT) Date: Fri, 25 Sep 2020 15:24:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1601047500; 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=BaWy/UjQC4Yp6A/J5tS7lyY6rywwt+tqXKggckqF9yc=; b=Zm/kmWYErwl9tCqQL7dj7GvQzIFVDwFGOwbOooxngPtXdD7h6ajdgeasVKLml26quVr3Pu 7TQ44+NFPxyARhCw04ooeoOIHq68Yg4Pq+pm6h5+O/jLon3mVzfwzJm00CxFpq2JSQwt74 1pd6qo0QgTD8wSBX248+qSWDU81hDcYmJzLxdZrnZoXFq/C84yBY6DqYefmPC2Ld0XzGoG dIM5x7x/RpJZ81TGolfjVZKCjp0NfP0JEUuLfZXBStWyem2TrUsS23/zzOVN+aVUPfpxoo sUj2C/PZqhAGfyW7tzz3mnS6BPdybX52ZwMPcjlvvNzXvZa9p9RakN9c2p5wLQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1601047500; 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=BaWy/UjQC4Yp6A/J5tS7lyY6rywwt+tqXKggckqF9yc=; b=G/1Fve2MGzcjXLVjrb53FN8ZkhsDLDnjOlRpT/RpTl0otyAcMCUth11TOxpOXnETk5OKFD kEzRlimd9EzE/4Dg== From: "tip-bot2 for Tom Lendacky" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/seves] x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer Cc: Tom Lendacky , Borislav Petkov , Joerg Roedel , x86 , LKML In-Reply-To: =?utf-8?q?=3Cba84deabdf44a7a880454fb351d189c6ad79d4ba=2E16010?= =?utf-8?q?41106=2Egit=2Ethomas=2Elendacky=40amd=2Ecom=3E?= References: =?utf-8?q?=3Cba84deabdf44a7a880454fb351d189c6ad79d4ba=2E160104?= =?utf-8?q?1106=2Egit=2Ethomas=2Elendacky=40amd=2Ecom=3E?= MIME-Version: 1.0 Message-ID: <160104749936.7002.15136223385577937831.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/seves branch of tip: Commit-ID: 0ddfb1cf3b6b07c97cff16ea69931d986f9622ee Gitweb: https://git.kernel.org/tip/0ddfb1cf3b6b07c97cff16ea69931d986f9622ee Author: Tom Lendacky AuthorDate: Fri, 25 Sep 2020 08:38:26 -05:00 Committer: Borislav Petkov CommitterDate: Fri, 25 Sep 2020 17:12:41 +02:00 x86/sev-es: Use GHCB accessor for setting the MMIO scratch buffer Use ghcb_set_sw_scratch() to set the GHCB scratch field, which will also set the corresponding bit in the GHCB valid_bitmap field to denote that sw_scratch is actually valid. Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov Reviewed-by: Joerg Roedel Link: https://lkml.kernel.org/r/ba84deabdf44a7a880454fb351d189c6ad79d4ba.1601041106.git.thomas.lendacky@amd.com --- arch/x86/kernel/sev-es.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c index 6fcfdd3..4a96726 100644 --- a/arch/x86/kernel/sev-es.c +++ b/arch/x86/kernel/sev-es.c @@ -751,7 +751,7 @@ static enum es_result vc_do_mmio(struct ghcb *ghcb, struct es_em_ctxt *ctxt, /* Can never be greater than 8 */ exit_info_2 = bytes; - ghcb->save.sw_scratch = ghcb_pa + offsetof(struct ghcb, shared_buffer); + ghcb_set_sw_scratch(ghcb, ghcb_pa + offsetof(struct ghcb, shared_buffer)); return sev_es_ghcb_hv_call(ghcb, ctxt, exit_code, exit_info_1, exit_info_2); }