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>
This commit is contained in:
Angel Pons 2022-06-18 12:01:36 +02:00
parent fd618f3325
commit 816919b3c8
1 changed files with 3 additions and 8 deletions

View File

@ -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) {