Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/18669 )
Change subject: soc/intel/common/block: Add Intel common PCR support
......................................................................
Patch Set 5:
(7 comments)
https://review.coreboot.org/#/c/18669/5/src/soc/intel/common/block/include/…
File src/soc/intel/common/block/include/intelblocks/pcr.h:
PS5, Line 20: #include <stddef.h>
What is this required for?
https://review.coreboot.org/#/c/18669/5/src/soc/intel/common/block/pcr/pcr.c
File src/soc/intel/common/block/pcr/pcr.c:
PS5, Line 34: return pcr_reg_address(pid, offset);
Can we just pull in the above pcr_reg_address code into this? This function isn't doing other than returning whatever pcr_reg_address returns.
Line 112: read32(pcr_reg_address(pid, offset));
> Again, this is still wrong. offset could be misaligned. Therefore you shoul
Maybe we could define the functions as:
pch_pcr_read(void *addr, size_t size, void *data)
pch_pcr_write(void *addr, size_t size, void *data)
and within pch_pcr_write we can simply call pch_pcr_read(addr, size, data); as a dummy read that Aaron suggested. We wouldn't have to recalculate pcr_reg_address again in that case.
PS5, Line 133: Write PCR register. (This is internal function)
This might need a better explanation. Its a read-modify-write and not just a write.
PS5, Line 140: pcr_and_then_or
nitpick: We have two internal functions with prefix pch_ and one with pcr_. Might help to make it more consistent.
PS5, Line 145: if (pch_pcr_read(pid, offset, size, &data32) != 0)
: return -1;
:
: data32 &= anddata;
: data32 |= ordata;
:
: return pch_pcr_write(pid, offset, size, data32);
Right now this is recalculating pcr_reg_address three times. If we change to passing in void *addr to pch_pcr_read/pch_pcr_write, we can avoid doing that.
PS5, Line 154: pcr_andthenor32
can we follow the same convention as above: pcr_and_then_or_32 or something? Its easier to read that way.
--
To view, visit https://review.coreboot.org/18669
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I78526a86b6d10f226570c08050327557e0bb2c78
Gerrit-PatchSet: 5
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan(a)intel.com>
Gerrit-Reviewer: Barnali Sarkar <barnali.sarkar(a)intel.com>
Gerrit-Reviewer: Bora Guvendik <bora.guvendik(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams(a)intel.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Shaunak Saha <shaunak.saha(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins)
Gerrit-Reviewer: dhaval v sharma <dhaval.v.sharma(a)intel.com>
Gerrit-HasComments: Yes