From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38073C7C for ; Fri, 4 Mar 2022 15:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646407422; x=1677943422; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=8+CEXWwRwOMrbbF77tgElxSqFXtFdC2qH4kdmgKvO/8=; b=UTIQHEEzqRvU/mDEycmvPSzWA1d9Hq4///kvZbzOWtfQyzT5FvVuVTBB kt+zzORouIkgevgCUQHOngvADtey2pdJaoSByARd5mKxE34+Bngbcsfkr dDzyH+79xIcrsM/vXkT0Q/t7fSBVjf9wmkO4k80a/MKIcFe2D/G4aE3uh KIu7ns4Q5Fgvwut/bmS5+If4bYwJJ6lDqAoX/JPvTeBI8Dw0ach+BAZO/ 6bTDqXGueP4ga2TQTK2x6nah7YIbnC8FcpMSQFqywKXvt6e4tL5XzCLJ0 BaYec37ydYzNC/OIgSo+3gnQaqlqLExztZgZojNwxSmwSGT9fkIkCQOj5 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10276"; a="251570279" X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="251570279" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 07:23:36 -0800 X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="640610291" Received: from eabada-mobl2.amr.corp.intel.com (HELO [10.209.6.252]) ([10.209.6.252]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 07:23:34 -0800 Message-ID: Date: Fri, 4 Mar 2022 07:23:28 -0800 Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org Cc: Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Borislav Petkov , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , "Dr . David Alan Gilbert" , brijesh.ksingh@gmail.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com References: <20220224165625.2175020-1-brijesh.singh@amd.com> <20220224165625.2175020-43-brijesh.singh@amd.com> <9c075b36-e450-831b-0ae2-3b680686beb4@amd.com> From: Dave Hansen Subject: Re: [PATCH v11 42/45] virt: Add SEV-SNP guest driver In-Reply-To: <9c075b36-e450-831b-0ae2-3b680686beb4@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/4/22 05:17, Brijesh Singh wrote: >> BTW, this look like a generic allocator thingy. But it's only ever used >> to allocate a 'struct snp_guest_msg'. Why all the trouble to allocate >> and free one fixed-size structure? The changelog and comments don't >> shed any light. > The GHCB specification says that a guest must use shared memory for > request, response, and certificate blob. In this patch, you are seeing > that {alloc,free}_shared_pages() used only to alloc/free the request and > response page. In the last patch, we used the same generic function to > allocate the certificate blob with a different size (~16K) than 'struct > snp_guest_msg.' It sounds like it's worth a sentence or two in the changelog to explain this new "allocator" and its future uses.