Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6079076rwd; Mon, 5 Jun 2023 12:41:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HRuLqwYLw+Wo9OdVTtMfSGAfeJq8piXYnf45KXOlfHOUUcMKYGb5IGvyNnjDw5sty89ol X-Received: by 2002:a05:6a21:900c:b0:10d:76b8:f442 with SMTP id tq12-20020a056a21900c00b0010d76b8f442mr31778pzb.37.1685994095133; Mon, 05 Jun 2023 12:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685994095; cv=none; d=google.com; s=arc-20160816; b=jE54whnEGri2Bp/Tj9s18CsdsbPVIeuSkTaR3vXTnIm8/B9uJHtPXVPNGOojhRPYbf tMglaf6ktPaB77E31WjSP8+Do8EhTzpu/jHqwP14xela5dQn4uigEVA8jCq2Iy/Ytnbo 38oEdGH7vTTgyjqXke/tibyriorG4y79qIMCJ9wX88Evp6jKLG7pphVnKYMhNiw94TuJ E+yR9r1uS2WB0kRhIR1cYR0CS/sP51HeuXizee2td3mzmNHXVcB845rxkX3JMjJi7Toz fb1X+Hbxo5MX029SxjiDtsWrWJ5DasWjaZI8GFQhFm9ZYxT/8mHWFdyq6B80ERWNmW3A VFZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=zXxTjcKvNFI7anac9WKvj8mUVxvOacgWdsA+CFdTPSM=; b=Uzuo7ib5e5sZ2ohYcTlsvt0aBKGGQpOKIpT8LDIh2fnZkeX0xtz1efPTY0Hio842ji 2LNyyqjUfqu9fMpT6BHu09pxFFPfBU2zxv/KqTHIPx0tEt85V7d1t+qHqwBdZV9iR4kq BoktOmVNlycjb+lnxHl8FJijl0Dt/d9MJj/ZUKEZ9qKz8RycsrzUx0X8ASD/m+CBW121 2taA0KkrFP1ePyVtTbDFapchERgLUrDpVBDVp9fXcaPn8E/lo34Eum4HwOGOzP6xoGQp 2jHWpNs4C2R28qY2US2kCIDuCDuadfQVSsDkTLgcAhZSrTKPI8Dq4d61nRaMJBQlRHK6 q1Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Sr9XK2l6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v186-20020a6389c3000000b00542b2e4c95esi5154551pgd.591.2023.06.05.12.41.22; Mon, 05 Jun 2023 12:41:35 -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=@intel.com header.s=Intel header.b=Sr9XK2l6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235622AbjFETTj (ORCPT + 99 others); Mon, 5 Jun 2023 15:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235672AbjFETTZ (ORCPT ); Mon, 5 Jun 2023 15:19:25 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A411AD; Mon, 5 Jun 2023 12:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685992723; x=1717528723; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Kt8UwcbAWIHbjuRkCIkoTQ1Kj/ybAb+bYpOZY2j+aQA=; b=Sr9XK2l6EeD6MuNr2ZQRiR151Rg0jugohDppNKl3CQ65CBHdzpiwgjgG n5K7WiJ/ERg5p1Ug0oZKT3mlSOubjloTa5/puepjXHSDy+odxltzroH5z PyZ1lkE6LCQAWHKmdTWBSVybk/aKk1hbpslSRrYcIBX4j31AuMhtGZYkB KBZIPe6qU+W9+yOjXk0hX+Q9VFD7Vn5gW7hGDmn9113qK+nkRNm+YmCQ/ yKmIrrSdYEe0CSkZ95Dz9solGqTkhFnPp3VCeEi6OtDeizNEAYQjMNsl2 afk+vHUHTAZ3SyhQUVKnJXMTmtnDvn7d09xRQPQyNn8744dho2smsKq+u w==; X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="422284836" X-IronPort-AV: E=Sophos;i="6.00,218,1681196400"; d="scan'208";a="422284836" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 12:18:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="711919843" X-IronPort-AV: E=Sophos;i="6.00,218,1681196400"; d="scan'208";a="711919843" Received: from pmudgal-mobl1.amr.corp.intel.com (HELO [10.209.41.254]) ([10.209.41.254]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 12:18:22 -0700 Message-ID: <5bce4a75-d4bb-74c2-1feb-e988841d5465@intel.com> Date: Mon, 5 Jun 2023 12:18:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCHv13 9/9] x86/tdx: Add unaccepted memory support Content-Language: en-US To: Tom Lendacky , "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel Cc: 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 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> From: Dave Hansen In-Reply-To: <1d24355c-3922-d5c7-4c05-f5ef0adaf5d2@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 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.