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 08ADAE7D0D2 for ; Fri, 22 Sep 2023 07:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230254AbjIVHEn (ORCPT ); Fri, 22 Sep 2023 03:04:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbjIVHEk (ORCPT ); Fri, 22 Sep 2023 03:04:40 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DA4D18F for ; Fri, 22 Sep 2023 00:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695366274; x=1726902274; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=/UUAcVXG2ViI9IVF3s/SfGomnPqiRRaiDBRjonZhOLE=; b=ElMIXImd9gjKZ96v2B/K5XiaDfoqDotCX/7KVPxwDSH7wsZqrkbtKkJ2 iiXBOT4Cxob059k1ENsd1+UzkA7vPloM5Y0v7E5zVsDnNXSESq0+dhVJI BvllCX5Ld560txjE6UBQiyRqZ5MJ5xVsAxlg7lZmobHqcmKhm0mlN/3G8 vJCJx3OhA7fn7uc6lDih/cx/3QkoISinwUaGlDWPDUkPN3pF+hCvgBwiV AWWQybkF1hxl8z7bhTuRk7huMZn5q3HA6U8NHOiH8lQWMLgN45K4ifs0j u23PE4NJwRBcp4wLMBkJ1hDaHLn3G/S1v8z1dAYaDUMuDLjcXmMAjoZFq w==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="411699615" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="411699615" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 00:04:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="1078262936" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="1078262936" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.93.11.250]) ([10.93.11.250]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 00:03:56 -0700 Message-ID: Date: Fri, 22 Sep 2023 15:03:53 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.1 Subject: Re: [RFC PATCH v2 00/21] QEMU gmem implemention Content-Language: en-US To: David Hildenbrand , Sean Christopherson Cc: Paolo Bonzini , Igor Mammedov , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Peter Xu , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Cornelia Huck , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , Eric Blake , Markus Armbruster , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Michael Roth , isaku.yamahata@gmail.com, Claudio Fontana References: <20230914035117.3285885-1-xiaoyao.li@intel.com> <103096a6-f4b5-d88a-2aac-07dcc86825d6@redhat.com> From: Xiaoyao Li In-Reply-To: <103096a6-f4b5-d88a-2aac-07dcc86825d6@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 9/21/2023 5:11 PM, David Hildenbrand wrote: >>>> 3. What is KVM_X86_SW_PROTECTED_VM going to look like? and do we >>>> need it? >>>> >>> >>> Why implement it when you have to ask others for a motivation? 😉 >>> >>> Personally, I'm not sure if it is really useful, especially in this >>> state. >> >> Yeah, as of today, KVM_X86_SW_PROTECTED_VM is mainly a development >> vehicle, >> e.g. so that testing gmem doesn't require TDX/SNP hardware, debugging >> gmem guests >> isn't brutally painful, etc. >> >> Longer term, I have aspirations of being able to back most VMs with >> gmem, but >> that's going to require quite a bit more work, e.g. gmem needs to be >> mappable >> (when hardware allows it) so that gmem doesn't all but require double >> mapping, >> KVM obviously needs to be able to read/write gmem, etc. >> >> The value proposition is that having a guest-first memory type will >> allow KVM to >> optimize and harden gmem in ways that wouldn't be feasible for a more >> generic >> memory implementation.  E.g. memory isn't mapped into host userspace >> by default >> (makes it harder to accidentally corrupt the guest), the guest can >> have *larger* >> mappings than host userspace, guest memory can be served from a >> dedicated pool >> (similar-ish to hugetlb), the pool can be omitted from the direct map, >> etc. >> > Thanks for that information. Personally, I don't believe "to back most > VMs with gmem", but that's a different discussion. > > As a development vehicle to get TDX up and running it might be very > valuable indeed. But it doesn't necessarily have to be merged in QEMU > for that case -- especially in a semi-finished form. It's true and I agree with it. I'll drop the KVM_X86_SW_PROTECTED_VM part in next version. How would you like this series to proceed in next version? only the patches of gmem support without a user? or together with next QEMU TDX series?