Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1919690rwb; Thu, 19 Jan 2023 17:50:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXuiuJei39oBpGUnCTbb5DmthB7UluNalesPzI2NIRJ/9kWk5WX7rIc9wBa7pHZM9crv226I X-Received: by 2002:a17:90a:1696:b0:228:cda9:f608 with SMTP id o22-20020a17090a169600b00228cda9f608mr13370914pja.15.1674179448392; Thu, 19 Jan 2023 17:50:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674179448; cv=none; d=google.com; s=arc-20160816; b=h1D9L8rmpEyLtR5REse3gmxyTLyFHBY0ZIP/fhLdNNLu8c4uOcMC8ar5JFx6H+vq+3 vF9iTZVUiPkSLjtY/jfEdnf0W5LTqPS+omwObVj+9Fp0FBG+mGl8YMBFI8qLSKKx95yk SHCuKQN3vP2ULLbOQ1sblttvjR7h+nwVqRuV8pSobW91Xy0llgVsbFPYbDyo/0aa1E5+ h7vpZXMlujx/Jx+dXLK7M32hhNVUmPwiL9FTSY+hlSM5PtH1i5mR2ROUeFmxPbwPbsJY TkYT0n4SzJtGXXoqNtyFnafGZzl0VGScIJ2Zkh4+LtVErOi7soEwPCGhpvo7XB6xbSfJ 36XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=B93pafDYiLEzdeFpoSwk6ASMlzCL9xGgaEmz8elDYkE=; b=HXHNitrD23uLtivVasfS3vpZeHrYDEJktip2KKx8ITO/+jpBSGikKhy6vmOqENg3qA N/uBrSgsUeJ5lhSfbGQEr2HgZ7cHd9CjZqzVqNB8etr54+1ErCJR48MNqfpfITKR3Rnp tRQId2zMgHIlPsJDuzZaDihWUByFHL7ODMcuYswSlhe5gjNFH337FYjFbEKjdLotnZJ6 Xbbu2iPbYSLibzjYbSZArblw8PHRCUMalchrLWLDmhV/cfO1Feix361e+gXf5f73Noc2 YOgp/OGPQRn6uc3h6/m57+MW4WtCQcD5S+sg4u3SgNc9fgA54zTRK2ScXuhiS/b0H/Tz n2lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=tmyKvc9Y; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 y12-20020a17090abd0c00b0022bac52ab07si466457pjr.16.2023.01.19.17.50.32; Thu, 19 Jan 2023 17:50:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=tmyKvc9Y; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S229719AbjATBkZ (ORCPT + 99 others); Thu, 19 Jan 2023 20:40:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbjATBkY (ORCPT ); Thu, 19 Jan 2023 20:40:24 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73EDF9EE23 for ; Thu, 19 Jan 2023 17:40:23 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id 207so2917561pfv.5 for ; Thu, 19 Jan 2023 17:40:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B93pafDYiLEzdeFpoSwk6ASMlzCL9xGgaEmz8elDYkE=; b=tmyKvc9Yi6bdrHRRM3gAqJqs1CzR1XX05zMF9AHW7o1g8CWfq25rGeVC46PYzv+QQb G+FFXjaoKNOC9lUG9nQ8YldisNIgUf+da+3wUYpfXHWDv6Hekx4GBTnTEmhVY2u6xY27 z3yUKZ3I9m2D7TUe5q/k6SAPomZVlbLzyYhz3IxiySZb6xMMQEPi8rvCXbqTVAytxDjJ dTsJPiH5Mr/IutzNznAv9WQcTlADk4CLKkyza6j3e9NO7NHS1fwemD3AD/19E9hb+3kw zmi7mYUAc+q8GwjrleYQng8J8+I8VZ7OKV3ycKnnxrmzR13hfdso8R+4itSyFIG8EXlk g3+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=B93pafDYiLEzdeFpoSwk6ASMlzCL9xGgaEmz8elDYkE=; b=LbJ7k/3HrtMRRTupk8C22Le2pmmS4alarEqaZFQC4p9uOV8cVVo/zcm+JwLVVTyhXo /lpXNGckIObA6mlEi/m9UFRKyaN9/0hy5aQ9YsDgntyhyNU3T/vMoi8M8T5gw/wVi5xz LcXuHUsuRM3Bwad8IAs+NyvKHM+P6jsZYddBYMq32UfXNvSRuvHrKgQOARc9kdl7C78F FikdwYG+xBbIVuWI6lIgggS2+S/1gdIyzTWDKCYPB9DlDTadETqbQQpEofJTE8RWhnaQ L9Np47l0ZGXSXCjQ8pTrJL6bdws/NSkDqu70fXw5hIp80P80m3EMWNMPpZIKPK1MqtdJ XHLA== X-Gm-Message-State: AFqh2ko5OpW0kPJIQlCIFZ9A8YPx2OsgMjfoUTJx1Icoj0Y3tqZIK9Ip NFtggDulqhNqB0+mB2XJFRVns3iJMDq4EWf9coKzgQ== X-Received: by 2002:a05:6a00:4c14:b0:580:f2b8:213c with SMTP id ea20-20020a056a004c1400b00580f2b8213cmr1309897pfb.8.1674178822730; Thu, 19 Jan 2023 17:40:22 -0800 (PST) MIME-Version: 1.0 References: <20221214194056.161492-1-michael.roth@amd.com> <20221214194056.161492-63-michael.roth@amd.com> In-Reply-To: From: Dionna Amalie Glaze Date: Thu, 19 Jan 2023 17:40:10 -0800 Message-ID: Subject: Re: [PATCH RFC v7 62/64] x86/sev: Add KVM commands for instance certs To: "Kalra, Ashish" Cc: Michael Roth , kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, dovmurik@linux.ibm.com, tobin@ibm.com, bp@alien8.de, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, dgilbert@redhat.com, jarkko@kernel.org, harald@profian.com Content-Type: text/plain; charset="UTF-8" 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=ham 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-crypto@vger.kernel.org On Thu, Jan 19, 2023 at 2:18 PM Kalra, Ashish wrote: > > Hello Dionna, > > Do you also have other updates to this patch with regard to review > comments from Dov ? > Apart from the PAGE_ALIGN change, the result of the whole discussion appears to only need the following immediately before the copy_from_user of certs_uaddr in the snp_set_instance_certs function: /* The size could shrink and leave garbage at the end. */ memset(sev->snp_certs_data, 0, SEV_FW_BLOB_MAX_SIZE); I don't believe there is an off-by-one with the page shifting for the number of pages because snp_certs_len is already rounded up to the nearest page size. Any other change wrt the way the blob size is decided between the guest and host should come later. -- -Dionna Glaze, PhD (she/her)