Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1489129rdb; Mon, 2 Oct 2023 11:02:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbzvRmFZKTQad5DX+b9AGYHFPGDxuUsN749qm10pdwZInSpJtebmUBX2QReMTlae9davMU X-Received: by 2002:a05:6a00:1503:b0:693:3be8:feba with SMTP id q3-20020a056a00150300b006933be8febamr11552534pfu.19.1696269745628; Mon, 02 Oct 2023 11:02:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696269745; cv=pass; d=google.com; s=arc-20160816; b=X5IrO1bvwezJF1tDKGtNGBcC4AuAkHyW1ChT3RfeI18Pzvl/8P8XNO4T/Ii/GpNDnm bMj8ZiRWJgknvWKfworpre/RRyOgTGahVkMKBwwh5MBL2Y1t8EvlMQ65Ts37qhBW+zhw 8APqlORGFOAozqGEd6F49JdVc9YvTkOFqJfHtI3FaRkoUOJkGnbtOEsiNXLQQAMO72aK C2tgBQD0x2vNLgmHpbs7iSp9Lo9mfCGE/Xd3t11ZT1A55B4BFGyuOpe4l73/O60m7Zns L9rMzSxQQDSmsXjcF+NOopF6UZDDmtWjFnzpnVNjNK9VJBCAzOtCS0o1XNsKJW7phAG+ vZuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:to:content-language:subject:user-agent :date:message-id:dkim-signature; bh=D2lufn424Ss4gHxsGp7bt/PkhbtvNXKEumfJkE46RB0=; fh=KEGLDKil+kvi0rpTq/+km4unvRUm2VmJ8dzUpxtc70Y=; b=UnfBpe0jyGG8gWmB2mNunPt64bsF5HmiLWmlbAOXU9zHx4lrQ5HFCIm3HPyhxbIjtJ 8NvYctbJfO5rLNrSEviQwRph1TmtQacuJnxr0pvxfqiGts+QG78kuQ/CRaczHMHWxNAR vuKsJ4qMAh9pUlc/fr+rawSzNbKDEzxe05grMdf4qHV0S6OOb/ZtSdMYcUnI7ltRtW9o YEBsf1xrdwh/yqRZo8XWlfxhMuU+rflp7iHQAsrjo6O1WR+pdQLyVIpyMKB5ERnA2eQH yvJBZ88qbWu2bhL8b/JEA7MWAGCjnN35RcfSacbaBofmailAJgP3Oh3GDxF8ZiIsGBqq OCaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=TS4FnI6r; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u9-20020a056a00158900b0069100d1fc37si29284754pfk.49.2023.10.02.11.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:02:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=TS4FnI6r; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AD02E809D47A; Mon, 2 Oct 2023 08:43:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238186AbjJBPmq (ORCPT + 99 others); Mon, 2 Oct 2023 11:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238165AbjJBPmn (ORCPT ); Mon, 2 Oct 2023 11:42:43 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92AE393; Mon, 2 Oct 2023 08:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gnhx0+yfTWJeQQO50pS2eYtv431NmTkW1ltstymdzMpi1sBS/aFCZyDaDyaTKwxK5yA2dm0/6fH1tchaqnX/MvGX2soAF+G8BVH9lrAwqwWPAQBQs0NPj2/gaHt4Y6uq6QmKlWK4ailiXyhx6/HboKUUzG6YaXXZPeeUCln70oV+DDvVCoFMvYyUJw50E+xzfTEZSYYGRZveVnx/ouvJjfhiTmvi9cXdlk/OHVeRPaHeG1zIst3IYWlX41gxtG8NjR+KbfawxQWS+OClCIstMEBHS0/SDaf40uEFwoLoAIoJtULAB4CIu3aD98FaRwfRp4fXlwG8ORLuJWdyJQGKYw== 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=D2lufn424Ss4gHxsGp7bt/PkhbtvNXKEumfJkE46RB0=; b=nh//5hynD1T+1EJH4CEfPtAu7+oRbdMDWBUa1uKCpv5QX2tWWjFnHbJVeNNZMvBAIrk1NLK9iNUdL/C0adAAJ1ERSAlgzv93Uh+oIFinP67c8Gi+0Bkk3vYcZtgPAF4daI6DmaWE6UtC2cwG2MBXDImL4CetZkN1/YUmhn/g1q+0PhmSPRS2yyO3nhtgtOn2Z4strzVP0hbY/uDTw7GYoo70QPQe8proVaGTa3dmtrvTTOKr+4gbbCIYc/um1PcOivWw2wLLTJ44HLU3yerXrnQ+coMg9aYkKsBHewFXNSR0COum4b3XcwbxmA4ISrjYBYo4TGPtHQ8I8cDOTD5jnQ== 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=D2lufn424Ss4gHxsGp7bt/PkhbtvNXKEumfJkE46RB0=; b=TS4FnI6rZ5KyUN3rX333en/0TmtqDNajK5CPiEcMNlzKO+8mFVg1wLG6ZQr4kCn2GEfUc0w2npkaiFAEudOmDpayUuTYhFI6/b+Y2efWQKKNsqHKry0cV/YKIQ2cP/3WejCkug0OmlkHQQeaxLARL3RUc/SCmYOl7ou3GWE9Ok4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by SJ2PR12MB8690.namprd12.prod.outlook.com (2603:10b6:a03:540::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.31; Mon, 2 Oct 2023 15:42:38 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::2b54:7ddf:9e2e:751c]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::2b54:7ddf:9e2e:751c%3]) with mapi id 15.20.6813.027; Mon, 2 Oct 2023 15:42:38 +0000 Message-ID: <6cc4dea3-915c-1842-10f6-c3a8137cfdc9@amd.com> Date: Mon, 2 Oct 2023 10:42:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 0/5] x86/coco: Mark CoCo VM pages not present when changing encrypted state Content-Language: en-US To: Michael Kelley , kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, luto@kernel.org, peterz@infradead.org, sathyanarayanan.kuppuswamy@linux.intel.com, kirill.shutemov@linux.intel.com, seanjc@google.com, rick.p.edgecombe@intel.com, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, x86@kernel.org References: <1696011549-28036-1-git-send-email-mikelley@microsoft.com> From: Tom Lendacky In-Reply-To: <1696011549-28036-1-git-send-email-mikelley@microsoft.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DS7PR05CA0067.namprd05.prod.outlook.com (2603:10b6:8:57::12) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|SJ2PR12MB8690:EE_ X-MS-Office365-Filtering-Correlation-Id: 8699b45d-8a81-4181-9908-08dbc35e349e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XYJe1nVrXXSYPbojTnJEGfBC8MXYs6l2QpqIXaVTtZwrDmnjaiT5dM5mK8vACiEcPz8BMLZQviUYn6noLQyvjqfiZo5+8GhuIeqV8LMWV5aYiAEdoCUSSaDUW8c8mc75iePImGlM1/mcTXWxZP/5eEfmbm3nMtRCr6mY6xOQsjGMptb4tWJ35XrzVhPGgvS+30zAm71T9Q/UQjsO9aWjrn2+ACPQl8z54V+y5nmRYockOjHtVI/j3VxCtTB2V2AMdww9V1cGoO889NxoBiAR20PGV4DMBV44Y8G4GYO/e1802KojX7VaNlmxBOEqa14LcQe4wZjdpkCY98S3TlR5e35BzXbnocorwqE44qALFY8Z4KWhMNP2zd5vqvCskFmuFWM0WykxVQwftK8P+H6PsRr1pWbLN7DwrkwqzSot3KBGcm8PeQbYYssEJE3i+u1gWh0O1Ls/ZwyAfXiYzsxnJGBTsb+zwMvRaxEaUIag8Q0PIUhGi7W7XZ2avCnFXF3chF4uKdBwvMoNYWns4NIXFjJF33xVasRpD1SYF+dfwa3raf+2D9ifZk8RWqt+c3EsWsGBrZDigHXGN4toy+C2L5Bl/wYtZBYypiUW2xKoDZCwmzxM0V9FyMipjhODWJg+eBesjLLwKH6nO8PmsvgNkOxc3PCQt30GSzzMJsuAJps= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(6029001)(366004)(346002)(396003)(376002)(39860400002)(136003)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(45080400002)(53546011)(6506007)(6666004)(6486002)(966005)(478600001)(83380400001)(6512007)(2616005)(26005)(7416002)(2906002)(41300700001)(66556008)(66946007)(316002)(66476007)(8676002)(5660300002)(8936002)(36756003)(31696002)(38100700002)(921005)(86362001)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?LzNSZXZwbWhmYmVjNTVQWWs5QmdNT0V2N0s3OHhjMkgxK2xoTDVwU3B2UDVt?= =?utf-8?B?UHE5WWdXcS9RM1EzdDEyU0g2dTYwT2tyRUFxMmtvOWtFOEZPanQ4c0dRbUt6?= =?utf-8?B?SXFhUTY3cDNNakowUzF5WE5nbmFmUkEva0tsSUZCVFpmaWp6ZEhhVm5HSTh3?= =?utf-8?B?WXBZN1dFdHB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= =?utf-8?B?VnBOOXJsZmdOZVVXT3JUd2t6SkFjYVF1WDJPUTc4NVZlZ3RjTTNTN3N2NE45?= =?utf-8?B?VDAvNTR3QmlwSzhjSi9mTVR3eUh1MHZGQkVUVERNQk5XZzlHam4yMm1ZU1hW?= =?utf-8?Q?eBtCVyQJpHB7r5OwrbE8Bn8Uq?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8699b45d-8a81-4181-9908-08dbc35e349e X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2023 15:42:38.1762 (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: 1IAYXduOiQqGtlCqpXfI87brMuaD1pIsD37J52NyOLkyalXqI4KXB2jhaiPLfdUuDHaKEJVbpC7OlY21qSGg+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8690 X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 02 Oct 2023 08:43:14 -0700 (PDT) On 9/29/23 13:19, Michael Kelley wrote: > In a CoCo VM when a page transitions from encrypted to decrypted, or vice > versa, attributes in the PTE must be updated *and* the hypervisor must > be notified of the change. Because there are two separate steps, there's > a window where the settings are inconsistent. Normally the code that > initiates the transition (via set_memory_decrypted() or > set_memory_encrypted()) ensures that the memory is not being accessed > during a transition, so the window of inconsistency is not a problem. > However, load_unaligned_zeropad() can read arbitrary memory pages at > arbitrary times, which could read a transitioning page during the > window. In such a case, CoCo VM specific exceptions are taken > (depending on the CoCo architecture in use). Current code in those > exception handlers recovers and does "fixup" on the result returned by > load_unaligned_zeropad(). Unfortunately, this exception handling can't > work in paravisor scenarios (TDX Paritioning and SEV-SNP in vTOM mode). > The exceptions would need to be forwarded from the paravisor to the > Linux guest, but there's no architectural spec for how to do that. > > Fortunately, there's a simpler way to solve the problem by changing > the core transition code in __set_memory_enc_pgtable() to do the > following: > > 1. Remove aliasing mappings > 2. Flush the data cache if needed > 3. Remove the PRESENT bit from the PTEs of all transitioning pages > 4. Set/clear the encryption attribute as appropriate > 5. Flush the TLB so the changed encryption attribute isn't visible > 6. Notify the hypervisor of the encryption status change > 7. Add back the PRESENT bit, making the changed attribute visible > > With this approach, load_unaligned_zeropad() just takes its normal > page-fault-based fixup path if it touches a page that is transitioning. > As a result, load_unaligned_zeropad() and CoCo VM page transitioning > are completely decoupled. CoCo VM page transitions can proceed > without needing to handle architecture-specific exceptions and fix > things up. This decoupling reduces the complexity due to separate > TDX and SEV-SNP fixup paths, and gives more freedom to revise and > introduce new capabilities in future versions of the TDX and SEV-SNP > architectures. Paravisor scenarios work properly without needing > to forward exceptions. > > This patch set is follow-up to an RFC patch and discussion.[1] > Compared with the RFC patch, the steps listed above are optimized for > better performance and particularly for fewer TLB flushes. > > Patch 1 handles implications of the hypervisor callbacks in Step 6 > needing to do virt-to-phys translations on pages that are temporarily > marked not present. > > Patch 2 is a performance optimization so that Step 7 doesn't generate > a TLB flush. > > Patch 3 is the core change that implements Steps 1 thru 7. It also > simplifies the associated TDX, SEV-SNP, and Hyper-V vTOM callbacks. > > Patch 4 is a somewhat tangential cleanup that removes an unnecessary > wrapper function in the path for doing a transition. > > Patch 5 adds comments describing the implications of errors when > doing a transition. These implications are discussed in the email > thread for the RFC patch. > > With this change, the #VE and #VC exception handlers should no longer > be triggered for load_unaligned_zeropad() accesses, and the existing > code in those handlers to do the "fixup" shouldn't be needed. But I > have not removed that code in this patch set. Kirill Shutemov wants > to keep the code for TDX #VE, so the code for #VC on the the SEV-SNP > side has also been kept. There isn't any code for the SEV-SNP side at the moment. Thanks, Tom > > This patch set is based on the linux-next20230921 code tree. > > [1] https://lore.kernel.org/lkml/1688661719-60329-1-git-send-email-mikelley@microsoft.com/ > > Michael Kelley (5): > x86/coco: Use slow_virt_to_phys() in page transition hypervisor > callbacks > x86/mm: Don't do a TLB flush if changing a PTE that isn't marked > present > x86/mm: Mark CoCo VM pages not present while changing encrypted state > x86/mm: Remove unnecessary call layer for __set_memory_enc_pgtable() > x86/mm: Add comments about errors in > set_memory_decrypted()/encrypted() > > arch/x86/coco/tdx/tdx.c | 66 +----------------------- > arch/x86/hyperv/ivm.c | 15 +++--- > arch/x86/kernel/sev.c | 8 ++- > arch/x86/kernel/x86_init.c | 4 -- > arch/x86/mm/mem_encrypt_amd.c | 27 +++------- > arch/x86/mm/pat/set_memory.c | 114 +++++++++++++++++++++++++++++------------- > 6 files changed, 102 insertions(+), 132 deletions(-) >