Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5151596rwb; Mon, 21 Nov 2022 17:42:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf7I50kqAWqpCYls+gy8NA5tkFP0rb1vG+h3tcUIPNDAHYxwHpqn2UiSLvJ1ntWO9PCi8NXP X-Received: by 2002:a17:90a:ac07:b0:213:c7ce:ea6f with SMTP id o7-20020a17090aac0700b00213c7ceea6fmr23530634pjq.27.1669081320768; Mon, 21 Nov 2022 17:42:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669081320; cv=none; d=google.com; s=arc-20160816; b=YGlk5o4jIaUbxiSN0G5034rOykO3DCi8ASHclxCjGhqaRbys8RitnBfmkY6R6YoAhd K7gU+W8jVRu4y51aDlLMW2v0wxv/S07VdMlKT5tBMgjeuqb8fyuVAt6yxEh5aj3ySh+4 N0rfWPdA1zufuZjuZjDV30jDtSm2kv7+gPw/KUN5Q/vtlemGQJTFPpnR5VdodBKFPLIx //P0AYDrh/0eiO2tHYV6cVW0LrPKHyCIuT1mcXQ+ZpF0MdQr6DwP79ExXm//48gxIO5L 0oBsBjGZCuRvfPqReE8AwOJxpLS1uS++3NrL6pb0peaqSPbZ/G/g2hvtrO777bbp/85U I9GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=Je9S5pZ8EyiMqK1xbe6/5zr4qNlvKvr93DChjxiAVt4=; b=VD5Jt6h5NnR2WsGRIW2v7F7zyZ1NYs1ch16os46xiViNlJZqSA7nz4u0vVbxuuFf6O CctqGHgRX+OAmOKiUt09gCkZJET73Me/fZSp4R4jiEpcm1NXn3PInv/G6ui055vHpzeP W/P1CJb8Tk510pjJDnqFJVUKGQTJ8N+l2+ea437lxX2h7P+al6i4oef82wylfPOpFbB7 OgWDQBr+dQ2AJ06SWWNnJB92l8nodVcMaO1oExTJM+cs1/8+JdDZ8x+Hj4M6oGTXRF6d a6QSWFr06crmy4FgGkXGC8L+oiujzOhoGw6ZJJIeNDAAc7tJ/HH5ajgLD/ohZ919DTO6 nIoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm2 header.b=PrgW4w+9; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bCORFpPv; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 2-20020a630b02000000b0047763363ebfsi5737509pgl.824.2022.11.21.17.41.49; Mon, 21 Nov 2022 17:42:00 -0800 (PST) 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=@shutemov.name header.s=fm2 header.b=PrgW4w+9; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bCORFpPv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231466AbiKVAYa (ORCPT + 91 others); Mon, 21 Nov 2022 19:24:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiKVAY1 (ORCPT ); Mon, 21 Nov 2022 19:24:27 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87092BEB42; Mon, 21 Nov 2022 16:24:26 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5100032009B5; Mon, 21 Nov 2022 19:24:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 21 Nov 2022 19:24:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669076663; x=1669163063; bh=Je 9S5pZ8EyiMqK1xbe6/5zr4qNlvKvr93DChjxiAVt4=; b=PrgW4w+9T36uTagTcG DjuC/DKB/qod8O6Ab5ag9KRtZ6RQtKP/iuauByNe51gZ28Im2l2Sgx4MtQr4W0QU 6c9JYOMzl1zQA0hT8J6sNApeVInfSRACqKgpxF6nNmexDm3R9CtLlcfUYmkuku2+ 62iXPO01NV17lZiO68Lv7t9KpXe+/jOoKhdC/0ce/1HgMlbF+II7pBfYi19XlZLb S+gotbNeB6q38ZT1E3+gVD39RpJeuQkbSfnw5JIYXlbZpinnFrhd74zAasVFqF/O w6gnVR2bwl0W+ReRnd8v+p4ylyIp+ZUl6M4VWSH3Z+n3IJM3NacgoGgI9h5gY635 OR9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669076663; x=1669163063; bh=Je9S5pZ8EyiMqK1xbe6/5zr4qNlv Kvr93DChjxiAVt4=; b=bCORFpPvnGwyahVwCiYhm+8wPJG9H/WawgxDZU6Uf9qQ KfL+5SLRXQ9emqLalBhYvrVbKiHv6Fhf3rg4IzE2RTL2yHWw8oDh+7bLA5aC8TAf OTwTUqReBTozxETh7x4jHlIAbPYhfRQ3b2/4OzNFQyTiTL40kGYf1rgK7NInN3SZ 5c1C5Y89Rc/ZiDgat75rMWctdksayTEeMsVYCbPrJsEt8k1MtOSJCoAXYTJBRXLs WtFwlSo8gvMAY2fOU16DA1jxe8KuKntX5gzdHC4yeoSUMv72C2xIKvUkZ8892KHz RQYD9LDAMkVggVOmy0ckCTU5n+0EyHkTr89cBz0eyg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrheejgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttddttddttddvnecuhfhrohhmpedfmfhirhhi lhhlucetrdcuufhhuhhtvghmohhvfdcuoehkihhrihhllhesshhhuhhtvghmohhvrdhnrg hmvgeqnecuggftrfgrthhtvghrnhephfeigefhtdefhedtfedthefghedutddvueehtedt tdehjeeukeejgeeuiedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepkhhirhhilhhlsehshhhuthgvmhhovhdrnhgrmhgv X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Nov 2022 19:24:23 -0500 (EST) Received: by box.shutemov.name (Postfix, from userid 1000) id A7279109A30; Tue, 22 Nov 2022 03:24:21 +0300 (+03) Date: Tue, 22 Nov 2022 03:24:21 +0300 From: "Kirill A. Shutemov" To: Dexuan Cui Cc: 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, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] x86/tdx: Support vmalloc() for tdx_enc_status_changed() Message-ID: <20221122002421.qg4h47cjoc2birvb@box.shutemov.name> References: <20221121195151.21812-1-decui@microsoft.com> <20221121195151.21812-4-decui@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221121195151.21812-4-decui@microsoft.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS 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 Mon, Nov 21, 2022 at 11:51:48AM -0800, 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. Why do you use vmalloc here in the first place? Will you also adjust direct mapping to have shared bit set? If not, we will have problems with load_unaligned_zeropad() when it will access shared pages via non-shared mapping. If direct mapping is adjusted, we will get direct mapping fragmentation. Maybe tap into swiotlb buffer using DMA API? -- Kiryl Shutsemau / Kirill A. Shutemov