Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2546783rwd; Fri, 2 Jun 2023 10:53:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mzr01D1gz4ulGxyNTQtCXr3Lr/hE+l0odhQMA+ymstW4snKVhrL6Z2NcLHjCJH0aYhURu X-Received: by 2002:a17:902:dad2:b0:1af:c602:cd52 with SMTP id q18-20020a170902dad200b001afc602cd52mr536846plx.67.1685728395673; Fri, 02 Jun 2023 10:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685728395; cv=none; d=google.com; s=arc-20160816; b=OZ/RazthKTXnL6eACVLiL6ChQIioXyrD/OXbkEOEblSlm2P3thQHeBQt4Y0wyyS/FC +0RRqtxOnuMCDQK4R07P0QrRGX7qfMfIRKj3i5mpZDSdMPNiDPi4OPzux4Jc9pJgWHSE yfPBAGaM1tEHxuCVYMDdl0LIqSUhBCgOLhNKmHlGROLNVPMFfr2q6lrQzCRiPvBYeg1m jzDzPW8Js5K9N35EM/lcCSCn6ke7MwD/APve9vAQmupAB2hEnroVE7SekNiaSvsbgaQG Bzb993FnWWnYso9LbM0TIdMXQwUrmsuKNLBWDIpN+riLP88WBze6dtFmCB45+QsjcX4/ Y7rA== 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=bSfIWPZtfNoQC3OInCWHQCVq9vFgo67jc0R4h/+H9RY=; b=OqH9HbbpNpJe/m8KZxNMbvpSSJm3KmaN10ac3fLGtIJvWrIxcYc3MC1JnMgm6SFsxL E4e398V8qMfkK2XIer9fhcf0NGS/ffNyrxCxrD0rLnmyNi8lG514Jz0LXOswrfGpAkW4 kIuVKUiT+XR5bvgPIOr9lYSZV9DTelgeyGyMAGbXWMK8RYvvQJrMzgahLJZePUtpOa2H 12ob9KYPRDnk6pK4qb+Bz9kN3Kr1KGfUPWtSuPHxbqTaRmeWqvMFOiMhF1nqHDW7Vo/M RjMBv4pflPEgNIYBg7hoTwwebZtAEGPE/hXq0K8neJXAfSyanUUSrjmU9BPCvmhbA17v nlOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hWUr5qDO; 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 n17-20020a170903111100b001b053ea9bc0si1202746plh.469.2023.06.02.10.53.03; Fri, 02 Jun 2023 10:53:15 -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=hWUr5qDO; 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 S236875AbjFBRmg (ORCPT + 99 others); Fri, 2 Jun 2023 13:42:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235274AbjFBRmf (ORCPT ); Fri, 2 Jun 2023 13:42:35 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD502133; Fri, 2 Jun 2023 10:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685727754; x=1717263754; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=pKlkspNOzWL1+VLdgFmqTg/cLWhdIZxOrJGpOZ10YD0=; b=hWUr5qDOkbD3nEl3i/8qitoQI4jdHYAOqZv4dx2hYsFNZ4VDBgULKYUx sCIFk6Y0R1ZHvOOgqnUYXL9BcVMNIV7YEfgLSfjw0Hx6Lkn5inbB1fsK5 HMOYovmlQt5PkifP8zBZPVGAOtELkPNrA7c0UACa+65l+eWeI/R77EdPb NnRVjyyymylz1oPhoV3gYeRpfowEE+H4cd6QCrqtwbUj8qw9zc8mlLKXR NONxT8kA68TCTnEKOpLdOFeHk5D5HntUgJqmCayuNTIbxXOjlo2DTZOYC DzCDM4aPaFvaj+DAvUPA15O+poF5TMkOgFIuG18H418zAn/7L+KzGmj6I w==; X-IronPort-AV: E=McAfee;i="6600,9927,10729"; a="336289400" X-IronPort-AV: E=Sophos;i="6.00,213,1681196400"; d="scan'208";a="336289400" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2023 10:42:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10729"; a="702030729" X-IronPort-AV: E=Sophos;i="6.00,213,1681196400"; d="scan'208";a="702030729" Received: from pingshi-mobl.amr.corp.intel.com (HELO [10.251.23.169]) ([10.251.23.169]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2023 10:42:34 -0700 Message-ID: Date: Fri, 2 Jun 2023 10:42:33 -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: [PATCHv2 2/3] x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad() Content-Language: en-US To: "Michael Kelley (LINUX)" , Tom Lendacky , Sathyanarayanan Kuppuswamy , "Kirill A. Shutemov" Cc: "Kirill A. Shutemov" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , Dexuan Cui , "rick.p.edgecombe@intel.com" , "seanjc@google.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" References: <20230526120225.31936-1-kirill.shutemov@linux.intel.com> <20230526120225.31936-3-kirill.shutemov@linux.intel.com> <19d9977f-bf07-2948-1b45-456af9c09e2f@linux.intel.com> <20230530005736.ndwza2i5n7wrki5h@box.shutemov.name> <9d679d3f-8db9-80ef-292a-9ca5b860579b@amd.com> <2d8ae093-dd9e-ea49-d6f9-3fdb2fb84e4d@linux.intel.com> <9fbc3760-7239-2323-ed90-210a0de9e286@amd.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 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, URIBL_BLOCKED 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 09:11, Michael Kelley (LINUX) wrote: > Tom -- Does the above sequence *depend* on the hypervisor doing anything > to make it work? I'm not clear on why KVM would automatically change the > page over to private. If there's a dependency on the hypervisor doing > something, then it seems like we'll need to standardize that "something" > across hypervisors, lest we end up with per-hypervisor code in Linux to handle > this scenario. And running SEV-SNP with multiple VMPLs probably makes it > even more complicated. > > Kirill -- Same question about TDX. Does making load_unaligned_zeropad() > work in a TDX VM depend on the hypervisor doing anything? Or is the > behavior seen by the guest dependent only on architected behavior of > the TDX processor? No, there's no active help from the hypervisor here. Also, fwiw, the "architected behavior" here is really just the TDX module policy and _arguably_ the hardware Secure-EPT controlled by the TDX module.