public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Re: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode alignment support
       [not found] <16357CADB63C78D6.18797@groups.io>
@ 2020-09-21  5:22 ` Aaron Li
  2020-09-22  1:27   ` 回复: " gaoliming
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Li @ 2020-09-21  5:22 UTC (permalink / raw)
  To: Feng, Bob C, Liming Gao; +Cc: devel@edk2.groups.io, Li, Aaron, Fu, Siyuan

Hi Bob & Liming,

Could you help review this patch?
Thanks.

Best,
Aaron

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Aaron Li
> Sent: Thursday, September 17, 2020 1:58 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>
> Subject: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode alignment
> support
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2971
> 
> This patch is to fix a issue that "-A" option would only support
> 2^n Byte alignment of microcode.
> 
> Signed-off-by: Aaron Li <aaron.li@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> ---
>  Silicon/Intel/Tools/FitGen/FitGen.c | 2 +-
>  Silicon/Intel/Tools/FitGen/FitGen.h | 4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c
> b/Silicon/Intel/Tools/FitGen/FitGen.c
> index c4006e69c822..4caaf70ee018 100644
> --- a/Silicon/Intel/Tools/FitGen/FitGen.c
> +++ b/Silicon/Intel/Tools/FitGen/FitGen.c
> @@ -1176,7 +1176,7 @@ Returns:
>                  // MCU might be put at 2KB alignment, if so, we need to adjust the
> size as 2KB alignment.
> 
>                  //
> 
>                  if (gFitTableContext.MicrocodeIsAligned) {
> 
> -                  MicrocodeSize = (*(UINT32 *)(MicrocodeBuffer + 32) +
> (gFitTableContext.MicrocodeAlignValue - 1)) &
> ~(gFitTableContext.MicrocodeAlignValue - 1);
> 
> +                  MicrocodeSize = ROUNDUP (*(UINT32 *)(MicrocodeBuffer + 32),
> gFitTableContext.MicrocodeAlignValue);
> 
>                  } else {
> 
>                    MicrocodeSize = (*(UINT32 *)(MicrocodeBuffer + 32));
> 
>                  }
> 
> diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h
> b/Silicon/Intel/Tools/FitGen/FitGen.h
> index abad2d8799c8..435fc26209da 100644
> --- a/Silicon/Intel/Tools/FitGen/FitGen.h
> +++ b/Silicon/Intel/Tools/FitGen/FitGen.h
> @@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  // Utility version information
> 
>  //
> 
>  #define UTILITY_MAJOR_VERSION 0
> 
> -#define UTILITY_MINOR_VERSION 62
> 
> +#define UTILITY_MINOR_VERSION 63
> 
>  #define UTILITY_DATE          __DATE__
> 
> 
> 
>  //
> 
> @@ -45,4 +45,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>    (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) &
> ((Alignment) - 1))
> 
>  ;
> 
> 
> 
> +#define ROUNDUP(Size, Alignment) (((Size) + (Alignment) - 1) / (Alignment)
> * (Alignment))
> 
> +
> 
>  #endif
> 
> --
> 2.23.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#65353): https://edk2.groups.io/g/devel/message/65353
> Mute This Topic: https://groups.io/mt/76904091/4128994
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [aaron.li@intel.com]
> -=-=-=-=-=-=
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* 回复: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode alignment support
  2020-09-21  5:22 ` [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode alignment support Aaron Li
@ 2020-09-22  1:27   ` gaoliming
  2020-09-22  2:33     ` Aaron Li
  0 siblings, 1 reply; 3+ messages in thread
From: gaoliming @ 2020-09-22  1:27 UTC (permalink / raw)
  To: 'Li, Aaron', 'Feng, Bob C'; +Cc: devel, 'Fu, Siyuan'

Aaron:
  This change is good. But, I would like to know whether there is the
specific alignment requirement for microcode. Or, any alignment value is
allowed, such as 0xFF?

Thanks
Liming
> -----邮件原件-----
> 发件人: Li, Aaron <aaron.li@intel.com>
> 发送时间: 2020年9月21日 13:23
> 收件人: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>
> 抄送: devel@edk2.groups.io; Li, Aaron <aaron.li@intel.com>; Fu, Siyuan
> <siyuan.fu@intel.com>
> 主题: RE: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode
alignment
> support
> 
> Hi Bob & Liming,
> 
> Could you help review this patch?
> Thanks.
> 
> Best,
> Aaron
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Aaron
> Li
> > Sent: Thursday, September 17, 2020 1:58 PM
> > To: devel@edk2.groups.io
> > Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>
> > Subject: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode
alignment
> > support
> >
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2971
> >
> > This patch is to fix a issue that "-A" option would only support
> > 2^n Byte alignment of microcode.
> >
> > Signed-off-by: Aaron Li <aaron.li@intel.com>
> > Cc: Bob Feng <bob.c.feng@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > ---
> >  Silicon/Intel/Tools/FitGen/FitGen.c | 2 +-
> >  Silicon/Intel/Tools/FitGen/FitGen.h | 4 +++-
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c
> > b/Silicon/Intel/Tools/FitGen/FitGen.c
> > index c4006e69c822..4caaf70ee018 100644
> > --- a/Silicon/Intel/Tools/FitGen/FitGen.c
> > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c
> > @@ -1176,7 +1176,7 @@ Returns:
> >                  // MCU might be put at 2KB alignment, if so, we need
> to adjust the
> > size as 2KB alignment.
> >
> >                  //
> >
> >                  if (gFitTableContext.MicrocodeIsAligned) {
> >
> > -                  MicrocodeSize = (*(UINT32 *)(MicrocodeBuffer + 32)
> +
> > (gFitTableContext.MicrocodeAlignValue - 1)) &
> > ~(gFitTableContext.MicrocodeAlignValue - 1);
> >
> > +                  MicrocodeSize = ROUNDUP (*(UINT32
> *)(MicrocodeBuffer + 32),
> > gFitTableContext.MicrocodeAlignValue);
> >
> >                  } else {
> >
> >                    MicrocodeSize = (*(UINT32 *)(MicrocodeBuffer +
> 32));
> >
> >                  }
> >
> > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h
> > b/Silicon/Intel/Tools/FitGen/FitGen.h
> > index abad2d8799c8..435fc26209da 100644
> > --- a/Silicon/Intel/Tools/FitGen/FitGen.h
> > +++ b/Silicon/Intel/Tools/FitGen/FitGen.h
> > @@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >  // Utility version information
> >
> >  //
> >
> >  #define UTILITY_MAJOR_VERSION 0
> >
> > -#define UTILITY_MINOR_VERSION 62
> >
> > +#define UTILITY_MINOR_VERSION 63
> >
> >  #define UTILITY_DATE          __DATE__
> >
> >
> >
> >  //
> >
> > @@ -45,4 +45,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> >    (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) &
> > ((Alignment) - 1))
> >
> >  ;
> >
> >
> >
> > +#define ROUNDUP(Size, Alignment) (((Size) + (Alignment) - 1) /
(Alignment)
> > * (Alignment))
> >
> > +
> >
> >  #endif
> >
> > --
> > 2.23.0.windows.1
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#65353):
> https://edk2.groups.io/g/devel/message/65353
> > Mute This Topic: https://groups.io/mt/76904091/4128994
> > Group Owner: devel+owner@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub [aaron.li@intel.com]
> > -=-=-=-=-=-=
> >




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode alignment support
  2020-09-22  1:27   ` 回复: " gaoliming
@ 2020-09-22  2:33     ` Aaron Li
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Li @ 2020-09-22  2:33 UTC (permalink / raw)
  To: devel@edk2.groups.io, gaoliming@byosoft.com.cn, Feng, Bob C; +Cc: Fu, Siyuan

Hi Liming,

Checked in SDM, there is a requirement:
The microcode update data must start at a 16-byte aligned linear address.
Such as 0xFF should not be supported.
I re-sent a v2 patch and added this requirement check.
Please help review again.

Thanks.


Best,
Aaron

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> gaoliming
> Sent: Tuesday, September 22, 2020 9:27 AM
> To: Li, Aaron <aaron.li@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
> Cc: devel@edk2.groups.io; Fu, Siyuan <siyuan.fu@intel.com>
> Subject: 回复: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode
> alignment support
> 
> Aaron:
>   This change is good. But, I would like to know whether there is the
> specific alignment requirement for microcode. Or, any alignment value is
> allowed, such as 0xFF?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Li, Aaron <aaron.li@intel.com>
> > 发送时间: 2020年9月21日 13:23
> > 收件人: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>
> > 抄送: devel@edk2.groups.io; Li, Aaron <aaron.li@intel.com>; Fu, Siyuan
> > <siyuan.fu@intel.com>
> > 主题: RE: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode
> alignment
> > support
> >
> > Hi Bob & Liming,
> >
> > Could you help review this patch?
> > Thanks.
> >
> > Best,
> > Aaron
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> Aaron
> > Li
> > > Sent: Thursday, September 17, 2020 1:58 PM
> > > To: devel@edk2.groups.io
> > > Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao
> > > <gaoliming@byosoft.com.cn>
> > > Subject: [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode
> alignment
> > > support
> > >
> > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2971
> > >
> > > This patch is to fix a issue that "-A" option would only support
> > > 2^n Byte alignment of microcode.
> > >
> > > Signed-off-by: Aaron Li <aaron.li@intel.com>
> > > Cc: Bob Feng <bob.c.feng@intel.com>
> > > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > > ---
> > >  Silicon/Intel/Tools/FitGen/FitGen.c | 2 +-
> > >  Silicon/Intel/Tools/FitGen/FitGen.h | 4 +++-
> > >  2 files changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c
> > > b/Silicon/Intel/Tools/FitGen/FitGen.c
> > > index c4006e69c822..4caaf70ee018 100644
> > > --- a/Silicon/Intel/Tools/FitGen/FitGen.c
> > > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c
> > > @@ -1176,7 +1176,7 @@ Returns:
> > >                  // MCU might be put at 2KB alignment, if so, we need
> > to adjust the
> > > size as 2KB alignment.
> > >
> > >                  //
> > >
> > >                  if (gFitTableContext.MicrocodeIsAligned) {
> > >
> > > -                  MicrocodeSize = (*(UINT32 *)(MicrocodeBuffer + 32)
> > +
> > > (gFitTableContext.MicrocodeAlignValue - 1)) &
> > > ~(gFitTableContext.MicrocodeAlignValue - 1);
> > >
> > > +                  MicrocodeSize = ROUNDUP (*(UINT32
> > *)(MicrocodeBuffer + 32),
> > > gFitTableContext.MicrocodeAlignValue);
> > >
> > >                  } else {
> > >
> > >                    MicrocodeSize = (*(UINT32 *)(MicrocodeBuffer +
> > 32));
> > >
> > >                  }
> > >
> > > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.h
> > > b/Silicon/Intel/Tools/FitGen/FitGen.h
> > > index abad2d8799c8..435fc26209da 100644
> > > --- a/Silicon/Intel/Tools/FitGen/FitGen.h
> > > +++ b/Silicon/Intel/Tools/FitGen/FitGen.h
> > > @@ -31,7 +31,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> > >  // Utility version information
> > >
> > >  //
> > >
> > >  #define UTILITY_MAJOR_VERSION 0
> > >
> > > -#define UTILITY_MINOR_VERSION 62
> > >
> > > +#define UTILITY_MINOR_VERSION 63
> > >
> > >  #define UTILITY_DATE          __DATE__
> > >
> > >
> > >
> > >  //
> > >
> > > @@ -45,4 +45,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> > >    (ActualSize) + (((Alignment) - ((ActualSize) & ((Alignment) - 1))) &
> > > ((Alignment) - 1))
> > >
> > >  ;
> > >
> > >
> > >
> > > +#define ROUNDUP(Size, Alignment) (((Size) + (Alignment) - 1) /
> (Alignment)
> > > * (Alignment))
> > >
> > > +
> > >
> > >  #endif
> > >
> > > --
> > > 2.23.0.windows.1
> > >
> > >
> > >
> > > -=-=-=-=-=-=
> > > Groups.io Links: You receive all messages sent to this group.
> > > View/Reply Online (#65353):
> > https://edk2.groups.io/g/devel/message/65353
> > > Mute This Topic: https://groups.io/mt/76904091/4128994
> > > Group Owner: devel+owner@edk2.groups.io
> > > Unsubscribe: https://edk2.groups.io/g/devel/unsub [aaron.li@intel.com]
> > > -=-=-=-=-=-=
> > >
> 
> 
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-22  2:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <16357CADB63C78D6.18797@groups.io>
2020-09-21  5:22 ` [edk2-devel] [PATCH v1 1/1] Tools/FitGen: Fix microcode alignment support Aaron Li
2020-09-22  1:27   ` 回复: " gaoliming
2020-09-22  2:33     ` Aaron Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox