Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp758353qtx; Mon, 31 Oct 2022 13:10:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GGzUIq0R7X1EubY2DQZ9fMF7GrYCDZ/n5oZh867z2nptt5ntQJXDh6h3yT8fYfRDHIc8I X-Received: by 2002:a17:902:b595:b0:187:34f6:7820 with SMTP id a21-20020a170902b59500b0018734f67820mr1012338pls.152.1667247043225; Mon, 31 Oct 2022 13:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667247043; cv=none; d=google.com; s=arc-20160816; b=exWU2pbF5RDh+ybXQ28jr0+yYOSkDEhAY8qNTSVVyFOjEaScrHLUBEeVCZZ9lklu7D VKZg7ep6y0MFiljlenNJO/u5JwwvCESZExU0ik91Cv0g9NfY1EWI+BBUHzM0CJyXqAcY EPWu7qx8jQqnJ2bIhL0TPd1U4Ky462MB2qc08JQoA+8ftiH0kVYeO7KBWPiKa/kPh+uU 92bj28NaO0nT74ObgaJX516if/dMtOcdv1TDAxVKpm+zLbpoaEOgIkdRRHA71PaV9r23 dVMCD5sjmJ2FeSxDT093HVHfRONiW/RrBPT8od5GNFhh/+cV4ooYt05GNC3Urx5ZHBkp +EpA== 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=IPFohQpQybizUNQk5tLGKnMzQ3Bj0jga5Db3A0DSVPU=; b=lp37BBRm4w87Yyj51+AxNcRtAgYceSeXPvzY4tG4XlboYyBrie4eCfQ/SLuo9fdMlr VRLWy7bB/BRDpMV3WVFUdhWrKAt2ePch6bWVoNhloWQ1NT3hB+jMOA0FhfnN9s8nPJQq oSF5NsjKebHW72N/OquqVN0401n6sr6KGpjsTLH8m3AYqUn1C+taeQf6qez3Ea61Hw8H zp9KPHIq/VMJLGi3r9kDN0bX0L8DfUSKkg4vvpStM69KFG3EigneQ5a/Hd6KlRJeGTsj wGhLucvrdAxI2bhHCaIrh2SzvdtB3xtkG5QAT/Sjjt36R6k+mMSzlNn0wJe3Llkt1HOK YBVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FsoSAPEq; 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 c3-20020a056a00248300b00535fa14ffaasi10897872pfv.116.2022.10.31.13.10.30; Mon, 31 Oct 2022 13:10:43 -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=FsoSAPEq; 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 S229927AbiJaT1e (ORCPT + 98 others); Mon, 31 Oct 2022 15:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbiJaT1c (ORCPT ); Mon, 31 Oct 2022 15:27:32 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD1713D55 for ; Mon, 31 Oct 2022 12:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667244450; x=1698780450; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=2fHYGkaRNoWB3mK+jOd2soSQVYRDZfMfl4sULJdOohU=; b=FsoSAPEqcy2kxhyhugyeElGs1l9wvY8tjC8iga+x8IdcG64M6DEs6g5L todp9ezz9B9PZfNs6Y4SQy0Ab/7l4+xArmEEFBKqK+oWJZFFg3KI66R7v zEP/9z8XiLxoMHpUe2LGmnusKutwNekGw5Jzvsm4Hn+TEf/3RQcrVic4O 34a7CQde64+jTooExv8eIRPp8ed6kRWHwB9Mmvjjc+g/hyjLEWz9fygzn ZF6t0sWlH8D8+/dwLBZePldJROZjelWh3fgzFMuNO9JDdtVRsmMe8Nw0x DMr7fecXo3Klc/9TxQhwXMk5WZIMylwWwPAi5qRXbe7uJ4/nLNLNVRb59 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="395296028" X-IronPort-AV: E=Sophos;i="5.95,228,1661842800"; d="scan'208";a="395296028" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 12:27:29 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="722920836" X-IronPort-AV: E=Sophos;i="5.95,228,1661842800"; d="scan'208";a="722920836" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.155.138]) ([10.212.155.138]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 12:27:28 -0700 Message-ID: <8887d182-a3e3-f62a-8b8f-36db1da75b19@linux.intel.com> Date: Mon, 31 Oct 2022 12:27:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 1/2] x86/tdx: Extract GET_INFO call from get_cc_mask() Content-Language: en-US To: "Kirill A. Shutemov" , Dave Hansen Cc: "Kirill A. Shutemov" , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, luto@kernel.org, peterz@infradead.org, sathyanarayanan.kuppuswamy@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, seanjc@google.com, thomas.lendacky@amd.com, elena.reshetova@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org References: <20221028141220.29217-1-kirill.shutemov@linux.intel.com> <20221028141220.29217-2-kirill.shutemov@linux.intel.com> <20221028235951.p2vdu7drbbf3ccg7@box.shutemov.name> <20221031041252.mdcjocqn6k4k4gvy@box.shutemov.name> From: Andi Kleen In-Reply-To: <20221031041252.mdcjocqn6k4k4gvy@box.shutemov.name> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 sted-by's would be appreciated. > One thing that I must bring up is that it seems that there's no way to get > the panic message to user. I tried to convinced myself that it is qemu > misconfiguration on my part or some race, but no: it is just too early for > earlyprintk. > > We only get earlyprintk working after parse_early_options() which happens > well after tdx_early_init(). > > Moving panic() after earlyprintk working is not good idea as it exposes > kernel more: by the time we already have full #VE handler. It should be fine to move since there is no user land at this point (the attack requires user land) > > We can move it earlier into decompresser which has different earlyprintk > implementation. Not sure if it worth this. What do you think? That would make uncompressed kernels unsafe. -Andi