Attention is currently required from: Arthur Heymans, Dinesh Gehlot, Eran Mitrani, Jakub Czapiga, Jayvik Desai, Kapil Porwal, Nick Vaccaro, Rishika Raj, Tarun.
Hello Dinesh Gehlot, Eran Mitrani, Jakub Czapiga, Jayvik Desai, Kapil Porwal, Nick Vaccaro, Rishika Raj, Subrata Banik, Tarun, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/84205?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: [WIP]mb/google/brya: Work around a GCC LTO bug
......................................................................
[WIP]mb/google/brya: Work around a GCC LTO bug
Work around a GCC LTO bug. GCC with LTO hits a bug on code meant for
real DIMMS. Increase the SPD buffer to counter that garbage collected
buffer overflow.
Let's see if CI needs this more broadly?
Change-Id: Ib3d4ed8032bb06b6d08fbc2dc4b697df88745243
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/mainboard/google/brya/Kconfig
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/84205/4
--
To view, visit https://review.coreboot.org/c/coreboot/+/84205?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ib3d4ed8032bb06b6d08fbc2dc4b697df88745243
Gerrit-Change-Number: 84205
Gerrit-PatchSet: 4
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Reviewer: Eran Mitrani <mitrani(a)google.com>
Gerrit-Reviewer: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Reviewer: Jayvik Desai <jayvik(a)google.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Reviewer: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Tarun <tstuli(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jayvik Desai <jayvik(a)google.com>
Gerrit-Attention: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Attention: Eran Mitrani <mitrani(a)google.com>
Gerrit-Attention: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Attention: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Attention: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Attention: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Tarun <tstuli(a)gmail.com>
Attention is currently required from: Arthur Heymans, Dinesh Gehlot, Eran Mitrani, Jakub Czapiga, Jayvik Desai, Kapil Porwal, Nick Vaccaro, Rishika Raj, Tarun.
Subrata Banik has posted comments on this change by Arthur Heymans. ( https://review.coreboot.org/c/coreboot/+/84205?usp=email )
Change subject: soc/intel/{adl,mtl}: Don't set up SPD on LPDDRx
......................................................................
Patch Set 3:
(1 comment)
File src/soc/intel/meteorlake/meminit.c:
https://review.coreboot.org/c/coreboot/+/84205/comment/a2b3040c_aa59112b?us… :
PS2, Line 209: has_spd = true;
> > > > > > > > Can you help me understand the purpose of `has_spd`? Does it mean the mainboard has an SPD chip and we'll read the hex file using SMBUS?
> > > > > > >
> > > > > > > would need_spd be a better name? LPDDRx DRAM technology does not use SPD and the code for SPD in soc/intel/common is doing doing undefined behavior like overflowing an array.
> > > > > >
> > > > > > Yes, that name sounds better. I'd like to suggest adding a comment that explains the purpose of this variable. People often confuse the SPD chip with the SPD hex data file. The code should make it clear that the SPD chip isn't required to read the SPD hex file (need_spd).
> > > > >
> > > > > No actually it's about SPD data and this code is wrong. The soc/intel/common code is simply wrong for LPDDRx. The loop over channels and dimms per channel is overflowing. There are no DIMMs in LPDDRx which is what need to be addressed.
> > > >
> > > > okay, so when you set `has_spd` or `need_spd`, are you saying that we will read SPD data over SMBUS and for lpddrx, we shall pass SPD hex file ?
> > >
> > > No that's not the issue. CONFIG_DIMM_MAX is 4 which is how large the array is for containing SPD pointers. LPDDRx has 16 bit per channel, so the code thinks there are 8 channels in total. CONFIG_DIMM_PER_CHANNEL is set to 2. The common code loops over channels and dimms per channel so it's overflowing. What is the appropriate fix? do you think.
> > >
> > > https://qa.coreboot.org/job/coreboot-gerrit/263746/testReport/junit/(root)/… is the compilation error with LTO which can detect the buffer overflow.
> >
> > will this work ?
> > ```
> > git diff
> > diff --git a/src/soc/intel/common/block/memory/meminit.c b/src/soc/intel/common/block/memory/meminit.c
> > index f583213254..cf12aff803 100644
> > --- a/src/soc/intel/common/block/memory/meminit.c
> > +++ b/src/soc/intel/common/block/memory/meminit.c
> > @@ -189,12 +189,13 @@ void mem_populate_channel_data(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_m
> > struct mem_channel_data *data)
> > {
> > size_t spd_md_len = 0, spd_dimm_len = 0;
> > - bool have_dimms;
> > + bool have_dimms = 0;
> >
> > memset(data, 0, sizeof(*data));
> >
> > read_spd_md(soc_mem_cfg, spd_info, half_populated, data, &spd_md_len);
> > - have_dimms = read_spd_dimm(memupd, soc_mem_cfg, spd_info, half_populated, data,
> > + if ((info->topo & MEM_TOPO_DIMM_MODULE)
> > + have_dimms = read_spd_dimm(memupd, soc_mem_cfg, spd_info, half_populated, data,
> > &spd_dimm_len);
> >
> > if (data->ch_population_flags == NO_CHANNEL_POPULATED)
> > ```
>
> I tried this. And looking more at it seems that this in fact a compiler bug. I'll play around with some options. It looks like even without lto this unused code would be in the binary. Maybe it's reasonable to move the memory type to Kconfig to optimize the code?
the only problem is often we build a board like Intel RVP with unified AP FW that support both DDR5 and LPDDR5x. With introduction of Kconfig, we won't be able to keep unified AP FW to boot same HW with different memory configuration. If we need to block this code from getting complied then we can set `has_spd=false` and set to `true` depending upon `(info->topo & MEM_TOPO_DIMM_MODULE)`. That way, we don't see compilation error and at runtime `read_spd_dimm` API will be only called for DDRx DIMM devices along.
WDYT?
--
To view, visit https://review.coreboot.org/c/coreboot/+/84205?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ib3d4ed8032bb06b6d08fbc2dc4b697df88745243
Gerrit-Change-Number: 84205
Gerrit-PatchSet: 3
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Reviewer: Eran Mitrani <mitrani(a)google.com>
Gerrit-Reviewer: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Reviewer: Jayvik Desai <jayvik(a)google.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Reviewer: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Tarun <tstuli(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jayvik Desai <jayvik(a)google.com>
Gerrit-Attention: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Attention: Eran Mitrani <mitrani(a)google.com>
Gerrit-Attention: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Attention: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Attention: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Attention: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Tarun <tstuli(a)gmail.com>
Gerrit-Comment-Date: Wed, 04 Sep 2024 12:32:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Subrata Banik <subratabanik(a)google.com>
Comment-In-Reply-To: Arthur Heymans <arthur(a)aheymans.xyz>
Attention is currently required from: Dinesh Gehlot, Eran Mitrani, Jakub Czapiga, Jayvik Desai, Kapil Porwal, Nick Vaccaro, Rishika Raj, Subrata Banik, Tarun.
Arthur Heymans has posted comments on this change by Arthur Heymans. ( https://review.coreboot.org/c/coreboot/+/84205?usp=email )
Change subject: soc/intel/{adl,mtl}: Don't set up SPD on LPDDRx
......................................................................
Patch Set 3:
(1 comment)
File src/soc/intel/alderlake/meminit.c:
https://review.coreboot.org/c/coreboot/+/84205/comment/a9f92388_f4cfbef3?us… :
PS3, Line 239: = {};
> Maybe use a ```memset``` instead of ```{}``` for default value initialization ?
>
> - I don't see anywhere else in the code initializing structs default like this.
> - since you have now kept the func ```mem_populate_channel_data``` under a condition ( the function was defaulting this variable to zero ), a memset here might be better IMO.
>
> this is just a suggestion, ignore it if you think it will break the logic.
The code generated would be the same. It does look like {0} is ideomatic and not {}.
--
To view, visit https://review.coreboot.org/c/coreboot/+/84205?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ib3d4ed8032bb06b6d08fbc2dc4b697df88745243
Gerrit-Change-Number: 84205
Gerrit-PatchSet: 3
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Reviewer: Eran Mitrani <mitrani(a)google.com>
Gerrit-Reviewer: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Reviewer: Jayvik Desai <jayvik(a)google.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Reviewer: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Tarun <tstuli(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jayvik Desai <jayvik(a)google.com>
Gerrit-Attention: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Attention: Eran Mitrani <mitrani(a)google.com>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Attention: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Attention: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Attention: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Attention: Tarun <tstuli(a)gmail.com>
Gerrit-Comment-Date: Wed, 04 Sep 2024 12:20:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jayvik Desai <jayvik(a)google.com>
Attention is currently required from: Dinesh Gehlot, Eran Mitrani, Jakub Czapiga, Kapil Porwal, Nick Vaccaro, Rishika Raj, Subrata Banik, Tarun.
Arthur Heymans has posted comments on this change by Arthur Heymans. ( https://review.coreboot.org/c/coreboot/+/84205?usp=email )
Change subject: soc/intel/{adl,mtl}: Don't set up SPD on LPDDRx
......................................................................
Patch Set 3:
(1 comment)
File src/soc/intel/meteorlake/meminit.c:
https://review.coreboot.org/c/coreboot/+/84205/comment/8d14cb18_e4bae43b?us… :
PS2, Line 209: has_spd = true;
> > > > > > > Can you help me understand the purpose of `has_spd`? Does it mean the mainboard has an SPD chip and we'll read the hex file using SMBUS?
> > > > > >
> > > > > > would need_spd be a better name? LPDDRx DRAM technology does not use SPD and the code for SPD in soc/intel/common is doing doing undefined behavior like overflowing an array.
> > > > >
> > > > > Yes, that name sounds better. I'd like to suggest adding a comment that explains the purpose of this variable. People often confuse the SPD chip with the SPD hex data file. The code should make it clear that the SPD chip isn't required to read the SPD hex file (need_spd).
> > > >
> > > > No actually it's about SPD data and this code is wrong. The soc/intel/common code is simply wrong for LPDDRx. The loop over channels and dimms per channel is overflowing. There are no DIMMs in LPDDRx which is what need to be addressed.
> > >
> > > okay, so when you set `has_spd` or `need_spd`, are you saying that we will read SPD data over SMBUS and for lpddrx, we shall pass SPD hex file ?
> >
> > No that's not the issue. CONFIG_DIMM_MAX is 4 which is how large the array is for containing SPD pointers. LPDDRx has 16 bit per channel, so the code thinks there are 8 channels in total. CONFIG_DIMM_PER_CHANNEL is set to 2. The common code loops over channels and dimms per channel so it's overflowing. What is the appropriate fix? do you think.
> >
> > https://qa.coreboot.org/job/coreboot-gerrit/263746/testReport/junit/(root)/… is the compilation error with LTO which can detect the buffer overflow.
>
> will this work ?
> ```
> git diff
> diff --git a/src/soc/intel/common/block/memory/meminit.c b/src/soc/intel/common/block/memory/meminit.c
> index f583213254..cf12aff803 100644
> --- a/src/soc/intel/common/block/memory/meminit.c
> +++ b/src/soc/intel/common/block/memory/meminit.c
> @@ -189,12 +189,13 @@ void mem_populate_channel_data(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_m
> struct mem_channel_data *data)
> {
> size_t spd_md_len = 0, spd_dimm_len = 0;
> - bool have_dimms;
> + bool have_dimms = 0;
>
> memset(data, 0, sizeof(*data));
>
> read_spd_md(soc_mem_cfg, spd_info, half_populated, data, &spd_md_len);
> - have_dimms = read_spd_dimm(memupd, soc_mem_cfg, spd_info, half_populated, data,
> + if ((info->topo & MEM_TOPO_DIMM_MODULE)
> + have_dimms = read_spd_dimm(memupd, soc_mem_cfg, spd_info, half_populated, data,
> &spd_dimm_len);
>
> if (data->ch_population_flags == NO_CHANNEL_POPULATED)
> ```
I tried this. And looking more at it seems that this in fact a compiler bug. I'll play around with some options. It looks like even without lto this unused code would be in the binary. Maybe it's reasonable to move the memory type to Kconfig to optimize the code?
--
To view, visit https://review.coreboot.org/c/coreboot/+/84205?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ib3d4ed8032bb06b6d08fbc2dc4b697df88745243
Gerrit-Change-Number: 84205
Gerrit-PatchSet: 3
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Reviewer: Eran Mitrani <mitrani(a)google.com>
Gerrit-Reviewer: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Reviewer: Jayvik Desai <jayvik(a)google.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Reviewer: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Reviewer: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: Tarun <tstuli(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Rishika Raj <rishikaraj(a)google.com>
Gerrit-Attention: Eran Mitrani <mitrani(a)google.com>
Gerrit-Attention: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Attention: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Attention: Dinesh Gehlot <digehlot(a)google.com>
Gerrit-Attention: Nick Vaccaro <nvaccaro(a)chromium.org>
Gerrit-Attention: Tarun <tstuli(a)gmail.com>
Gerrit-Comment-Date: Wed, 04 Sep 2024 11:08:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Subrata Banik <subratabanik(a)google.com>
Comment-In-Reply-To: Arthur Heymans <arthur(a)aheymans.xyz>
Michał Żygowski has posted comments on this change by Michał Żygowski. ( https://review.coreboot.org/c/coreboot/+/84213?usp=email )
Change subject: mainboard/hardkernel: Add ODROID H4+ initial support
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
We are excited to see more community interest in the Odroid-H4 board, and would like to share a snapshot of our draft work, which has been in progress on the public Dasharo repo since 8th Aug: https://github.com/Dasharo/coreboot/pull/545
--
To view, visit https://review.coreboot.org/c/coreboot/+/84213?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Iee066cb0da27e3bf7ce52fc199396185912893aa
Gerrit-Change-Number: 84213
Gerrit-PatchSet: 1
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Comment-Date: Wed, 04 Sep 2024 09:45:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No