drivers/soc/cse: Fix overflow in CSE telemetry calculation

MSEC_TO_USEC(cse_perf_data.timestamp[i]) does overflow.
Here is an example, if cse_perf_data.timestamp[i] value is
4304903 milliseconds. When multiplied by 1000 to convert to
microseconds, the value becomes 0x979B58 instead of 0x100979B58.

TEST=Boot to OS

Change-Id: I09cc00aa595a821a57a34c38a4435e433e935ad3
Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86215
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
This commit is contained in:
Bora Guvendik 2025-01-29 08:02:44 -08:00 committed by Subrata Banik
commit 4d5587b21e

View file

@ -4,7 +4,7 @@
#include <intelblocks/cse.h>
#include <timestamp.h>
#define MSEC_TO_USEC(x) (x * 1000)
#define MSEC_TO_USEC(x) ((s64)x * 1000)
enum cb_err cse_get_boot_performance_data(struct cse_boot_perf_rsp *boot_perf_rsp)
{