Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp945847rdb; Fri, 2 Feb 2024 08:38:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwcIsWxRMcmXKu/+0jWgC6FsJOZ3SWDXHaJqNKOhIDfUV+EwEnfzto0WCLi2hAfLKPZpNn X-Received: by 2002:a17:903:24c:b0:1d9:6cb4:3330 with SMTP id j12-20020a170903024c00b001d96cb43330mr3137328plh.12.1706891880641; Fri, 02 Feb 2024 08:38:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706891880; cv=pass; d=google.com; s=arc-20160816; b=CPX09d38jZCEaFsoYAcdKnHnKNB64Uk2DJGZA6dZmrDtLA6XNNPP76pdForxImX13d mZBK6WfQjnDw3ie1heOu4wrrLQHqS0dvF7breOCR0bDQTWYLIVtl97TSlcOS+7IsDRzM VyIglLnK319T5Y2E7zDNwJ6PA82Rp4tjtvgKe80JNjLwKoDG0QJiH1vE0VFxryMaUF7f hHywz5HgrVfvN4A+idB7vxvtd8pZC3VHMK2JHgmOm3tP9BkUrh9DQm+HAPbmncS0ZHEO 9rFynsI7UtNNekmFxS+Q7klb7zaULCl37/NUyvEXLIf/3jKT/FoznElXMQghruSftqN7 2zmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=4t0HQqK1W2lyEMSR4krAH7UGv3OtxGrGaoYqpOZE2ro=; fh=qpoAqMcRex+45vMDbAjdUa6BNmf8sIF9JAg/6JjPjdQ=; b=fCohw0OZyH/lr5Oshh6EmilHCs4f1Jp++e7mUeXQnHXjnOtShp8EPdriq32BCysAyc 5USe9QDLXlBN96AssfmmbmvBSqC/3Bqo9MUQ/sdMwARQK8Fbb16H9c7q1WDGyT4OKyv8 OSHFv3/IZLWE4+uWGhQmEcQ6O+g/UCMfYNSE9kAr4HRLV3FSbwgl17YaAhEu0PPUlzYk CKxq1R6WRr64wvi2RdMRDPlnznxbaOTd1dZWMGgpxEFooDLuxBHKi+wCw5jWtQdg7ZFF mCsMqIj2zrBaTSqOPr1FXQ8nOQDPqvsW7X7MRivp5ZV6Jk5O4bAYAOKGw/hKAtq5JkLa KNAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i5Qiz51h; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-50153-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCUNhA0k/MeCvrZ1ueaa8F2ILiqIfKu8km8jcrLqiaNpqgIatESm/lUzOKsu0jplKiwCDmOXHpv/w36DNj5wkcsDzLqMkwWuydfTO/8muw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u7-20020a17090282c700b001d015cec684si1913936plz.238.2024.02.02.08.38.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:38:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50153-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=i5Qiz51h; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-50153-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B615E281705 for ; Fri, 2 Feb 2024 16:37:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA44C14901F; Fri, 2 Feb 2024 16:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="i5Qiz51h" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3702F1487D0 for ; Fri, 2 Feb 2024 16:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891761; cv=none; b=CPz+NE80w26USwR2fpjcAoQZ3GuloGzuR3kxDsFGv82LeRGCxGNhqmwb+7iKxy86spPXSwAUtMVd2BdPcJLvd2KA47KRkrVeNoAozzc6m8hWy8yKx5pj9yJ1ynyEpdajY17G7W2i80KWpN/FpKQsyw0GBl5JpZ7AEpXPYHsPE3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706891761; c=relaxed/simple; bh=NvkwA1jk/5kaJF3W/uYQ89LSQ+kOKTgXko1D4t7m/78=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nMWRpIoEdcbxTogsLfBiDmk0z4X2GNfkzVaWHZvK1GKyfUQiAzlK9MZDBUM5J/3x4111TvqS2PvuSjc+Rf50Jr0X+usjnauRcQte11wKNiGDXcKFWMO+uoQPJ9pWwxH/wZzFeN5fDN3GlE/ZEQXz8lcfos3lqh5DHpCPBk7u0jo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=i5Qiz51h; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706891760; x=1738427760; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=NvkwA1jk/5kaJF3W/uYQ89LSQ+kOKTgXko1D4t7m/78=; b=i5Qiz51hD4MikrTOzHTwgScjko3N3kPLIPl5AgxhG2BxbvMEi3uNUz5P bpQ048ZLKB2typmYxwACKjD5Nc/jGLffAqJr6PuK19ntq09ViCY++iAjT 5oyPWN4vnlQn0OgBQh31BamxBr8JTurW7m4lxqPj4gBjJHBi/fHoORFDF ixgx8iBvTitzb2VW21xfSJWySu3i/iwGOZbL1bqL6YSdBWE+LF6OEK23h 68AjWkC5XCIHhIcJ3MOGR3tEPu22nD5xZwecQ1bM97ltbIHFuJBfLmEie I9fh5zwipaKap8cP8jXHN51SFnmR43EPLvUIylyGUvekMqRytlZIkM6Vc A==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="22673852" X-IronPort-AV: E=Sophos;i="6.05,238,1701158400"; d="scan'208";a="22673852" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 08:35:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,238,1701158400"; d="scan'208";a="4715525" Received: from adcimmar-mobl.amr.corp.intel.com (HELO [10.212.206.109]) ([10.212.206.109]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 08:35:59 -0800 Message-ID: <746d2448-3adc-467b-a39c-5585f33bd740@intel.com> Date: Fri, 2 Feb 2024 08:35:58 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC V1 5/5] x86: CVMs: Ensure that memory conversions happen at 2M alignment Content-Language: en-US To: Vishal Annapurve , Jeremi Piotrowski Cc: x86@kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, rientjes@google.com, seanjc@google.com, erdemaktas@google.com, ackerleytng@google.com, jxgao@google.com, sagis@google.com, oupton@google.com, peterx@redhat.com, vkuznets@redhat.com, dmatlack@google.com, pgonda@google.com, michael.roth@amd.com, kirill@shutemov.name, thomas.lendacky@amd.com, dave.hansen@linux.intel.com, linux-coco@lists.linux.dev, chao.p.peng@linux.intel.com, isaku.yamahata@gmail.com, andrew.jones@linux.dev, corbet@lwn.net, hch@lst.de, m.szyprowski@samsung.com, rostedt@goodmis.org, iommu@lists.linux.dev References: <20240112055251.36101-1-vannapurve@google.com> <20240112055251.36101-6-vannapurve@google.com> <6709a57c-48a0-4ddd-b64e-a1e34ae2b763@intel.com> <1d9d3372-825a-417a-8811-ffa501c83936@linux.microsoft.com> <3313c886-e964-48c3-8277-b47cb1955de9@linux.microsoft.com> From: Dave Hansen Autocrypt: addr=dave.hansen@intel.com; keydata= xsFNBE6HMP0BEADIMA3XYkQfF3dwHlj58Yjsc4E5y5G67cfbt8dvaUq2fx1lR0K9h1bOI6fC oAiUXvGAOxPDsB/P6UEOISPpLl5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j1YZUql+ZkptgGjikQARAQABwsFfBBgBAgAJBQJUY85qAhsMAAoJEGg1lTBwyZKw l4IQAIKHs/9po4spZDFyfDjunimEhVHqlUt7ggR1Hsl/tkvTSze8pI1P6dGp2XW6AnH1iayn yRcoyT0ZJ+Zmm4xAH1zqKjWplzqdb/dO28qk0bPso8+1oPO8oDhLm1+tY+cOvufXkBTm+whm +AyNTjaCRt6aSMnA/QHVGSJ8grrTJCoACVNhnXg/R0g90g8iV8Q+IBZyDkG0tBThaDdw1B2l asInUTeb9EiVfL/Zjdg5VWiF9LL7iS+9hTeVdR09vThQ/DhVbCNxVk+DtyBHsjOKifrVsYep WpRGBIAu3bK8eXtyvrw1igWTNs2wazJ71+0z2jMzbclKAyRHKU9JdN6Hkkgr2nPb561yjcB8 sIq1pFXKyO+nKy6SZYxOvHxCcjk2fkw6UmPU6/j/nQlj2lfOAgNVKuDLothIxzi8pndB8Jju KktE5HJqUUMXePkAYIxEQ0mMc8Po7tuXdejgPMwgP7x65xtfEqI0RuzbUioFltsp1jUaRwQZ MTsCeQDdjpgHsj+P2ZDeEKCbma4m6Ez/YWs4+zDm1X8uZDkZcfQlD9NldbKDJEXLIjYWo1PH hYepSffIWPyvBMBTW2W5FRjJ4vLRrJSUoEfJuPQ3vW9Y73foyo/qFoURHO48AinGPZ7PC7TF vUaNOTjKedrqHkaOcqB185ahG2had0xnFsDPlx5y In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/2/24 08:22, Vishal Annapurve wrote: >> If you must - focus on getting swiotlb conversions to happen at the desired >> granularity but don't try to force every single conversion to be >4K. > If any conversion within a guest happens at 4K granularity, then this > will effectively cause non-hugepage aligned EPT/NPT entries. This > series is trying to get all private and shared memory regions to be > hugepage aligned to address the problem statement. Yeah, but the series is trying to do that by being awfully myopic at this stage and without being _declared_ to be so myopic. Take a look at all of the set_memory_decrypted() calls. How many of them even operate on the part of the guest address space rooted in the memfd where splits matter? They're not doing conversions. They're just setting up shared mappings in the page tables of gunk that was never private in the first place.