Attention is currently required from: Eran Mitrani, Jakub Czapiga, Kapil Porwal, Pratikkumar Prajapati, Subrata Banik, Tarun Tuli.
Hello Pratikkumar Prajapati,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/77240?usp=email
to review the following change.
Change subject: soc/intel/meteorlake: Use bitwise OR instead of addition ......................................................................
soc/intel/meteorlake: Use bitwise OR instead of addition
Use bitwise OR instead of addition while reading 64bit data.
BUG=b:262501347 TEST=Able to build REX. Able to trigger and decode crashlog.
Change-Id: Ic33593dd678146bc415b43671d1d9bf45de407a9 Signed-off-by: Pratikkumar Prajapati pratikkumar.v.prajapati@intel.corp-partner.google.com --- M src/soc/intel/meteorlake/crashlog.c 1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/77240/1
diff --git a/src/soc/intel/meteorlake/crashlog.c b/src/soc/intel/meteorlake/crashlog.c index 657cd7d..3daadff 100644 --- a/src/soc/intel/meteorlake/crashlog.c +++ b/src/soc/intel/meteorlake/crashlog.c @@ -33,7 +33,7 @@
static u64 get_disc_tab_header(u32 addr) { - return ((u64)read32((u32 *) addr) + + return ((u64)read32((u32 *) addr) | ((u64)read32((u32 *)(addr + 4)) << 32)); }
@@ -398,8 +398,7 @@ }
memset(&cpu_cl_disc_tab, 0, sizeof(cpu_crashlog_discovery_table_t)); - cpu_cl_disc_tab.header.data = ((u64)read32((u32 *)disc_tab_addr) + - ((u64)read32((u32 *)(disc_tab_addr + 4)) << 32)); + cpu_cl_disc_tab.header.data = get_disc_tab_header(disc_tab_addr);
printk(BIOS_DEBUG, "cpu_crashlog_discovery_table buffer count: 0x%x\n", cpu_cl_disc_tab.header.fields.count); @@ -420,9 +419,10 @@ break; }
- cpu_cl_disc_tab.buffers[i].data = ((u64)read32((u32 *)(disc_tab_addr + - cur_offset)) + ((u64)read32((u32 *) - (disc_tab_addr + cur_offset + 4)) << 32)); + u64 data64 = ((u64)read32((u32 *)(disc_tab_addr + cur_offset)) | + ((u64)read32((u32 *)(disc_tab_addr + cur_offset + 4)) << 32)); + cpu_cl_disc_tab.buffers[i].data = data64; + printk(BIOS_DEBUG, "cpu_crashlog_discovery_table buffer: 0x%x size: " "0x%x offset: 0x%x\n", i, cpu_cl_disc_tab.buffers[i].fields.size, cpu_cl_disc_tab.buffers[i].fields.offset);