From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1DACC19F2B for ; Wed, 3 Aug 2022 21:48:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237884AbiHCVsq (ORCPT ); Wed, 3 Aug 2022 17:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231407AbiHCVsi (ORCPT ); Wed, 3 Aug 2022 17:48:38 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14EA319008 for ; Wed, 3 Aug 2022 14:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659563317; x=1691099317; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=OszUSZaeTwre2lg3VQaRr0MRLW8RAU4JNI+oAxhiK9I=; b=Ja1YOJy7hF9EFCAV9v0jbZvZSvH8uMG2+7fcBGGe9z+XBZygsPyjQBR1 bb074Rj51vDmxMWv1lfejADaDD1JOgFU2gKOFocCcO3O0Ph5XNJphj3Vo Nlx82WIWU1Cm3akplXeSALgtgsT04WD23PG2TmCLyp7Y1GD36DEcEV4fs UR5X3M0KAr3wPOm3Fll1Iu8nCYOwoibwRMDaJaT8Zbb90cZ5FJXG9/WQk z2LIvOcG4pxPALO6rSAB9EJNYVrd+RfQW+bZSFFkizBkmNqsERoKdDzwH 3zIq4GfmPclm3g3Zzc3e5OWSbTJkoMvWUynxEhqz077z9EdWGNQXn6Sz1 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10428"; a="351497938" X-IronPort-AV: E=Sophos;i="5.93,214,1654585200"; d="scan'208";a="351497938" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2022 14:48:36 -0700 X-IronPort-AV: E=Sophos;i="5.93,214,1654585200"; d="scan'208";a="606530320" Received: from bliviero-mobl.amr.corp.intel.com (HELO [10.209.58.137]) ([10.209.58.137]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2022 14:48:35 -0700 Message-ID: <6b492245-f25b-1019-0728-7c77a54a7540@intel.com> Date: Wed, 3 Aug 2022 14:48:35 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1.1 1/2] x86/sev: Use per-CPU PSC structure in prep for unaccepted memory support Content-Language: en-US To: Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "Kirill A. Shutemov" , "H. Peter Anvin" , Michael Roth , Joerg Roedel , Andy Lutomirski , Peter Zijlstra , "Shutemov, Kirill" , "Huang, Kai" References: <1b50311c-448b-96aa-1d96-f4bfed409c1f@amd.com> <2a2adc3570ae9c24d03fff877c4fe79ed43605e0.1659550264.git.thomas.lendacky@amd.com> <9f47ed0f-99cc-a237-f09b-45291feffcd3@amd.com> <0eccea46-648d-ff70-dcc6-fdca88ff1234@amd.com> <3cf239c8-ccc4-d112-fb42-605661816cf0@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/22 14:34, Tom Lendacky wrote: >> Also, private<->shared page conversions are *NOT* common from what I can >> tell.  There are a few pages converted at boot, but most host the >> guest<->host communications are through the swiotlb pages which are >> static. > > Generally, that's true. But, e.g., a dma_alloc_coherent() actually > doesn't go through SWIOTLB, but instead allocates the pages and makes > them shared, which results in a page state change. The NVMe driver was > calling that API a lot. In this case, though, the NVMe driver was > running in IRQ context and set_memory_decrypted() could sleep, so an > unencrypted DMA memory pool was created to work around the sleeping > issue and reduce the page state changes. It's just things like that, > that make me wary. Interesting. Is that a real passthrough NVMe device or the hypervisor presenting a virtual one that just happens to use the NVMe driver? I'm pretty sure the TDX folks have been banking on having very few page state changes. But, part of that at least is their expectation of relying heavily on virtio. I wonder if their expectations are accurate, or if once TDX gets out into the real world if their hopes will be dashed.