aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/skylake/irq.c
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2022-06-18 12:01:36 +0200
committerAngel Pons <th3fanbus@gmail.com>2022-12-17 12:36:33 +0000
commit816919b3c8886243111ac636b5371e37f90b7531 (patch)
treeb38afd48cc1295c7079a1dda44afb03f885bc3cc /src/soc/intel/skylake/irq.c
parentfd618f332541bc6631bc2ae0a166e34f92448d93 (diff)
soc/intel/skylake/irq.c: Fix undefined `memcpy()`
The original value of the `DevIntConfigPtr` is unknown, and there's no way to be absolutely certain that it actually points to usable memory. Instead of copying the data, update the pointer's address to reference the global variable directly. It is assumed that FSP does not write to the memory pointed by `DevIntConfigPtr`. Confirming this assumption is pointless; one might as well reimplement FSP instead. Change-Id: I90594cc09e3fa2aef98658441c323a44a869635b Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65217 Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Diffstat (limited to 'src/soc/intel/skylake/irq.c')
-rw-r--r--src/soc/intel/skylake/irq.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/soc/intel/skylake/irq.c b/src/soc/intel/skylake/irq.c
index 2f0fd97a77..8a9ec813cd 100644
--- a/src/soc/intel/skylake/irq.c
+++ b/src/soc/intel/skylake/irq.c
@@ -165,20 +165,15 @@ static const SI_PCH_DEVICE_INTERRUPT_CONFIG devintconfig[] = {
void soc_irq_settings(FSP_SIL_UPD *params)
{
-
- uint32_t i, intdeventry;
+ uint32_t i;
u8 irq_config[PCH_MAX_IRQ_CONFIG];
const struct device *dev = pcidev_path_on_root(PCH_DEVFN_LPC);
const struct soc_intel_skylake_config *config = config_of(dev);
- /* Get Device Int Count */
- intdeventry = ARRAY_SIZE(devintconfig);
/* update irq table */
- memcpy((SI_PCH_DEVICE_INTERRUPT_CONFIG *)
- (uintptr_t)(params->DevIntConfigPtr), devintconfig, intdeventry *
- sizeof(SI_PCH_DEVICE_INTERRUPT_CONFIG));
+ params->DevIntConfigPtr = (UINT32)(uintptr_t)devintconfig;
+ params->NumOfDevIntConfig = ARRAY_SIZE(devintconfig);
- params->NumOfDevIntConfig = intdeventry;
/* PxRC to IRQ programming */
for (i = 0; i < PCH_MAX_IRQ_CONFIG; i++) {
switch (i) {