Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-03 Thread Gerd Hoffmann
On Fri, Feb 03, 2023 at 01:22:48PM +, Wu, Jiaxin wrote: > Hi Gerd, > > Is it still the solution with multiple hobs created for big data but you want > the hob splitting and reassembling can be encapsulated in the Hoblib? Exactly. > Does it need define the new hob type for chunk? Adding EFI

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-03 Thread Ni, Ray
2023 9:23 PM > To: kra...@redhat.com; Ni, Ray > Cc: Johnson, Brian ; devel@edk2.groups.io; Laszlo > Ersek ; Dong, Eric ; Zeng, Star > ; Kumar, Rahul R ; Kinney, > Michael D ; Zimmer, Vincent > > Subject: RE: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM > Ba

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-03 Thread Wu, Jiaxin
t: Friday, February 3, 2023 3:55 PM > To: Ni, Ray > Cc: Johnson, Brian ; devel@edk2.groups.io; Laszlo > Ersek ; Wu, Jiaxin ; Dong, Eric > ; Zeng, Star ; Kumar, Rahul R > ; Kinney, Michael D ; > Zimmer, Vincent > Subject: Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: A

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-02 Thread Gerd Hoffmann
On Fri, Feb 03, 2023 at 03:14:42AM +, Ni, Ray wrote: > Gerd, > Can you please explain a bit more on the chunk idea? > > > 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 l

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-02 Thread Ni, Ray
bject: Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM > Base HOB Data > > On 2/2/23 06:51, Gerd Hoffmann wrote: > >Hi, > > > >>> - With relatively many elements fitting into a single HOB, on most > >>> platforms, just one HOB is going

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-02 Thread Brian J. Johnson
On 2/2/23 06:51, Gerd Hoffmann wrote: 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 mo

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-02 Thread Gerd Hoffmann
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

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-01 Thread Ni, Ray
Michael D ; Zimmer, Vincent > > Subject: Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add > SMM Base HOB Data > > On Sun, Jan 29, 2023 at 05:24:31AM +, Wu, Jiaxin wrote: > > Thanks Gerd raise this open -- how to support more processors due to hob > size limitation

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-01 Thread Ni, Ray
> -Original Message- > From: Laszlo Ersek > Sent: Friday, January 20, 2023 4:21 PM > To: Ni, Ray ; Gerd Hoffmann ; Wu, > Jiaxin > Cc: devel@edk2.groups.io; Dong, Eric ; Zeng, Star > ; Kumar, Rahul R ; Kinney, > Michael D ; Zimmer, Vincent > > Subject: Re: [PATCH v3 1/5] UefiCpuPkg/SmmB

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-01 Thread Wu, Jiaxin
> > Probably just nobody expected that big hobs being ever needed when this > was designed long ago. > > But as laszlo outlined: There is the option to use a page allocation > for the array and store a pointer to the array in the HOB. Which is > probably the simplest approach given you have

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-01 Thread Gerd Hoffmann
On Sun, Jan 29, 2023 at 05:24:31AM +, Wu, Jiaxin wrote: > Thanks Gerd raise this open -- how to support more processors due to hob size > limitation. > > Looks multiple hobs is the only way since we have to store each cpu's > info? Sorry, allow me ask a stupid question: why DataLength in hob

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-02-01 Thread Gerd Hoffmann
On Sun, Jan 29, 2023 at 05:08:49AM +, Wu, Jiaxin wrote: > > > > For the smbase case it might also be possible to store the base > > address and the per-cpu entry size, then use > > > > smbase = base + size * cpuindex > > > > to calculate the per-cpu base address. Puts some restrictions

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-01-28 Thread Wu, Jiaxin
Thanks Gerd raise this open -- how to support more processors due to hob size limitation. Looks multiple hobs is the only way since we have to store each cpu's info? Sorry, allow me ask a stupid question: why DataLength in hob defined as UINT16 causing the hob size limitation? Any design backg

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-01-28 Thread Wu, Jiaxin
> > For the smbase case it might also be possible to store the base > address and the per-cpu entry size, then use > > smbase = base + size * cpuindex > > to calculate the per-cpu base address. Puts some restrictions on the > memory allocation (must be one big block), not sure this is pos

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-01-20 Thread Laszlo Ersek
On 1/18/23 16:06, Ni, Ray wrote: > #pragma pack(1) > typedef struct { > UINT32CpuIndex; > UINT32NumberOfCpus; // align to > EFI_SEC_PLATFORM_INFORMATION_RECORD2.NumberOfCpus > UINT64SmBase[]; > } SMM_BASE_HOB_DATA; > #pragma pack() > > For system with less than 8K CPUs, one HO

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-01-18 Thread Gerd Hoffmann
On Wed, Jan 18, 2023 at 03:06:11PM +, Ni, Ray wrote: > Gerd, > In another mail with title "MdePkg: Remove Itanium leftover data structure", > we are discussing the HOB EFI_SEC_PLATFORM_INFORMATION_RECORD2 that helps > share the BIST information with CpuDxe driver. > That HOB is of format: (

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-01-18 Thread Ni, Ray
Gerd, In another mail with title "MdePkg: Remove Itanium leftover data structure", we are discussing the HOB EFI_SEC_PLATFORM_INFORMATION_RECORD2 that helps share the BIST information with CpuDxe driver. That HOB is of format: ( ) +. Very similar to the format of SMM_BASE_HOB_DATA: + So, if we

Re: [edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-01-18 Thread Gerd Hoffmann
Hi, > +#pragma pack(1) > +typedef struct { > + /// > + /// Describes the Number of all max supported processors. > + /// > + UINT64NumberOfProcessors; > + /// > + /// Pointer to SmBase address for each Processors. > + /// > + UINT64SmBase[]; > +} SMM_BASE_HOB_DATA; > +#pragma pac

[edk2-devel] [PATCH v3 1/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

2023-01-18 Thread Wu, Jiaxin
The default SMBASE for the x86 processor is 0x3. When SMI happens, CPU runs the SMI handler at SMBASE+0x8000. Also, the SMM save state area is within SMBASE+0x1. One of the SMM initialization from CPU perspective is to relocate and program the new SMBASE (in TSEG range) for each CPU thread