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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 77590C43461 for ; Thu, 10 Sep 2020 09:34:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 201F5207EA for ; Thu, 10 Sep 2020 09:34:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="pyLwfHRW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dOH5v8bG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730797AbgIJJey (ORCPT ); Thu, 10 Sep 2020 05:34:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727830AbgIJJW5 (ORCPT ); Thu, 10 Sep 2020 05:22:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28518C0617A0; Thu, 10 Sep 2020 02:22:18 -0700 (PDT) Date: Thu, 10 Sep 2020 09:22:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1599729733; 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=0wQGee5XyeUCiOLgXJu8CVETXL9+G6zfp1LXqqcOz54=; b=pyLwfHRWMBvt7Bq2XOEQzr0Fm3/aoHozALGFyKyF3eyy70vbVqHFYYir8D4h/b/+70U1nn K3E0+BFCB82aOZNZG6P+SHMzRIsBGQqvp+ZLdwdKixZZcHflnGB+DwV0zL+vJvSzS2+o4y O3EYkJHkX6+zIL8LWBsA1pir7ksOLFdnOgGRPexETvjpeojXye5ZENUsHPccSXuJ3XjRr4 ZhsK9Zxpnq+pS/h6SPcZlodLSdnxuQZdYRxQHdKEUS30fV0GwtVCpL91YIX2j4Q4qTFd6K fu0iuI1IrUtssQSRgI54hbUpWakgS28Shi9v/kylu5eat7vga4X8/esWBoA1lA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1599729733; 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=0wQGee5XyeUCiOLgXJu8CVETXL9+G6zfp1LXqqcOz54=; b=dOH5v8bGLcNL21XVIciZRNN5oXKZuI43+ASj3pdhINm7uCG/xSiIHnMgK4lRYTzw7xLDxT QgKBs9plBjqpIXDA== From: "tip-bot2 for Joerg Roedel" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/seves] x86/sev-es: Wire up existing #VC exit-code handlers Cc: Joerg Roedel , Borislav Petkov , x86 , LKML In-Reply-To: <20200907131613.12703-48-joro@8bytes.org> References: <20200907131613.12703-48-joro@8bytes.org> MIME-Version: 1.0 Message-ID: <159972973268.20229.9735553422722311923.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 Sender: linux-kernel-owner@vger.kernel.org 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: d3529bb73f76d0ec8aafaca505226fa0971c1dc9 Gitweb: https://git.kernel.org/tip/d3529bb73f76d0ec8aafaca505226fa0971c1dc9 Author: Joerg Roedel AuthorDate: Mon, 07 Sep 2020 15:15:48 +02:00 Committer: Borislav Petkov CommitterDate: Wed, 09 Sep 2020 11:33:19 +02:00 x86/sev-es: Wire up existing #VC exit-code handlers Re-use the handlers for CPUID- and IOIO-caused #VC exceptions in the early boot handler. Signed-off-by: Joerg Roedel Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200907131613.12703-48-joro@8bytes.org --- arch/x86/kernel/sev-es-shared.c | 7 +++---- arch/x86/kernel/sev-es.c | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/sev-es-shared.c b/arch/x86/kernel/sev-es-shared.c index 53e3de0..491b557 100644 --- a/arch/x86/kernel/sev-es-shared.c +++ b/arch/x86/kernel/sev-es-shared.c @@ -325,8 +325,7 @@ static enum es_result vc_ioio_exitinfo(struct es_em_ctxt *ctxt, u64 *exitinfo) return ES_OK; } -static enum es_result __maybe_unused -vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt) +static enum es_result vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt) { struct pt_regs *regs = ctxt->regs; u64 exit_info_1, exit_info_2; @@ -434,8 +433,8 @@ vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt) return ret; } -static enum es_result __maybe_unused vc_handle_cpuid(struct ghcb *ghcb, - struct es_em_ctxt *ctxt) +static enum es_result vc_handle_cpuid(struct ghcb *ghcb, + struct es_em_ctxt *ctxt) { struct pt_regs *regs = ctxt->regs; u32 cr4 = native_read_cr4(); diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c index 0d6b66e..b10a62a 100644 --- a/arch/x86/kernel/sev-es.c +++ b/arch/x86/kernel/sev-es.c @@ -441,6 +441,12 @@ static enum es_result vc_handle_exitcode(struct es_em_ctxt *ctxt, enum es_result result; switch (exit_code) { + case SVM_EXIT_CPUID: + result = vc_handle_cpuid(ghcb, ctxt); + break; + case SVM_EXIT_IOIO: + result = vc_handle_ioio(ghcb, ctxt); + break; default: /* * Unexpected #VC exception