Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2CEBC433EF for ; Thu, 28 Apr 2022 16:34:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E8CA8D0009; Thu, 28 Apr 2022 12:34:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 397A88D0005; Thu, 28 Apr 2022 12:34:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C4158D0009; Thu, 28 Apr 2022 12:34:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 0335C8D0005 for ; Thu, 28 Apr 2022 12:34:19 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CD86322686 for ; Thu, 28 Apr 2022 16:34:18 +0000 (UTC) X-FDA: 79406835396.01.7701FE4 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by imf08.hostedemail.com (Postfix) with ESMTP id 811DF160057 for ; Thu, 28 Apr 2022 16:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651163657; x=1682699657; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=aZxSueDFbZ6Rlo4jQ5sj29X9jCBqwOFqqmfn9TEhgzc=; b=CGFD841b5vDXUt7QapAiOOuha3bRCAqVrs2pIQbi2D32kI7BKOnvX2Qs PWJ3+3kjdwl2Ir/zi+vZl6i/XQ7+C5dd0+FUTPSfvdErvPkHFnVyDS/P8 5/aFfEkt5Wgo9jqH+D4mfSW8QXQL1HV3Iz9rSBd//JC3acLtiN+BIdx9R iMSJ7IGjfYYEe+fHEsl2E66hiQOpMMWv+E11VfCpq/W2iGqXkedljHgCq 4Ay5JoVhFJABMd7uaX0iQ/29vQs3nj/3JgRc5kckrZ5kmqsLb3tPRlbmI 4LWFZjGcfHRkfuEL2EPVrfmbQl4F4nm+4ps8RjT5S74I7a4QYA4xEqukQ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="246261439" X-IronPort-AV: E=Sophos;i="5.91,295,1647327600"; d="scan'208";a="246261439" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 09:33:52 -0700 X-IronPort-AV: E=Sophos;i="5.91,295,1647327600"; d="scan'208";a="559760259" Received: from mpoursae-mobl2.amr.corp.intel.com (HELO [10.212.0.84]) ([10.212.0.84]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2022 09:33:51 -0700 Message-ID: <6f99684f-172c-ccf2-0be3-9aca85451079@intel.com> Date: Thu, 28 Apr 2022 09:34:07 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC] Expose a memory poison detector ioctl to user space. Content-Language: en-US To: Erdem Aktas Cc: almasrymina@google.com, dave.hansen@linux.intel.com, gthelen@google.com, jiaqiyan@google.com, juew@google.com, linux-mm@kvack.org, naoya.horiguchi@nec.com, seanjc@google.com, tony.luck@intel.com References: <20220428161551.722296-1-erdemaktas@google.com> From: Dave Hansen In-Reply-To: <20220428161551.722296-1-erdemaktas@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 811DF160057 X-Stat-Signature: 7b1fs161a13g6ynw1ghwhahr6o3q4kzd X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=CGFD841b; spf=none (imf08.hostedemail.com: domain of dave.hansen@intel.com has no SPF policy when checking 192.55.52.136) smtp.mailfrom=dave.hansen@intel.com; dmarc=pass (policy=none) header.from=intel.com X-HE-Tag: 1651163650-372254 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/28/22 09:15, Erdem Aktas wrote: >> On 4/26/22 12:23, Jue Wang wrote: >>> On Tue, Apr 26, 2022 at 11:18 AM Dave Hansen wrote: >> I shouldn't speak for Intel as a whole, but I'll give you my personal >> perspective. >> >> Right now, hosts can't scan TDX private memory, period. If you wanted >> to do scanning, the guest has to do it or you have to kill the guest and >> make the memory non-private. > > Actually, afaiu, the host can read tdx private memory. This should NOT generate > #MC due to integrity/TD ownership but return a fixed value of "0"s. I do not > know if this will also trigger #MCs due to memory errors. I think you're right, at least in the normal case where the access is performed with the TME KeyID. "An introductory overview of the Intel TDX technology"[1] says: > The TD-bit associated with the line in memory seeks to > detect software or devices attempting to read memory > encrypted with private KeyID, using a shared KeyID, to reveal > the ciphertext. On such accesses, the MKTME returns a fixed > pattern to prevent ciphertext analysis. I guess, in practice, the read would need to go all the way out to the memory controller to get the TD-bit. But, it's definitely not well-defined in the spec. 1. https://www.intel.com/content/www/us/en/developer/articles/technical/intel-trust-domain-extensions.html