From patchwork Tue Jan 26 17:36:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 12047629 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 CE0CCC433E9 for ; Tue, 26 Jan 2021 17:40:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FE6522A84 for ; Tue, 26 Jan 2021 17:40:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FE6522A84 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4SKQ-0003vd-Hy for qemu-devel@archiver.kernel.org; Tue, 26 Jan 2021 12:40:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4SHR-0002EN-Fr for qemu-devel@nongnu.org; Tue, 26 Jan 2021 12:37:29 -0500 Received: from mail-co1nam11on2049.outbound.protection.outlook.com ([40.107.220.49]:64609 helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4SHM-0006yT-BN for qemu-devel@nongnu.org; Tue, 26 Jan 2021 12:37:29 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jmJOQlcjcAYJbTkGHvBCeeYD4JUF1uR4JCMsUetjz3r1NqkVgWtmXW9/iFCOsrf2rodIP7D/i8Wb6B3ctawSQSoPGCTe8mlsmDgFZ90MAM7MPCBwxvaWaShdztoNKIVsYWkoEwb5CEkuOGE5SvnUp0ENjIwUKBxgXCa73HCeF9+vDJ0xoAgJb6YlOTCW1EXC6IX+8UrZpjgynRGirnL9SSj27aAzwjsGPaqqCVlki39F3teU9H9lgx9nPUv31BJyymk9xD7rjr4XxthX/rntfhZSykePBbkwW8RJu15Qzta4PcK0Zolj7qpYFuDCwbU4JfmyZWk+cpQjjpJ3DujyCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8WjCjqNwQxZDZUw3moMX0D0fUfH7UK2ltKPE5+az78M=; b=P2iTDyC1hB2DGVhsHArgE/Szr+AT2JHHzvYokqB8tuTaLiYZxhYvsYdmGcoAdJiF3EvcwjwelaZxxwFIpbboE+4e0Qv7HlYFZWloagfkWlno1+BpB070mYq48GWrCPc5SR6KvP7wBfJu0B/zOU7Qb/JPC2hRKQATXEVSEq4hqb2XpDNOu6We3raS9Ew1MoyJz+CfVknMRNHqqv2khiImsTvHiqqtbFwTC/oJBn48HqlUw7kuFnyDB6tkKYhZb4UaW1TEd4cAy2mgtlE60bAjWjdWfv8s8UFVKIhPz39WyhdM425vCK2Ktwrp1VdKFSuwVHfJBDvGjYsgVZqSZ0097Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8WjCjqNwQxZDZUw3moMX0D0fUfH7UK2ltKPE5+az78M=; b=rrxLVoOrlJOvHungGonvso6PeUVFEHlWY4TP3OaUPPdY1jdx5ABwZugF3wKhdb8lDOUWJo4fO4Iw5WHO0rItC+X8F1oE6LAGJ8fmt8L4O4hPDclZDDN1097X8dfP7W/4hurF8C34dU5UkrZlYw3y+PcF5GUETm2zoQupvcOvrdM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB4153.namprd12.prod.outlook.com (2603:10b6:5:212::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.13; Tue, 26 Jan 2021 17:37:21 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::cc15:4b1f:9f84:6914]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::cc15:4b1f:9f84:6914%4]) with mapi id 15.20.3784.019; Tue, 26 Jan 2021 17:37:21 +0000 From: Tom Lendacky To: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH v6 2/6] sev/i386: Require in-kernel irqchip support for SEV-ES guests Date: Tue, 26 Jan 2021 11:36:45 -0600 Message-Id: X-Mailer: git-send-email 2.30.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN7PR04CA0220.namprd04.prod.outlook.com (2603:10b6:806:127::15) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by SN7PR04CA0220.namprd04.prod.outlook.com (2603:10b6:806:127::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Tue, 26 Jan 2021 17:37:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a1aff093-a15c-4b33-6458-08d8c22108eb X-MS-TrafficTypeDiagnostic: DM6PR12MB4153: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:989; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z4vwzT5MnsnRGPnwAlXM32A5MhJ+oQ+tx2huGnt3MhB1jK9B4IoDEQlQBVBbjgLb9PaF73I7OWxGsl48d8jscSveertwa3RuZdi8NSvT3Xp4hBbotg6fHE5koCpcXCwVaT27grva8nnT9WCBiMKSmlKXOzbA20C4u8ggnjXLWg0+MaUsgRttykGb+9wxV04KNQ45wlJXgn7HN7sP8NLTTqolnAoWqQNalJ3sfXEwYFvObXoXs2Gx+ZVlGkoY9sT3LczLmvw2KSpaS29vUXwsrSYpRpf0npJgNgm2dj4/pnPpqajqoUEmTodvbkvMTR1X4Zf+acrqEyPdKy6tPOBl4GOLfU8d2y62/olH0jMirRZNYxBnCAivdT2PhRoqHxhrcXc4ul6d8w7RqFlO/64+Bg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR12MB1355.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(39860400002)(376002)(396003)(346002)(136003)(8676002)(7696005)(52116002)(478600001)(6666004)(7416002)(4326008)(2906002)(66476007)(316002)(54906003)(5660300002)(26005)(2616005)(956004)(86362001)(36756003)(186003)(16526019)(6486002)(66946007)(8936002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: rpnfQcbS9IUw046Y/QXgUGeERf5Uf7rOeSX3KZPoWcNj0hLWvM2OpFPBTFpbHIAa1qDdvOqebDaz+GmrOrfs9hUBmQrzENtS7qfXeND6t3I8mTUWdPIe1fqTaCSYQ87OgBhGsuYzRztziwAzGGyQzY6TvfDqE4eXpXz4iKC8yH+/a31jlPneQEmmN7kOcbuUps5A4y2PVMdttAIL/d4TKwCjWNTjWe+L2KrNcJxh5Cs5jcK5tlTS3izJlyMYSVnX7dvNdItqzK8Y/qgnh2yfJZJZ0fFtPQriKcpSbH+Sqgsz5DoONepu3ax1Cix+WLIb+wJ1aIyg4MwGuDt6WIXbd0vX4Jk0003pnLNPpZSwlVy2SgggMWLyeNEvc6J69/wcUvabs/cVh0Fb77TK18m1x3/18wm4gFJOV2FHD2z+3D/7TUHpW+NVINrYli0+8/yVHqqWy+NKrdCtRu4vhfylMx3at2BYNz+nqKzCID2B3bmZDuF1XPuPEYnRD3NV2+CuP/lDDzJzzyTQ/knp00bAV2HAiw+l8HzH/Bgw2Vn0AlwKGKeThxmH9kxY26PvIO8kLuzk0xnkqDEO5FyBx2Chf+1NBPBTPpymp6eP6IsUkjTv3p+PtM8xQkKX95LYILwEnHQla7WGK3kA+Un8ykECpKqFB9uc5NjJFKlrdLo/1JU1y1WNfoP119Mxz0I8CDnlPnlkOkH2+7ubUfiN8X0WCJKt4HwWPeeCZznqaKd2cMFSTcXeFRc4GV0kNpKfngk8xS9AADdC7QCi2QA3Rly9lbFM6QpTSCEzcP8ocYdcbt6D7HYA0GZKFLvJxZVSDbOru9Dav9pOLMP2cholFd6gXquqFpKHbpO/md/rK+Hcg9ouwATqYo4nrooufA/pJdSB/pyxj1XitLKkGvpTbosv5eTj9iC4gX+AImbWBu76n5sAEsSEciTjyE2h4YLR/lBX6lIPp+YaGrfjHc3MNu5M0xlnZpUM2c213NVrk0waLz4MHoqJQo55nnT3duCm5zcd4xwUTb7OQP9dF6/6ENXG3U46ngTAEIl5qaqAO5djmUxFar1fSypBnRKrjdlBdvGs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1aff093-a15c-4b33-6458-08d8c22108eb X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2021 17:37:21.3968 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ChVEYz/Svh/X/msvDkfd92a2AJyma/f7jxB3BGvMau2zFElGKlWTYeDrkjdqIAiLVPM9Curg6F8lpXR3dfDMbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4153 Received-SPF: softfail client-ip=40.107.220.49; envelope-from=Thomas.Lendacky@amd.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Brijesh Singh , Eduardo Habkost , "Michael S. Tsirkin" , Connor Kuehl , Sean Christopherson , Marcelo Tosatti , Richard Henderson , "Dr. David Alan Gilbert" , Paolo Bonzini , Jiri Slaby , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Tom Lendacky In prep for AP booting, require the use of in-kernel irqchip support. This lessens the Qemu support burden required to boot APs. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Tom Lendacky Reviewed-by: Venu Busireddy --- target/i386/sev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index fce2128c07..ddec7ebaa7 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -776,6 +776,12 @@ sev_guest_init(const char *id) sev->api_minor = status.api_minor; if (sev_es_enabled()) { + if (!kvm_kernel_irqchip_allowed()) { + error_report("%s: SEV-ES guests require in-kernel irqchip support", + __func__); + goto err; + } + if (!(status.flags & SEV_STATUS_FLAGS_CONFIG_ES)) { error_report("%s: guest policy requires SEV-ES, but " "host SEV-ES support unavailable",