Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4866402rwd; Tue, 23 May 2023 13:55:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kVHaxKJKQZiL4HMbjnRu+7wTAnxEGOn6rzgpa1Em7ii6dy+cpF8+yceyJiA0t0S6SUOkS X-Received: by 2002:a05:6a20:4282:b0:10c:6:61d1 with SMTP id o2-20020a056a20428200b0010c000661d1mr6980854pzj.39.1684875349699; Tue, 23 May 2023 13:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684875349; cv=none; d=google.com; s=arc-20160816; b=a+fzoGJZCdGL+SlNkFx/VyUaGEjg7TgbYM2+8L4XPktUFWT4J64Kf2uOS9YYe2xKxY cVAuHyub7+84R1L+ZUCJRpkcO+ibtrMLteLrNUhSO0cu+4UQN5mCVd+k3YseFVJbaZsy uwO5U5rhBfasi/b5KLPoYz2tsuX54PMouAO+n+J19RD2TRK2ebTc4nfQ2o8RpF0AoHPo 2Tb3goIc4RbHKu7G5YxViRL4+yJuBsHr5IYX1dUJqIYFfx1johNhFeeXh2sHb0RNrLH9 JtEeIFNXeBsxKF/2/rM46QfhHf+W7IAX9AJjxecp/96QBn/wtL4NLR/EEMicjzzjoYKb 1x4g== 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=/H2Ruej76rtLLjHU/kI8p/zrCC+UonvS4FjgB9lSmBU=; b=B04fiD1Qdxc8OY0Y6UH0W/GrGQ/+UXeEJ/p6VNj4M9V/LNmHTxuc/yvkg5qTV++zWO ueA0EkEj6qu+HV0ENOSbRrqUckNnnIm8KAYXKLc/2u+bauZ3wdGebU9AAb7MEStbxAJM jvAoDF+wbYmoFoKZv0VaGMzx8cW5YfH04kaeAKABhVDrWx7dEj6lQ2AuXx/+qm1v1Jk9 6HJdDDFcV1Du9F6TNyUdlaPC0Nr34aXg0R8RLSK/3BNwZI0aDfsLLYaLuxCE5DNoFRwM ST9j4NAOaUoa6ryjMJsczDt5WPEZ2f9ifkW8r96GPM6LRF6UIAHO9+K0xy6K401b6ObU 8mqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kem5xjOu; 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 g28-20020a63375c000000b0053b62724848si398398pgn.679.2023.05.23.13.55.35; Tue, 23 May 2023 13:55:49 -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=kem5xjOu; 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 S238454AbjEWUjQ (ORCPT + 99 others); Tue, 23 May 2023 16:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238388AbjEWUjP (ORCPT ); Tue, 23 May 2023 16:39:15 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE5A6FA; Tue, 23 May 2023 13:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684874354; x=1716410354; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=OWSHPRO5HnlWet7EfvINZiwK0k+1sxDkGfdhBdgkUzI=; b=kem5xjOuEtFfSDh1iiXybWq2WZoHYKp+mWUDroCbAKm9CnAd5MKpfL5V X7UeViHgG/xHbGXb3F25DL3oD3rxGORwMTm0VSumYrTetPvAhZ46aO80E 52k3ZUEgsS3pDmtdSHrk5t0eVY2M3wXJY/pTNJ+gSPRQM4GhC8ralXkfw Ag/knK6HQJ+pqMHFCflVfVVrPzaotN/9eQ2Ay0DXY9d+8/8qKWvrRkTgh KKvG1V9sWVSkI4Rud5sTuGZ0c2cliHTI1MYCiazlyVHZ6QiSvSVWux9OP 37bwpA5mOf5/nIpsjoyTtyhVVz1i9ISgd496jGGlujghArhNIxhlLykjD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="419068151" X-IronPort-AV: E=Sophos;i="6.00,187,1681196400"; d="scan'208";a="419068151" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 13:39:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="793868392" X-IronPort-AV: E=Sophos;i="6.00,187,1681196400"; d="scan'208";a="793868392" Received: from kroconn-mobl2.amr.corp.intel.com (HELO [10.251.1.84]) ([10.251.1.84]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 13:39:11 -0700 Message-ID: <9e466079-ff27-f928-b470-eb5ef157f048@intel.com> Date: Tue, 23 May 2023 13:39:11 -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: [PATCH v6 2/6] x86/tdx: Support vmalloc() for tdx_enc_status_changed() Content-Language: en-US To: Dexuan Cui , ak@linux.intel.com, arnd@arndb.de, bp@alien8.de, brijesh.singh@amd.com, dan.j.williams@intel.com, dave.hansen@linux.intel.com, haiyangz@microsoft.com, hpa@zytor.com, jane.chu@oracle.com, kirill.shutemov@linux.intel.com, kys@microsoft.com, linux-arch@vger.kernel.org, linux-hyperv@vger.kernel.org, luto@kernel.org, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org, sathyanarayanan.kuppuswamy@linux.intel.com, seanjc@google.com, tglx@linutronix.de, tony.luck@intel.com, wei.liu@kernel.org, x86@kernel.org, mikelley@microsoft.com Cc: linux-kernel@vger.kernel.org, Tianyu.Lan@microsoft.com References: <20230504225351.10765-1-decui@microsoft.com> <20230504225351.10765-3-decui@microsoft.com> From: Dave Hansen In-Reply-To: <20230504225351.10765-3-decui@microsoft.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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, 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 5/4/23 15:53, Dexuan Cui wrote: > When a TDX guest runs on Hyper-V, the hv_netvsc driver's netvsc_init_buf() > allocates buffers using vzalloc(), and needs to share the buffers with the > host OS by calling set_memory_decrypted(), which is not working for > vmalloc() yet. Add the support by handling the pages one by one. I think this sets a bad precedent. There are consequences for converting pages between shared and private. Doing it on a vmalloc() mapping is guaranteed to fracture the underlying EPT/SEPT mappings. How does this work with load_unaligned_zeropad()? Couldn't it be running around poking at one of these vmalloc()'d pages via the direct map during a shared->private conversion before the page has been accepted?