intel/common/sgx: Use intel_mp_current_microcode() to get microcode pointer

Get microcode patch pointer from intel_mp_current_microcode() api
of mp_init and change sgx_configure function signature to drop
microcode_patch param.

Change-Id: I9196c30ec7ea52d7184a96b33835def197e2c799
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/21009
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Pratik Prajapati
2017-08-14 13:47:03 -07:00
committed by Aaron Durbin
parent 226065834b
commit 57f8386a2b
3 changed files with 8 additions and 4 deletions

View File

@@ -25,6 +25,6 @@ void cpu_lock_sgx_memory(void);
/* /*
* Configure SGX. * Configure SGX.
*/ */
void sgx_configure(const void *microcode_patch); void sgx_configure(void);
#endif /* SOC_INTEL_COMMON_BLOCK_SGX_H */ #endif /* SOC_INTEL_COMMON_BLOCK_SGX_H */

View File

@@ -13,11 +13,13 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include <assert.h>
#include <console/console.h> #include <console/console.h>
#include <chip.h> #include <chip.h>
#include <cpu/x86/msr.h> #include <cpu/x86/msr.h>
#include <cpu/x86/mtrr.h> #include <cpu/x86/mtrr.h>
#include <cpu/intel/microcode.h> #include <cpu/intel/microcode.h>
#include <intelblocks/mp_init.h>
#include <intelblocks/sgx.h> #include <intelblocks/sgx.h>
#include <soc/cpu.h> #include <soc/cpu.h>
#include <soc/msr.h> #include <soc/msr.h>
@@ -125,10 +127,12 @@ static void activate_sgx(void)
} }
} }
void sgx_configure(const void *microcode_patch) void sgx_configure(void)
{ {
device_t dev = SA_DEV_ROOT; device_t dev = SA_DEV_ROOT;
assert(dev != NULL);
config_t *conf = dev->chip_info; config_t *conf = dev->chip_info;
const void *microcode_patch = intel_mp_current_microcode();
if (!conf->sgx_enable || !is_sgx_supported()) if (!conf->sgx_enable || !is_sgx_supported())
return; return;

View File

@@ -438,7 +438,7 @@ void soc_core_init(device_t cpu, const void *microcode)
enable_turbo(); enable_turbo();
/* Configure SGX */ /* Configure SGX */
sgx_configure(microcode); sgx_configure();
} }
static int adjust_apic_id(int index, int apic_id) static int adjust_apic_id(int index, int apic_id)
@@ -505,7 +505,7 @@ void soc_init_cpus(struct bus *cpu_bus, const void *microcode)
* here to get SGX enabled on BSP. This behavior needs to root-caused * here to get SGX enabled on BSP. This behavior needs to root-caused
* and we shall not have this redundant call. * and we shall not have this redundant call.
*/ */
sgx_configure(microcode); sgx_configure();
} }
int soc_skip_ucode_update(u32 current_patch_id, u32 new_patch_id) int soc_skip_ucode_update(u32 current_patch_id, u32 new_patch_id)