Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp41112imi; Thu, 21 Jul 2022 15:32:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uKvZqPrB5eTf/dn81VeeADIhiE7htdAVJI4MLgagW8u0Bkey+Wk3lnxR7x9IbnfWl3A/XG X-Received: by 2002:a17:902:9b96:b0:16c:83f0:33f8 with SMTP id y22-20020a1709029b9600b0016c83f033f8mr490972plp.4.1658442744163; Thu, 21 Jul 2022 15:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658442744; cv=none; d=google.com; s=arc-20160816; b=DrHpeloTmmOgmPANrzGpYgvl7hu3dc9rRIYn3EEcsjmYQhxPywgEl+cvTnoc7RYg+s 2EgylaEHJ1j0aUd5UGnMfTTTCG476EE+HDBLHwfau54aEP4FW4kQsw3CX2HbPCNP+0GG HK4N3lhtyio29xfxMeQKJLGUEdcLNQl/pLpQJplpSVBJBasajdHkofPmW8DUEgdLlymw HUgU25o3xO22F+otaJzwPI/WQzBN8hwAqQNWJy/P7MhTqkUYD7d0JddqTF5KNITi78LH 9kHCo44wU+Wee5paCzHgE2jKS9ZdKEtGBLWj5XLNN6H4mAYSPXm0LCsMbeQNLI/gG9Dw whOQ== 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:dkim-signature; bh=ScpzxJyKmeludExQxXIszukI2lfSKDVjTGaUtRwviD0=; b=G7jLuHxpXCKWfY3/5xPlhSCn8mKkuTsxYrvm8gxP2GWP99JitBO5dsg75illDF8Ryo UXYoUTUFYBhZbyWqM6MdJ4FJysMk8Awl6cCakEMtIIVnomtKez2OGqCqb0ljXV3VNoZw qsUR8D9SqJLTChVV+RRC4R5iHWAe5PL4NPJugUajTnSkfJ33ARLvSAXOXugCDbtZ6A+G avB7v6R4m/MsgL1oLahi2UfUX7a8JZsFCIFJhILMV1ddVbBKZ2H7t8f5IDigeHZ+rVxi ovCTI+taYqik3V91bc09sMC7AY/Nt925CoRC7IcKXsSGLrkMuinHSUsAYig15FndmrKA USyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=fYYV0vbw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a63c10d000000b0041a35afe8a1si3180805pgf.316.2022.07.21.15.32.08; Thu, 21 Jul 2022 15:32:24 -0700 (PDT) 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=@google.com header.s=20210112 header.b=fYYV0vbw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233732AbiGUVTP (ORCPT + 99 others); Thu, 21 Jul 2022 17:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233812AbiGUVTM (ORCPT ); Thu, 21 Jul 2022 17:19:12 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF26E91CDD for ; Thu, 21 Jul 2022 14:19:10 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id y9so2844335pff.12 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=AFkJfkKnOJKG8kLSafFDy10WDcq8EK9QrPWDQFavCEUeFeL0xKuGUwKZi/Zsoo7PfE NtCbIlIj1APyyco2DUwwUK93jWPMOpddYS3amIPQRp+Bwq5YzOfKACaJWbh6FHHh1Zla QxicJhuH5pjoHkPO5k5BsVFd70KH+yIXIcskfJJFAJpL5pu0Ae1R30fEvN+VI18FiZYv 64w/CzfX/QIbShMQyeCpvIM2hdfk4rj0FW0l+F8Z4y1CxfuFKvMIjrtVFBRZTq5AbWI+ 9MVuDGI48tDKj/OUwzDa06EMUVYBjdYhBhw3yimhU2d7o+o34/pphUmW/dBvvHPxiuMV WgrA== X-Gm-Message-State: AJIora+qPwk1W7Mwgr0t73xRJk2V2T+P4djDpDefJrbKQrf3Vv4K1mOe P4Q/4uTqs3318WvABrZ1g0wI+w== 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: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 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.