Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp879122pxb; Fri, 22 Apr 2022 13:16:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH1l5wSiUXc4XUKIZB+cpNTfT750XDsfw2jc+9ewnQkKSRGzc34I6gwYZu5thDQTLFdoin X-Received: by 2002:a05:6a00:8d6:b0:505:b41a:13a0 with SMTP id s22-20020a056a0008d600b00505b41a13a0mr6796722pfu.67.1650658612034; Fri, 22 Apr 2022 13:16:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650658612; cv=pass; d=google.com; s=arc-20160816; b=lqXAvi039tDOuUcMXnWNtmOwmPGh5u+bFBVU2YY/EN3I7JF/v1rs5zAVhYmVaonbBO tI0xSiPkEM5Aac1ih87RyRVph+FrnZz55tRtk44a0SfgsYU9weOtcNhzIZ38XnYTfvZc zoOw7y0xcEJfW2Utve2Qg4+CBEfS1AkvNMxzEg8aehKYlQBcvki7QdQLrmnK5rdbJDP3 WDKtu/Z4qpf4XLxPePBm4+W8fUEt6vLE9GIizdmolO7HSqjxyy8q54jL2WUYNOoICAks FNs0c3Qag+LBtSNMBhVUI0ooKT5hQn8LBXpsNgjunG7zo/bz1tVrDmdczrF0tZZrUDAy z5Vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kDontTKZotH8ldP82kb8V57amLDd4WdPeM6ejg6UGAU=; b=n9UCpOD6GXydntVIaJfYF3SS28yULl0K7ORPKh45fp7V4cyAWhjoaMr/rp5lYSIwL9 f4R7jNixx0Pwy00pH3x+2gJlLrMYVsBeWiovuJYKXCO5GXpXfsHCQ4/PS++iej/u3hfF cMd6TvVHqhXIFyUw0mx2qxKVVXyhQgovtRavg335pedfvGDd1XVPigSuGf5FxG+tM82h VZ6onbJ1mn8hMymt/Uzo0XBdPpK51L0hTqCCh3G9SH38kIDAZ5YjMFWWhDmWdTQhC16H y75L8YM1QQnLwSHqgLiq5fM3kji+xcTy9c1cWBUKJcFmFJy1rYPA9gpacdi8/0UVUbT9 N36g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ig6izKzk; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j6-20020a17090ac48600b001bf082ef447si8083738pjt.111.2022.04.22.13.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 13:16:52 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ig6izKzk; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E6FE328EDF3; Fri, 22 Apr 2022 12:19:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1448249AbiDVN7y (ORCPT + 99 others); Fri, 22 Apr 2022 09:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448238AbiDVN7u (ORCPT ); Fri, 22 Apr 2022 09:59:50 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2069.outbound.protection.outlook.com [40.107.100.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E183358E7F for ; Fri, 22 Apr 2022 06:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cg+B0XeF07Q5AuT8/UwIpD948G4Yv65BuPco/Y6jZGMTtCPVzHNYaXpWfTMWoPVNHPyJTLTCceRDqJErEmAIWSnj+hD0sBz76sszYfTEb1FyPTqNRVY5EZnboS6mYGQ5CBqKl6zqU5wU08HrH8TPlPofxj5hPasn9OqOr32UsU/WKmiuJqTzoum+i+0jjDebQSv8m/lP+TO8IFPzeZuVUxwnS0oV3KseOy9fdRyjAukHEzX6nAEIpX1WDdHZvuZWsctF/xC5qaNei8mqZWo3YzeG6fehxjeuJG3e+3SYp0foOhNM2aJDUbnrDHjDb/rVHnElIr7rnSTLOqWRE/nvDQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kDontTKZotH8ldP82kb8V57amLDd4WdPeM6ejg6UGAU=; b=nr2h/5ZKY7Go5bQcSyyuS2zprEybNNthjH+cFMzmY+BZb9AoIOoGWq6YfmzQmdY/J/STrhEf5J+5vdLX7ojtVpGlc40NN0x/lNCIhRHDwRKf/XTH8eac/JtgRWTPc6Txx4Vzu3q+5kDddiWlG03HNa+lolgjpI+j3Sy9/jPd+whhT2g7SfL9a/V5TrtJXlQqfXRE5KqZBEg+NuktAKHGJkBAvcfNkyPBJhzGmj2bMFYw8s8Wp5U/VQKPOPULNbwQhxeU5f4YK9DujdEZqhSIJnHx9VirMTgAopOkXzwBwYtKsdskcsH32gK2h5BVz8Q3ujze4UkEslAHA01OJ74yCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=kDontTKZotH8ldP82kb8V57amLDd4WdPeM6ejg6UGAU=; b=ig6izKzkQVcrYVxl6vIU6kXS2hWgldkVkJxAzZnqcW8VTf37a6OYBjCzRAZMQSVbMhJIE9YPqPo/Ekji0qHCDvBywtDa0pL76zi2qy8ZAaFJ/RZSmC/lUm6Q2De2z0ztI4lP6ncucVXUk0jvclh81xnTMn/zJLm1XOCopOBdNv8= Received: from DM6PR08CA0066.namprd08.prod.outlook.com (2603:10b6:5:1e0::40) by CH2PR12MB4072.namprd12.prod.outlook.com (2603:10b6:610:7e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 22 Apr 2022 13:56:53 +0000 Received: from DM6NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::6f) by DM6PR08CA0066.outlook.office365.com (2603:10b6:5:1e0::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13 via Frontend Transport; Fri, 22 Apr 2022 13:56:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT015.mail.protection.outlook.com (10.13.172.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5186.14 via Frontend Transport; Fri, 22 Apr 2022 13:56:52 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 22 Apr 2022 08:56:46 -0500 From: Michael Roth To: CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H . Peter Anvin" , Kees Cook , "Kirill A . Shutemov" , Tony Luck , "Nick Desaulniers" , Kuppuswamy Sathyanarayanan , Tom Lendacky , Venu Busireddy , "Joerg Roedel" , Tianyu Lan Subject: [PATCH v3 0/2] x86/sev: Fix AP Jump Table handling for SNP guests Date: Fri, 22 Apr 2022 08:56:22 -0500 Message-ID: <20220422135624.114172-1-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9d1866b-dd7b-42e8-96ff-08da2467f495 X-MS-TrafficTypeDiagnostic: CH2PR12MB4072:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qt3abVsx/GD+VLwlVqLjYk8IkWSOW0y054E6vgAYB2kFZ3+rEPy1CZRa7UAyx9NBXg+iTkMn5jzWKqR6+Zs+KLXSu+10JIGs4O8VmaI27mfT2MqUQQEL/v62v+8/J4eLlrC1VTFpctJ3YWdqsHmHx8R6OOH1ERm31+H29wjWFvo79Osczpcuzp5/5aMuPFXbhMBWM74+dUqjuNWZHO6NS4r+l7R3G54wce5xMtF6vy3aC2Y3T5IL+pg7GL+alUYTygNKYRhWEq6Haboj5qn8tTcmd9Fd2km8ThCHtZ7c/02rSYHh6jYd+0/89QxxQRcSKycMppnTXWOLclt3SFVrCaOMJiySncGUZYBGBuej6YuYvZ65gJipCqYLTikqhQ4y1hY3YkyLHnEKELiMZZtUE0BO/IEgszuUZvyV2f/ttdHozBx/j5cJy5WVYrWSWUlloy8VhGfHx6Onzb4znclzXsFUmjO3haoTb12WrYUTdWyFQcCrl9uPIAzU2GK+1Sbvu/fKJpavH2ygSZgXGCzFJYlYpwLOpa/Nc+nCVONc0FH+Fo+DQBsy+LlbeaAzarxf/UK8xXuDbN9syYahDSBLNA+4uMH3XsnaxHPLqYUtisLPsuS3KeYEIIHIE+Zjl0AUyv2kYD9AW8b9SIwypEWrErDk8E4B9jqJ83AvFcTQcpiFykXjuvGhg1r8Z9SfNjusPXLLQ7axYUq9F6eGDoSI/g== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(36860700001)(426003)(82310400005)(6916009)(54906003)(40460700003)(70206006)(81166007)(356005)(316002)(36756003)(336012)(2906002)(508600001)(83380400001)(70586007)(5660300002)(26005)(7416002)(16526019)(186003)(6666004)(47076005)(1076003)(44832011)(86362001)(4744005)(8676002)(8936002)(4326008)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 13:56:52.8928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9d1866b-dd7b-42e8-96ff-08da2467f495 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4072 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE 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 This series is based on tip/master (commit 1912a07f8a) SNP guests should only retrieve the AP Jump Table address from the secrets page, not via a GHCB request as with SEV-ES guests. This series reworks the handling accordingly, and fixes up some __init annotations for some of the SEV routines touched by that rework. v3: - Address missing __init annotations (Boris) v2: - add handling for memremap()/ioremap() failures (Boris) - don't mix function calls with declarations (Boris) arch/x86/include/asm/sev.h | 35 +++++++++++++++++++++++++++++++++++ arch/x86/kernel/sev.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------- arch/x86/realmode/init.c | 2 +- drivers/virt/coco/sev-guest/sev-guest.h | 35 ----------------------------------- 4 files changed, 90 insertions(+), 62 deletions(-)