[coreboot-gerrit] Change in coreboot[master]: soc/intel/common/block: Add Intel common PCR support

Furquan Shaikh (Code Review) gerrit at coreboot.org
Wed Mar 29 19:22:09 CEST 2017


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/intelblocks/pcr.h
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 at intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra at intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan at intel.com>
Gerrit-Reviewer: Barnali Sarkar <barnali.sarkar at intel.com>
Gerrit-Reviewer: Bora Guvendik <bora.guvendik at intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams at intel.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Shaunak Saha <shaunak.saha at intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik at intel.com>
Gerrit-Reviewer: build bot (Jenkins)
Gerrit-Reviewer: dhaval v sharma <dhaval.v.sharma at intel.com>
Gerrit-HasComments: Yes



More information about the coreboot-gerrit mailing list