Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6219891rwd; Mon, 5 Jun 2023 15:08:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4SixxedMpW5qAlZPfJZG1cKimmmEca6pVADKjV+3QsGldZVKKHFHJnP7agsPwqGNK+Z/gf X-Received: by 2002:a05:6a00:808:b0:647:1cb7:b714 with SMTP id m8-20020a056a00080800b006471cb7b714mr1210650pfk.3.1686002913122; Mon, 05 Jun 2023 15:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686002913; cv=none; d=google.com; s=arc-20160816; b=fttC8FgeOfr5OI7KBCQcupoKK6ocJ2l1eYqfKDmy/iQ4ECUUXBmJTunpWuhUFZ5IAj RnRSeY4Ebk4US5NsZ44v0XpRgLpv0hXSBTVBVUYweRWSz02d2eLoRh9ns0HM58q+1efz mkusPkN9sRunHyc1GOwPotdqanVs8q6eLXUO/tFMXcMxH4+v4DcTENjjYybWmjNEC8/O hrOlt/ucxmEOGaBhLVjKEzathhU/xd7WbkzQuUwPzy07WmamIykVZpM8HTzKZG4ePH2+ llSQQCaQRMjsWnaMyN4V8QwrT/nB7lHWs9MYXWey3iLf8BCpBJ4Y1kH/qJvUNVQ3aov0 ZEYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=UUAdc4FX4fn3xdKCVk7gxQNMDBQkMF1WCK+GRex238Q=; b=HjhNZkWIa16sDAbWQ3mNlR6AO71ZAZ9a6fh55CTSjQxn4+8A1sZSuxRTw/Q+y/dZmo fZ//zUs3AqFtauuD8TugX5oCpsRsC2H52OlvrxFc/Jv4aT5gwsbVewdNIm5dQUUiW0T3 eZtjrRwDtn7w05UDsJjHAxLuS4ol+QTyeBaojx9ERNUeO3AmUj4MIhaJgNmXq6nE4WgB N0vQEUPE4W2akfZ6J7xSQN+DUkOtuPJ1NVQo81fILnVwpcVVrTz1eX8dP1wqgdjHBDKr H+/+cUWKix0kCHdLU5PQZ9TSChJHCxr2iVPiOBunpT2IXq21TY8SkFYmN0fu5GKz/kBk zc1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm3 header.b=XAirlODG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=IZOyttrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 24-20020a631258000000b0051f869d7089si5373212pgs.74.2023.06.05.15.08.13; Mon, 05 Jun 2023 15:08:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm3 header.b=XAirlODG; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=IZOyttrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232654AbjFEVjk (ORCPT + 99 others); Mon, 5 Jun 2023 17:39:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231425AbjFEVji (ORCPT ); Mon, 5 Jun 2023 17:39:38 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A2BFA; Mon, 5 Jun 2023 14:39:36 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 5CAC55C0797; Mon, 5 Jun 2023 17:39:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 05 Jun 2023 17:39:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to; s=fm3; t=1686001176; x=1686087576; bh=UUAdc4FX4fn3xdKCVk7gxQNMD BQkMF1WCK+GRex238Q=; b=XAirlODG66Lz0RJ7tGYtvOMFZ6VQ0BtoxHpWjqrsi M6hh0j0c1dd863+dqLyETk0JIINoUCatgsjqICepo6jmJn0a8MoiV6BxkStZWaao iNbUEo/330fP7kh1QipXE1rh833hvrShAr0Vga0azXfgtRW2zIYxzepY6PZzYhm3 u98WqR0znzLv3lNBmXziJB3htrvjhOnznB58FDVov+BvOwjkP9m73vOljFjf3rNU XzYnZcBU1R8BL403gxKgn0OIPCruf7V8b/dywUqf8RQwqtodF7sPhiu+143d0MCe pX171RXT0++PEPZvMQ0bBCdhbDQ9CKxvMcWOpNOMCRNmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1686001176; x=1686087576; bh=UUAdc4FX4fn3xdKCVk7gxQNMDBQkMF1WCK+ GRex238Q=; b=IZOyttrRKPkavkJL7GOaKUzfnNi7vFyHCoxvd4O6JaKnfcEqy1e ar0F3Pge4FZXLpGQ6mybczDoXgkwcA68csuduiEixsM42JgfPrb63GAYdVD7GGot 3xC0H1zI6z43wDvFRWPiVZYT4hYUy8EvJVHe86p5H6LTAIZN0XKrF6feeKU58k9S JV7rX8SJZm0qb74UwhaeqNUALGkkWySiXHeDP2JbkutWWH1ysUVKf5YOYJWnBJ4+ 8tUjP7zb/ENSK0//c2UtyJQMMv+NbvHE/HcFmUrN+lIHuNw2d04khV13PicNAjuA v8GSsHKqIl9Q4k/GRR5t/dxRwqk8d1UqwHg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedttdcutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgesthektddttddtudenucfhrhhomhepfdfmihhrihhl lhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnhgrmh gvqeenucggtffrrghtthgvrhhnpeetveehleetgeegffejffejtdevgeeugeeftefghffh gfeivefghfeuvefgjeekfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Jun 2023 17:39:35 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id D907A10A631; Tue, 6 Jun 2023 00:39:33 +0300 (+03) Date: Tue, 6 Jun 2023 00:39:33 +0300 From: "Kirill A. Shutemov" To: Dave Hansen Cc: Tom Lendacky , "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , David Hildenbrand , Mel Gorman , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, aarcange@redhat.com, peterx@redhat.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv13 9/9] x86/tdx: Add unaccepted memory support Message-ID: <20230605213933.vqkvfo5fzffj5zri@box.shutemov.name> References: <20230601182543.19036-1-kirill.shutemov@linux.intel.com> <20230601182543.19036-10-kirill.shutemov@linux.intel.com> <4d8d6fc4-99b5-29ba-7f81-12e7d57907ea@amd.com> <1d24355c-3922-d5c7-4c05-f5ef0adaf5d2@amd.com> <5bce4a75-d4bb-74c2-1feb-e988841d5465@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5bce4a75-d4bb-74c2-1feb-e988841d5465@intel.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, Jun 05, 2023 at 12:18:21PM -0700, Dave Hansen wrote: > On 6/2/23 07:26, Tom Lendacky wrote: > >> So this is a change in this version. If tdx_accept_memory() fails, > >> you'll report unknown platform. Wouldn't it be better to have an error > >> message that indicates a failure in the accept path? > >> > > > > Maybe you can keep it similar to the v12 version with just a new error > > message, something like: > > > > ????if (early_is_tdx_guest()) { > > ??????? if (!tdx_accept_memory(start, end)) > > ??????????? error("TDX error accepting memory\n"); > > ????} else { > > ??????? error("Cannot accept memory: unknown platform\n"); > > ????} > > In the end, these errors aren't plumbed out to the page allocator. They > *need* to succeed or we are dead anyway. Should we just send a fatal > error up to the TDX module when we fail to accept memory? It's > _slightly_ less opaque than plowing into an unaccepted page. This is decompressor's error()s which are fatal. arch_accept_memory() in the main kernel uses panic() in the same spot. -- Kiryl Shutsemau / Kirill A. Shutemov