From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.13647.1675342327656273665 for ; Thu, 02 Feb 2023 04:52:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fVR5XGJy; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675342326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nCtEPRLPSGU2A77zgaQBfH+FtT5+KKyFF6YKqdBF0hs=; b=fVR5XGJyZD/97T0PzMItYgAoGrtLVvb9ScT4eOFHvRb9tlQCDtnAZXKIR37x3JHCwTCaAq zf4nqzwgGcvbwo65L30mHqXsH3i083E/K6z1Dr+nliGB1dLHDEKh7Pd8fvnmN/1nsrHClf 8336+WnAyJzedUYAlnzUhJsn5PSSUaM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-237-AtE73bMaOaSTuE2_g2F0FA-1; Thu, 02 Feb 2023 07:52:01 -0500 X-MC-Unique: AtE73bMaOaSTuE2_g2F0FA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 75EC7833949; Thu, 2 Feb 2023 12:52:00 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28652112132C; Thu, 2 Feb 2023 12:52:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B6405180061A; Thu, 2 Feb 2023 13:51:58 +0100 (CET) Date: Thu, 2 Feb 2023 13:51:58 +0100 From: "Gerd Hoffmann" To: "Ni, Ray" Cc: Laszlo Ersek , "Wu, Jiaxin" , "devel@edk2.groups.io" , "Dong, Eric" , "Zeng, Star" , "Kumar, Rahul R" , "Kinney, Michael D" , "Zimmer, Vincent" Subject: Re: [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data Message-ID: <20230202125158.bx7amq2nfibhimvf@sirius.home.kraxel.org> References: <20230118095620.9860-1-jiaxin.wu@intel.com> <20230118095620.9860-2-jiaxin.wu@intel.com> <20230118111913.xgjlxdhngzwhvf76@sirius.home.kraxel.org> <8142cc40-ca21-2748-a3de-d0432ccbdc07@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > > - With relatively many elements fitting into a single HOB, on most > > platforms, just one HOB is going to be used. While that may be good for > > performance, it is not good for code coverage (testing). The quirky > > indexing method will not be exercised by most platforms. > > TRUE so I propose that the first version of the code change only expects > the HOB.NumberOfCpus equals to the NumberOfCpus returned from MP > service, meaning the code logic only supports single instance of the HOB. > When a platform that contains >8000 cpu threads resulting in multiple HOBs > produced, the expectation will break and remind us that the CpuSmm driver > needs to update to handle multiple HOBs. Given that this is already the second case where we hit the 64k size limit and I expect it will not be the last one: I think it makes sense to introduce a generic and reusable concept of chunked HOBs, so you can add helper functions to HobLib for splitting and reassembling, with a struct along the lines of: typedef struct { // offset and size of this particular chunk UINT32 ChunkOffset; UINT32 ChunkSize; // number of chunks and size of all chunks combined. UINT32 ChunkCount; UINT32 TotalSize; // chunk data UINT8 Data[0]; } EFI_HOB_CHUNK; take care, Gerd