Attention is currently required from: Angel Pons, Arthur Heymans, Chen, Gang C, Christian Walter, Cliff Huang, Dinesh Gehlot, Eran Mitrani, Jakub Czapiga, Jeff Daly, Jincheng Li, Johnny Lin, Jonathan Zhang, Kapil Porwal, Lance Zhao, Lean Sheng Tan, Nick Vaccaro, Patrick Rudolph, Paul Menzel, Sean Rhodes, Shuo Liu, Subrata Banik, Tarun, Tim Chu, Tim Wawrzynczak, Vanessa Eusebio, Werner Zeh.
Nico Huber has posted comments on this change by Shuo Liu. ( https://review.coreboot.org/c/coreboot/+/82429?usp=email )
Change subject: acpi: Add support for DRHD size reporting
......................................................................
Patch Set 16: Code-Review+1
(4 comments)
File src/acpi/acpi_dmar.c:
https://review.coreboot.org/c/coreboot/+/82429/comment/c11ef7a9_ab0f418d?usp... :
PS16, Line 60: * Refer to chapter 8.3 of https://cdrdv2.intel.com/v1/dl/getContent/671081
This is true for the the whole _drhd functions, maybe place above?
Though, I'm not sure why we should mention that explicitly. We don't
do it for all the other lines in this file. Also, URLs usually break,
so referring to the spec by name (and optionnaly a current URL) would
be better.
https://review.coreboot.org/c/coreboot/+/82429/comment/c56b71d0_99cabb62?usp... :
PS16, Line 68: (1 << (drhd->size + 12)
That's just `size`, assuming it is a power of 2, if not we already have
another bug. Could also use the macro:
```
assert(IS_ALIGNED(bar, size));
```
and optionally
```
assert(IS_POWER_OF_2(size));
```
and if we wanted to be really thorough
```
assert(size >= 4*KiB);
```
or all `size` assertions in one line
```
assert(4*KiB <= size && size <= (1 << 15) * 4*KiB && IS_POWER_OF_2(size));
```
NB. Assertion on the input parameters is usually placed at the top of a function.
File src/include/acpi/acpi.h:
https://review.coreboot.org/c/coreboot/+/82429/comment/1714956a_335c309b?usp... :
PS16, Line 1855: u32
Please use `size_t` for byte sizes.
File src/include/acpi/acpi.h:
https://review.coreboot.org/c/coreboot/+/82429/comment/4a6ae4dd_67e1bdec?usp... :
PS15, Line 1852: unsigned long acpi_create_dmar_drhd(unsigned long current, u8 flags,
: u16 segment, u64 bar, u32 size);
To avoid having to touch all platforms, would it make sense to have a specialised acpi_create_dmar_drhd_4k function?
Really no strong feelings about this, but if not touching all platforms was
the goal, the function with the added parameter could be named something like
acpi_create_dmar_drhd_size(). The _4k() is more explicit, though, so I don't
mind touching all platforms.
--
To view, visit
https://review.coreboot.org/c/coreboot/+/82429?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: I49dd5de2eca257a5f6240e36d05755cabca96d1c
Gerrit-Change-Number: 82429
Gerrit-PatchSet: 16
Gerrit-Owner: Shuo Liu
shuo.liu@intel.com
Gerrit-Reviewer: Angel Pons
th3fanbus@gmail.com
Gerrit-Reviewer: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Reviewer: Chen, Gang C
gang.c.chen@intel.com
Gerrit-Reviewer: Christian Walter
christian.walter@9elements.com
Gerrit-Reviewer: Cliff Huang
cliff.huang@intel.com
Gerrit-Reviewer: Dinesh Gehlot
digehlot@google.com
Gerrit-Reviewer: Eran Mitrani
mitrani@google.com
Gerrit-Reviewer: Jakub Czapiga
czapiga@google.com
Gerrit-Reviewer: Jeff Daly
jeffd@silicom-usa.com
Gerrit-Reviewer: Jincheng Li
jincheng.li@intel.com
Gerrit-Reviewer: Johnny Lin
Johnny_Lin@wiwynn.com
Gerrit-Reviewer: Jonathan Zhang
jon.zhixiong.zhang@gmail.com
Gerrit-Reviewer: Kapil Porwal
kapilporwal@google.com
Gerrit-Reviewer: Lance Zhao
lance.zhao@gmail.com
Gerrit-Reviewer: Lean Sheng Tan
sheng.tan@9elements.com
Gerrit-Reviewer: Nick Vaccaro
nvaccaro@chromium.org
Gerrit-Reviewer: Nico Huber
nico.h@gmx.de
Gerrit-Reviewer: Patrick Rudolph
patrick.rudolph@9elements.com
Gerrit-Reviewer: Sean Rhodes
sean@starlabs.systems
Gerrit-Reviewer: Subrata Banik
subratabanik@google.com
Gerrit-Reviewer: Tarun
tstuli@gmail.com
Gerrit-Reviewer: Tim Chu
Tim.Chu@quantatw.com
Gerrit-Reviewer: Tim Wawrzynczak
inforichland@gmail.com
Gerrit-Reviewer: Vanessa Eusebio
vanessa.f.eusebio@intel.com
Gerrit-Reviewer: Werner Zeh
werner.zeh@siemens.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Eran Mitrani
mitrani@google.com
Gerrit-Attention: Jakub Czapiga
czapiga@google.com
Gerrit-Attention: Patrick Rudolph
patrick.rudolph@9elements.com
Gerrit-Attention: Jonathan Zhang
jon.zhixiong.zhang@gmail.com
Gerrit-Attention: Dinesh Gehlot
digehlot@google.com
Gerrit-Attention: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Nick Vaccaro
nvaccaro@chromium.org
Gerrit-Attention: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Attention: Sean Rhodes
sean@starlabs.systems
Gerrit-Attention: Subrata Banik
subratabanik@google.com
Gerrit-Attention: Johnny Lin
Johnny_Lin@wiwynn.com
Gerrit-Attention: Christian Walter
christian.walter@9elements.com
Gerrit-Attention: Lean Sheng Tan
sheng.tan@9elements.com
Gerrit-Attention: Werner Zeh
werner.zeh@siemens.com
Gerrit-Attention: Tim Chu
Tim.Chu@quantatw.com
Gerrit-Attention: Jeff Daly
jeffd@silicom-usa.com
Gerrit-Attention: Cliff Huang
cliff.huang@intel.com
Gerrit-Attention: Angel Pons
th3fanbus@gmail.com
Gerrit-Attention: Tarun
tstuli@gmail.com
Gerrit-Attention: Lance Zhao
lance.zhao@gmail.com
Gerrit-Attention: Chen, Gang C
gang.c.chen@intel.com
Gerrit-Attention: Kapil Porwal
kapilporwal@google.com
Gerrit-Attention: Tim Wawrzynczak
inforichland@gmail.com
Gerrit-Attention: Vanessa Eusebio
vanessa.f.eusebio@intel.com
Gerrit-Attention: Shuo Liu
shuo.liu@intel.com
Gerrit-Attention: Jincheng Li
jincheng.li@intel.com
Gerrit-Comment-Date: Tue, 25 Jun 2024 09:25:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Angel Pons
th3fanbus@gmail.com
Comment-In-Reply-To: Shuo Liu
shuo.liu@intel.com