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 A2021CCA485 for ; Thu, 21 Jul 2022 21:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233836AbiGUVTO (ORCPT ); Thu, 21 Jul 2022 17:19:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbiGUVTM (ORCPT ); Thu, 21 Jul 2022 17:19:12 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDB948AB07 for ; Thu, 21 Jul 2022 14:19:10 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id 70so2894345pfx.1 for ; Thu, 21 Jul 2022 14:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ScpzxJyKmeludExQxXIszukI2lfSKDVjTGaUtRwviD0=; b=fYYV0vbwKMgnf6isTcV+vMM02uE3HouFd898nbPDmChcgRckNqpK/32TxwPnHN227J ++L0os8W6x9ium+SRGtN1Ky0yP28Yuv/qHye6YY85twUgSpz5cL4iafN1yWBzT5mF5jT zfZ0audvBpI4c00xFJNjzqhLBl3DeJoNNfW967aC5PgjacYCopiCYm4yTM/A0/u+cirV MUabNXNe86MjLj4FukHS14w3Pyv+H9Fs6bPQsVG7BpQl5iGi6UTeRa3otGxN0BH1ah9v 19fMAXWCGwObG/1U0EneiYQ/0oaLDLnpN90yC2Rxw6G7kn46NiP6IFXR/iv11/pJMTkK uw5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ScpzxJyKmeludExQxXIszukI2lfSKDVjTGaUtRwviD0=; b=f1ccBNSzpVC1bukZySYBft09HAXzOLKYANR81WM6F+vZJ9fquIYxgDjgeP+YUpxEN/ KNDApAEI/sDtg5C/PQ8QrTeOHqmBxzncwThzb4vk35ELCo298p6tb7nLl8RjQE3loFDP vF5BbTx1S9v/ghS+pN6qy9QmCzqCeutpGzQvYBabL380uBqyjp71FHdc0QI/8WkGAVcO KehMMEwQpw7OS/FwT4wECvtbD9lApyvbV3gd6Ubpe6vbjb0Osi0bWdZQFmd23Bml1Dx5 i3iJTjNO3MgdUn0eDHCuNEgFuxLB1B3ggiw03/IEq2Mo68lADoj9roHxKBx67PQBQRpJ +m+g== X-Gm-Message-State: AJIora9gjJ6nYuMNKZTJ34XooQ+iTVjrXFstzWXIbe5tDaPUbR+EhP/I 0s2eP/kwKCNMRpg1/HGT0heT0g== X-Google-Smtp-Source: AGRyM1tRhRp+6mg/TcG9DeP0WjeN5fNx2D34QSPiNsnaUnKIDpEjYXyyrYr8GL+NFtkg+bEZ2FCYeg== X-Received: by 2002:a65:6d19:0:b0:41a:625e:7d7a with SMTP id bf25-20020a656d19000000b0041a625e7d7amr275152pgb.506.1658438350139; Thu, 21 Jul 2022 14:19:10 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id i67-20020a62c146000000b005289fbef7c4sm2243655pfg.140.2022.07.21.14.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 14:19:09 -0700 (PDT) Date: Thu, 21 Jul 2022 21:19:06 +0000 From: Sean Christopherson To: "Gupta, Pankaj" Cc: Chao Peng , Quentin Perret , Michael Roth , Andy Lutomirski , Steven Price , kvm list , Linux Kernel Mailing List , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linux API , qemu-devel@nongnu.org, Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , "H. Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Mike Rapoport , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A. Shutemov" , "Nakajima, Jun" , Dave Hansen , Andi Kleen , David Hildenbrand , Marc Zyngier , Will Deacon , nikunj@amd.com, ashish.kalra@amd.com Subject: Re: [PATCH v5 00/13] KVM: mm: fd-based approach for supporting KVM guest private memory Message-ID: References: <83fd55f8-cd42-4588-9bf6-199cbce70f33@www.fastmail.com> <20220422105612.GB61987@chaop.bj.intel.com> <20220509223056.pyazfxjwjvipmytb@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, Jul 21, 2022, Gupta, Pankaj wrote: > > Hi Sean, Chao, > > While attempting to solve the pre-boot guest payload/firmware population > into private memory for SEV SNP, retrieved this thread. Have question below: > > > > > Requirements & Gaps > > > > ------------------------------------- > > > > - Confidential computing(CC): TDX/SEV/CCA > > > > * Need support both explicit/implicit conversions. > > > > * Need support only destructive conversion at runtime. > > > > * The current patch should just work, but prefer to have pre-boot guest > > > > payload/firmware population into private memory for performance. > > > > > > Not just performance in the case of SEV, it's needed there because firmware > > > only supports in-place encryption of guest memory, there's no mechanism to > > > provide a separate buffer to load into guest memory at pre-boot time. I > > > think you're aware of this but wanted to point that out just in case. > > > > I view it as a performance problem because nothing stops KVM from copying from > > userspace into the private fd during the SEV ioctl(). What's missing is the > > ability for userspace to directly initialze the private fd, which may or may not > > avoid an extra memcpy() depending on how clever userspace is. > Can you please elaborate more what you see as a performance problem? And > possible ways to solve it? Oh, I'm not saying there actually _is_ a performance problem. What I'm saying is that in-place encryption is not a functional requirement, which means it's purely an optimization, and thus we should other bother supporting in-place encryption _if_ it would solve a performane bottleneck.