Attention is currently required from: Edward O'Callaghan, Angel Pons.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/62996 )
Change subject: dmi.c: Ensure g_has_dmi_support is default on shutdown
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Patchset:
PS1:
Looks fine for me, would like to have a second opinion if I missed something
--
To view, visit https://review.coreboot.org/c/flashrom/+/62996
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0674950304736e53d014117d287682a4f6349879
Gerrit-Change-Number: 62996
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 22 Mar 2022 11:55:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/62996 )
Change subject: dmi.c: Ensure g_has_dmi_support is default on shutdown
......................................................................
dmi.c: Ensure g_has_dmi_support is default on shutdown
Ensure the g_has_dmi_support has the default state
of false after the life-time has expired.
BUG=none
TEST=builds
Change-Id: I0674950304736e53d014117d287682a4f6349879
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M dmi.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/96/62996/1
diff --git a/dmi.c b/dmi.c
index a82b494..7c0fc4c 100644
--- a/dmi.c
+++ b/dmi.c
@@ -386,6 +386,7 @@
free(dmi_strings[i].value);
dmi_strings[i].value = NULL;
}
+ g_has_dmi_support = false;
return 0;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/62996
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0674950304736e53d014117d287682a4f6349879
Gerrit-Change-Number: 62996
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Edward O'Callaghan, Angel Pons.
Hello build bot (Jenkins), Thomas Heijligen, Angel Pons, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/59283
to look at the new patch set (#4).
Change subject: dmi.c: Hide has_dmi_support global behind method
......................................................................
dmi.c: Hide has_dmi_support global behind method
This allows has_dmi_support to be become static local
to just the scope of dmi.c
BUG=none
TEST=builds
Change-Id: Ibded9714998ea6f2e5d4e0512fa7c6b105f9638a
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M board_enable.c
M dmi.c
M programmer.h
3 files changed, 10 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/83/59283/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/59283
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibded9714998ea6f2e5d4e0512fa7c6b105f9638a
Gerrit-Change-Number: 59283
Gerrit-PatchSet: 4
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/62405 )
Change subject: board_enable.c: Port to use pcidev_find_vendorclass() helper
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
I want to have a deeper look into this before approving it. Unfortunately I'm on vacation at this time and haven't the resources to dig deeper in the code. Can you wait two weeks? Otherwise please find someone else for the review.
The first impression seams fine.
--
To view, visit https://review.coreboot.org/c/flashrom/+/62405
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3d8e3dbd5eeb057d7c959a82678cca2345fc69d9
Gerrit-Change-Number: 62405
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Tue, 22 Mar 2022 08:42:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Angel Pons.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59283 )
Change subject: dmi.c: Hide has_dmi_support global behind method
......................................................................
Patch Set 3: Code-Review+1
(1 comment)
File dmi.c:
https://review.coreboot.org/c/flashrom/+/59283/comment/a84aec94_b84bd32e
PS3, Line 388: }
> I am inclined to put `g_has_dmi_support = false;` here but not sure if it should be a separate patch […]
A separate patch is better.
--
To view, visit https://review.coreboot.org/c/flashrom/+/59283
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibded9714998ea6f2e5d4e0512fa7c6b105f9638a
Gerrit-Change-Number: 59283
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 22 Mar 2022 08:29:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Angel Pons.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59281 )
Change subject: pcidev.c: Simplify by consolidating common logic
......................................................................
Patch Set 6:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/59281/comment/5466c41b_334b6e14
PS5, Line 10: initialises the device ID to -1
> Fixed?
Only nits left: Please place dots at the end of a sentence, the first letter of a new sentence have to be upper case. I would place the new line on top of the link.
--
To view, visit https://review.coreboot.org/c/flashrom/+/59281
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0048fc6ab816d230ff48c84bc17122431753d55d
Gerrit-Change-Number: 59281
Gerrit-PatchSet: 6
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 22 Mar 2022 08:20:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Martin L Roth, Edward O'Callaghan, Angel Pons, Anastasia Klimchuk, Nikolai Artemiev.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/62898 )
Change subject: hwaccess: replace macros by C code
......................................................................
Patch Set 6:
(3 comments)
File hwaccess.h:
https://review.coreboot.org/c/flashrom/+/62898/comment/445b23fd_e3e3b711
PS6, Line 34: inline
> Okay, I thought you wanted it to always be inline to match what the macro was doing. […]
As a hint. From a C language perspective it's the best to inline it. The compiler may change this afterwards depending on the optimizations enabled and that should also be fine.
https://review.coreboot.org/c/flashrom/+/62898/comment/c0eb4d29_54466b4f
PS6, Line 74: * `__return_swapped(cpu_to_be, 8)`
typo s/__return/___return/
File hwaccess.h:
https://review.coreboot.org/c/flashrom/+/62898/comment/29230a41_b0c3d12e
PS2, Line 84: #define be_to_cpu8 cpu_to_be8
: #define be_to_cpu16 cpu_to_be16
: #define be_to_cpu32 cpu_to_be32
: #define be_to_cpu64 cpu_to_be64
: #define le_to_cpu8 cpu_to_le8
: #define le_to_cpu16 cpu_to_le16
: #define le_to_cpu32 cpu_to_le32
: #define le_to_cpu64 cpu_to_le64
:
> IMO, this part seems easy to understand and spares us error-prone […]
The duplications in the .c files are replaced by macros. This should address this issue in adequate way.
--
To view, visit https://review.coreboot.org/c/flashrom/+/62898
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I86d38d816b37c283279c485fac8027f8fb94364a
Gerrit-Change-Number: 62898
Gerrit-PatchSet: 6
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Martin L Roth <martinroth(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Martin L Roth <martinroth(a)google.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Tue, 22 Mar 2022 08:02:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Martin L Roth <martinroth(a)google.com>
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: comment
Attention is currently required from: Damien Zammit.
Hello Damien Zammit,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/flashrom/+/62983
to review the following change.
Change subject: Prepare for IFD check_access support
......................................................................
Prepare for IFD check_access support
Based off work in collaboration with Damien Zammit.
The following is intended to allow flashrom to query
the spi or opaque master for access permissions before
attempting to access a given region. This comes up in
cases such as the ichspi driver where the CSME can
deny regions access.
Change-Id: If7bdcac2a4109efbc70abc2d6ae0561f39449004
Signed-off-by: Damien Zammit <damien(a)zamaudio.com>
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M chipdrivers.h
M flash.h
M flashrom.c
M opaque.c
M programmer.h
M spi.c
M spi.h
7 files changed, 31 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/83/62983/1
diff --git a/chipdrivers.h b/chipdrivers.h
index c223534..1a4e617 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -115,6 +115,7 @@
int read_opaque(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int write_opaque(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int erase_opaque(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen);
+int check_access_opaque(const struct flashctx *flash, unsigned int start, unsigned int len, int write);
/* at45db.c */
int probe_spi_at45db(struct flashctx *flash);
diff --git a/flash.h b/flash.h
index f63aa5d..9882fb6 100644
--- a/flash.h
+++ b/flash.h
@@ -267,6 +267,7 @@
int (*read) (struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
uint8_t (*read_status) (const struct flashctx *flash);
int (*write_status) (const struct flashctx *flash, int status);
+ int (*check_access) (const struct flashctx *flash, unsigned int start, unsigned int len, int write);
struct voltage {
uint16_t min;
uint16_t max;
diff --git a/flashrom.c b/flashrom.c
index ac61259..8266be9 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1060,11 +1060,22 @@
{
const struct flashrom_layout *const layout = get_layout(flashctx);
const struct romentry *entry = NULL;
+ int ret;
while ((entry = layout_next_included(layout, entry))) {
const chipoff_t region_start = entry->start;
const chipsize_t region_len = entry->end - entry->start + 1;
+ if (flashctx->mst->buses_supported & BUS_PROG) {
+ ret = check_access_opaque(flashctx, region_start, region_len, 0);
+ if (!ret)
+ continue;
+ } else if (flashctx->mst->buses_supported & BUS_SPI) {
+ ret = check_access_spi(flashctx, region_start, region_len, 0);
+ if (!ret)
+ continue;
+ }
+
if (flashctx->chip->read(flashctx, buffer + region_start, region_start, region_len))
return 1;
}
diff --git a/opaque.c b/opaque.c
index 7704ec7..8633a16 100644
--- a/opaque.c
+++ b/opaque.c
@@ -46,6 +46,13 @@
return flash->mst->opaque.erase(flash, blockaddr, blocklen);
}
+int check_access_opaque(const struct flashctx *flash, unsigned int start, unsigned int len, int write)
+{
+ if (flash->mst->opaque.check_access)
+ return flash->mst->opaque.check_access(flash, start, len, write);
+ return 1;
+}
+
int register_opaque_master(const struct opaque_master *mst, void *data)
{
struct registered_master rmst = {0};
diff --git a/programmer.h b/programmer.h
index c79422c..2a5f2a9 100644
--- a/programmer.h
+++ b/programmer.h
@@ -312,6 +312,7 @@
int (*read)(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int (*write_256)(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int (*write_aai)(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
+ int (*check_access)(const struct flashctx *flash, unsigned int start, unsigned int len, int write);
int (*shutdown)(void *data);
void *data;
};
@@ -322,6 +323,7 @@
int default_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int default_spi_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int default_spi_write_aai(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
+int check_access_spi(const struct flashctx *flash, unsigned int start, unsigned int len, int write);
int register_spi_master(const struct spi_master *mst, void *data);
/* The following enum is needed by ich_descriptor_tool and ich* code as well as in chipset_enable.c. */
@@ -402,6 +404,7 @@
int (*read) (struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int (*write) (struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int (*erase) (struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen);
+ int (*check_access) (const struct flashctx *flash, unsigned int start, unsigned int len, int write);
int (*shutdown)(void *data);
void *data;
};
diff --git a/spi.c b/spi.c
index f2e91c4..6c640fd 100644
--- a/spi.c
+++ b/spi.c
@@ -131,6 +131,13 @@
return flash->mst->spi.write_aai(flash, buf, start, len);
}
+int check_access_spi(const struct flashctx *flash, unsigned int start, unsigned int len, int write)
+{
+ if (flash->mst->spi.check_access)
+ return flash->mst->spi.check_access(flash, start, len, write);
+ return 1;
+}
+
int register_spi_master(const struct spi_master *mst, void *data)
{
struct registered_master rmst = {0};
diff --git a/spi.h b/spi.h
index 845b6c2..93c8aa1 100644
--- a/spi.h
+++ b/spi.h
@@ -208,6 +208,7 @@
#define SPI_INVALID_LENGTH -4
#define SPI_FLASHROM_BUG -5
#define SPI_PROGRAMMER_ERROR -6
+#define SPI_ACCESS_DENIED -7
void clear_spi_id_cache(void);
--
To view, visit https://review.coreboot.org/c/flashrom/+/62983
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If7bdcac2a4109efbc70abc2d6ae0561f39449004
Gerrit-Change-Number: 62983
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Damien Zammit
Gerrit-Attention: Damien Zammit
Gerrit-MessageType: newchange
Attention is currently required from: Thomas Heijligen.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/62405 )
Change subject: board_enable.c: Port to use pcidev_find_vendorclass() helper
......................................................................
Patch Set 3:
(1 comment)
This change is ready for review.
Patchset:
PS3:
Unclear if multiple ISA bridges is ever a thing?
--
To view, visit https://review.coreboot.org/c/flashrom/+/62405
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3d8e3dbd5eeb057d7c959a82678cca2345fc69d9
Gerrit-Change-Number: 62405
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Tue, 22 Mar 2022 06:07:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/59283 )
Change subject: dmi.c: Hide has_dmi_support global behind method
......................................................................
Patch Set 3:
(1 comment)
File dmi.c:
https://review.coreboot.org/c/flashrom/+/59283/comment/0cc2e78d_937b06bc
PS3, Line 388: }
I am inclined to put `g_has_dmi_support = false;` here but not sure if it should be a separate patch as it is a change in behavior?
--
To view, visit https://review.coreboot.org/c/flashrom/+/59283
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibded9714998ea6f2e5d4e0512fa7c6b105f9638a
Gerrit-Change-Number: 59283
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Tue, 22 Mar 2022 06:05:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment