| 1 |
|
| 2 |
|
| 3 |
#include <acpi/acpi_gnvs.h> |
| 4 |
#include <cbmem.h> |
| 5 |
#include <commonlib/helpers.h> |
| 6 |
#include <commonlib/region.h> |
| 7 |
#include <console/console.h> |
| 8 |
#include <cpu/cpu.h> |
| 9 |
#include <cpu/x86/smm.h> |
| 10 |
#include <device/device.h> |
| 11 |
#include <device/mmio.h> |
| 12 |
#include <rmodule.h> |
| 13 |
#include <smmstore.h> |
| 14 |
#include <stdio.h> |
| 15 |
#include <string.h> |
| 16 |
#include <types.h> |
| 17 |
|
| 18 |
#define SMM_CODE_SEGMENT_SIZE 0x10000 |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
extern unsigned char _binary_smmstub_start[]; |
| 35 |
|
| 36 |
|
| 37 |
#define SMM_MINIMUM_STACK_SIZE 32 |
| 38 |
|
| 39 |
struct cpu_smm_info { |
| 40 |
uint8_t active; |
| 41 |
uintptr_t smbase; |
| 42 |
struct region ss; |
| 43 |
struct region stub_code; |
| 44 |
}; |
| 45 |
struct cpu_smm_info cpus[CONFIG_MAX_CPUS] = { 0 }; |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
static int smm_create_map(const uintptr_t smbase, const unsigned int num_cpus, |
| 85 |
const struct smm_loader_params *params) |
| 86 |
{ |
| 87 |
struct rmodule smm_stub; |
| 88 |
|
| 89 |
if (ARRAY_SIZE(cpus) < num_cpus) { |
| 90 |
printk(BIOS_ERR, "%s: increase MAX_CPUS in Kconfig\n", __func__); |
| 91 |
return 0; |
| 92 |
} |
| 93 |
|
| 94 |
if (rmodule_parse(&_binary_smmstub_start, &smm_stub)) { |
| 95 |
printk(BIOS_ERR, "%s: unable to get SMM module size\n", __func__); |
| 96 |
return 0; |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
const size_t stub_size = rmodule_memory_size(&smm_stub); |
| 104 |
const size_t needed_ss_size = MAX(params->cpu_save_state_size, stub_size); |
| 105 |
const size_t cpus_per_segment = |
| 106 |
(SMM_CODE_SEGMENT_SIZE - SMM_ENTRY_OFFSET - stub_size) / needed_ss_size; |
| 107 |
|
| 108 |
if (cpus_per_segment == 0) { |
| 109 |
printk(BIOS_ERR, "%s: CPUs won't fit in segment. Broken stub or save state size\n", |
| 110 |
__func__); |
| 111 |
return 0; |
| 112 |
} |
| 113 |
|
| 114 |
for (unsigned int i = 0; i < num_cpus; i++) { |
| 115 |
const size_t segment_number = i / cpus_per_segment; |
| 116 |
cpus[i].smbase = smbase - SMM_CODE_SEGMENT_SIZE * segment_number |
| 117 |
- needed_ss_size * (i % cpus_per_segment); |
| 118 |
cpus[i].stub_code = region_create(cpus[i].smbase + SMM_ENTRY_OFFSET, stub_size); |
| 119 |
cpus[i].ss = region_create( |
| 120 |
cpus[i].smbase + SMM_CODE_SEGMENT_SIZE - params->cpu_save_state_size, |
| 121 |
params->cpu_save_state_size); |
| 122 |
cpus[i].active = 1; |
| 123 |
} |
| 124 |
|
| 125 |
return 1; |
| 126 |
} |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
u32 smm_get_cpu_smbase(unsigned int cpu_num) |
| 136 |
{ |
| 137 |
if (cpu_num < CONFIG_MAX_CPUS) { |
| 138 |
if (cpus[cpu_num].active) |
| 139 |
return cpus[cpu_num].smbase; |
| 140 |
} |
| 141 |
return 0; |
| 142 |
} |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
static void smm_place_entry_code(const unsigned int num_cpus) |
| 164 |
{ |
| 165 |
unsigned int i; |
| 166 |
size_t size; |
| 167 |
|
| 168 |
|
| 169 |
size = region_sz(&cpus[0].stub_code); |
| 170 |
for (i = 1; i < num_cpus; i++) { |
| 171 |
printk(BIOS_DEBUG, |
| 172 |
"SMM Module: placing smm entry code at %zx, cpu # 0x%x\n", |
| 173 |
region_offset(&cpus[i].stub_code), i); |
| 174 |
memcpy((void *)region_offset(&cpus[i].stub_code), |
| 175 |
(void *)region_offset(&cpus[0].stub_code), size); |
| 176 |
printk(BIOS_SPEW, "%s: copying from %zx to %zx 0x%zx bytes\n", |
| 177 |
__func__, region_offset(&cpus[0].stub_code), |
| 178 |
region_offset(&cpus[i].stub_code), size); |
| 179 |
} |
| 180 |
} |
| 181 |
|
| 182 |
static uintptr_t stack_top; |
| 183 |
static size_t g_stack_size; |
| 184 |
|
| 185 |
int smm_setup_stack(const uintptr_t perm_smbase, const size_t perm_smram_size, |
| 186 |
const unsigned int total_cpus, const size_t stack_size) |
| 187 |
{ |
| 188 |
|
| 189 |
if (stack_size <= SMM_MINIMUM_STACK_SIZE || (stack_size & 3) != 0) { |
| 190 |
printk(BIOS_ERR, "%s: need minimum stack size\n", __func__); |
| 191 |
return -1; |
| 192 |
} |
| 193 |
|
| 194 |
const size_t total_stack_size = total_cpus * stack_size; |
| 195 |
if (total_stack_size >= perm_smram_size) { |
| 196 |
printk(BIOS_ERR, "%s: Stack won't fit smram\n", __func__); |
| 197 |
return -1; |
| 198 |
} |
| 199 |
stack_top = perm_smbase + total_stack_size; |
| 200 |
g_stack_size = stack_size; |
| 201 |
return 0; |
| 202 |
} |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
static void smm_stub_place_staggered_entry_points(const struct smm_loader_params *params) |
| 210 |
{ |
| 211 |
if (params->num_concurrent_save_states > 1) |
| 212 |
smm_place_entry_code(params->num_concurrent_save_states); |
| 213 |
} |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
static int smm_module_setup_stub(const uintptr_t smbase, const size_t smm_size, |
| 238 |
struct smm_loader_params *params) |
| 239 |
{ |
| 240 |
struct rmodule smm_stub; |
| 241 |
if (rmodule_parse(&_binary_smmstub_start, &smm_stub)) { |
| 242 |
printk(BIOS_ERR, "%s: unable to parse smm stub\n", __func__); |
| 243 |
return -1; |
| 244 |
} |
| 245 |
const size_t stub_size = rmodule_memory_size(&smm_stub); |
| 246 |
|
| 247 |
|
| 248 |
if (stub_size >= SMM_ENTRY_OFFSET) { |
| 249 |
printk(BIOS_ERR, "%s: Stub too large\n", __func__); |
| 250 |
return -1; |
| 251 |
} |
| 252 |
|
| 253 |
const uintptr_t smm_stub_loc = smbase + SMM_ENTRY_OFFSET; |
| 254 |
if (rmodule_load((void *)smm_stub_loc, &smm_stub)) { |
| 255 |
printk(BIOS_ERR, "%s: load module failed\n", __func__); |
| 256 |
return -1; |
| 257 |
} |
| 258 |
|
| 259 |
struct smm_stub_params *stub_params = rmodule_parameters(&smm_stub); |
| 260 |
stub_params->stack_top = stack_top; |
| 261 |
stub_params->stack_size = g_stack_size; |
| 262 |
stub_params->c_handler = (uintptr_t)params->handler; |
| 263 |
stub_params->cr3 = params->cr3; |
| 264 |
|
| 265 |
|
| 266 |
struct cpu_info *info = cpu_info(); |
| 267 |
if (!info || !info->cpu) { |
| 268 |
printk(BIOS_ERR, "%s: Failed to find BSP struct device\n", __func__); |
| 269 |
return -1; |
| 270 |
} |
| 271 |
int i = 0; |
| 272 |
for (struct device *dev = info->cpu; dev; dev = dev->sibling) |
| 273 |
if (dev->enabled) |
| 274 |
stub_params->apic_id_to_cpu[i++] = dev->path.apic.initial_lapicid; |
| 275 |
|
| 276 |
if (i != params->num_cpus) { |
| 277 |
printk(BIOS_ERR, "%s: Failed to set up apic map correctly\n", __func__); |
| 278 |
return -1; |
| 279 |
} |
| 280 |
|
| 281 |
printk(BIOS_DEBUG, "%s: stack_top = 0x%x\n", __func__, stub_params->stack_top); |
| 282 |
printk(BIOS_DEBUG, "%s: per cpu stack_size = 0x%x\n", __func__, |
| 283 |
stub_params->stack_size); |
| 284 |
printk(BIOS_DEBUG, "%s: runtime.smm_size = 0x%zx\n", __func__, smm_size); |
| 285 |
|
| 286 |
smm_stub_place_staggered_entry_points(params); |
| 287 |
|
| 288 |
printk(BIOS_DEBUG, "SMM Module: stub loaded at %lx. Will call %p\n", smm_stub_loc, |
| 289 |
params->handler); |
| 290 |
return 0; |
| 291 |
} |
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
int smm_setup_relocation_handler(struct smm_loader_params *params) |
| 300 |
{ |
| 301 |
uintptr_t smram = SMM_DEFAULT_BASE; |
| 302 |
printk(BIOS_SPEW, "%s: enter\n", __func__); |
| 303 |
|
| 304 |
|
| 305 |
if (params->num_concurrent_save_states > 1) |
| 306 |
return -1; |
| 307 |
|
| 308 |
|
| 309 |
if (params->handler == NULL) |
| 310 |
return -1; |
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
if (params->num_cpus == 0) |
| 315 |
params->num_cpus = CONFIG_MAX_CPUS; |
| 316 |
|
| 317 |
printk(BIOS_SPEW, "%s: exit\n", __func__); |
| 318 |
return smm_module_setup_stub(smram, SMM_DEFAULT_SIZE, params); |
| 319 |
} |
| 320 |
|
| 321 |
static void setup_smihandler_params(struct smm_runtime *mod_params, |
| 322 |
struct smm_loader_params *loader_params) |
| 323 |
{ |
| 324 |
uintptr_t tseg_base; |
| 325 |
size_t tseg_size; |
| 326 |
|
| 327 |
smm_region(&tseg_base, &tseg_size); |
| 328 |
|
| 329 |
mod_params->smbase = tseg_base; |
| 330 |
mod_params->smm_size = tseg_size; |
| 331 |
mod_params->save_state_size = loader_params->cpu_save_state_size; |
| 332 |
mod_params->num_cpus = loader_params->num_cpus; |
| 333 |
mod_params->gnvs_ptr = (uint32_t)(uintptr_t)acpi_get_gnvs(); |
| 334 |
const struct cbmem_entry *cbmemc; |
| 335 |
if (CONFIG(CONSOLE_CBMEM) && (cbmemc = cbmem_entry_find(CBMEM_ID_CONSOLE))) { |
| 336 |
mod_params->cbmemc = cbmem_entry_start(cbmemc); |
| 337 |
mod_params->cbmemc_size = cbmem_entry_size(cbmemc); |
| 338 |
} else { |
| 339 |
mod_params->cbmemc = 0; |
| 340 |
mod_params->cbmemc_size = 0; |
| 341 |
} |
| 342 |
|
| 343 |
for (int i = 0; i < loader_params->num_cpus; i++) |
| 344 |
mod_params->save_state_top[i] = region_last(&cpus[i].ss) + 1; |
| 345 |
|
| 346 |
if (CONFIG(RUNTIME_CONFIGURABLE_SMM_LOGLEVEL)) |
| 347 |
mod_params->smm_log_level = mainboard_set_smm_log_level(); |
| 348 |
else |
| 349 |
mod_params->smm_log_level = 0; |
| 350 |
|
| 351 |
if (CONFIG(SMM_PCI_RESOURCE_STORE)) |
| 352 |
smm_pci_resource_store_init(mod_params); |
| 353 |
|
| 354 |
if (CONFIG(SMMSTORE_V2)) { |
| 355 |
struct smmstore_params_info info; |
| 356 |
if (smmstore_get_info(&info) < 0) { |
| 357 |
printk(BIOS_INFO, "SMMSTORE: Failed to get meta data\n"); |
| 358 |
return; |
| 359 |
} |
| 360 |
|
| 361 |
void *ptr = cbmem_add(CBMEM_ID_SMM_COMBUFFER, info.block_size); |
| 362 |
if (!ptr) { |
| 363 |
printk(BIOS_ERR, "SMMSTORE: Failed to add com buffer\n"); |
| 364 |
return; |
| 365 |
} |
| 366 |
mod_params->smmstore_com_buffer_base = (uintptr_t)ptr; |
| 367 |
mod_params->smmstore_com_buffer_size = info.block_size; |
| 368 |
} |
| 369 |
} |
| 370 |
|
| 371 |
static void print_region(const char *name, const struct region region) |
| 372 |
{ |
| 373 |
printk(BIOS_DEBUG, "%-12s [0x%zx-0x%zx]\n", name, region_offset(®ion), |
| 374 |
region_last(®ion)); |
| 375 |
} |
| 376 |
|
| 377 |
|
| 378 |
#define SMM_REGIONS_ARRAY_SIZE (1 + 1 + CONFIG_MAX_CPUS * 2 + 1 + 1) |
| 379 |
|
| 380 |
static int append_and_check_region(const struct region smram, |
| 381 |
const struct region region, |
| 382 |
struct region *region_list, |
| 383 |
const char *name) |
| 384 |
{ |
| 385 |
unsigned int region_counter = 0; |
| 386 |
for (; region_counter < SMM_REGIONS_ARRAY_SIZE; region_counter++) |
| 387 |
if (region_sz(®ion_list[region_counter]) == 0) |
| 388 |
break; |
| 389 |
|
| 390 |
if (region_counter >= SMM_REGIONS_ARRAY_SIZE) { |
| 391 |
printk(BIOS_ERR, "Array used to check regions too small\n"); |
| 392 |
return 1; |
| 393 |
} |
| 394 |
|
| 395 |
if (!region_is_subregion(&smram, ®ion)) { |
| 396 |
printk(BIOS_ERR, "%s not in SMM\n", name); |
| 397 |
return 1; |
| 398 |
} |
| 399 |
|
| 400 |
print_region(name, region); |
| 401 |
for (unsigned int i = 0; i < region_counter; i++) { |
| 402 |
if (region_overlap(®ion_list[i], ®ion)) { |
| 403 |
printk(BIOS_ERR, "%s overlaps with a previous region\n", name); |
| 404 |
return 1; |
| 405 |
} |
| 406 |
} |
| 407 |
|
| 408 |
region_list[region_counter] = region; |
| 409 |
|
| 410 |
return 0; |
| 411 |
} |
| 412 |
|
| 413 |
#define _PRES (1ULL << 0) |
| 414 |
#define _RW (1ULL << 1) |
| 415 |
#define _US (1ULL << 2) |
| 416 |
#define _A (1ULL << 5) |
| 417 |
#define _D (1ULL << 6) |
| 418 |
#define _PS (1ULL << 7) |
| 419 |
#define _GEN_DIR(a) (_PRES + _RW + _US + _A + (a)) |
| 420 |
#define _GEN_PAGE(a) (_PRES + _RW + _US + _PS + _A + _D + (a)) |
| 421 |
#define PTE_SIZE 8 |
| 422 |
|
| 423 |
|
| 424 |
static uintptr_t install_page_table(const uintptr_t handler_base) |
| 425 |
{ |
| 426 |
const bool one_g_pages = !!(cpuid_edx(0x80000001) & (1 << 26)); |
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
const size_t ptes_needed = CONFIG_CPU_PT_ROM_MAP_GB + (one_g_pages ? 0 : |
| 433 |
512 * CONFIG_CPU_PT_ROM_MAP_GB); |
| 434 |
const uintptr_t pages_base = ALIGN_DOWN(handler_base - ptes_needed * PTE_SIZE, 4096); |
| 435 |
const uintptr_t pml4e = ALIGN_DOWN(pages_base - 8, 4096); |
| 436 |
uintptr_t pdpt; |
| 437 |
|
| 438 |
if (one_g_pages) { |
| 439 |
for (size_t i = 0; i < CONFIG_CPU_PT_ROM_MAP_GB; i++) |
| 440 |
write64p(pages_base + i * PTE_SIZE, _GEN_PAGE(1ull * GiB * i)); |
| 441 |
pdpt = pages_base; |
| 442 |
} else { |
| 443 |
for (size_t i = 0; i < 512 * CONFIG_CPU_PT_ROM_MAP_GB; i++) |
| 444 |
write64p(pages_base + i * PTE_SIZE, _GEN_PAGE(2ull * MiB * i)); |
| 445 |
|
| 446 |
pdpt = pages_base + 4096 * CONFIG_CPU_PT_ROM_MAP_GB; |
| 447 |
for (size_t i = 0; i < CONFIG_CPU_PT_ROM_MAP_GB; i++) |
| 448 |
write64p(pdpt + i * PTE_SIZE, _GEN_DIR(pages_base + 4096 * i)); |
| 449 |
} |
| 450 |
|
| 451 |
for (size_t i = 0; i < DIV_ROUND_UP(CONFIG_CPU_PT_ROM_MAP_GB, 512); i++) |
| 452 |
write64p(pml4e + i * PTE_SIZE, _GEN_DIR(pdpt + i * 4096)); |
| 453 |
|
| 454 |
return pml4e; |
| 455 |
} |
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
int smm_load_module(const uintptr_t smram_base, const size_t smram_size, |
| 482 |
struct smm_loader_params *params) |
| 483 |
{ |
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
static struct region region_list[SMM_REGIONS_ARRAY_SIZE] = {}; |
| 490 |
|
| 491 |
struct rmodule smi_handler; |
| 492 |
if (rmodule_parse(&_binary_smm_start, &smi_handler)) |
| 493 |
return -1; |
| 494 |
|
| 495 |
const struct region smram = region_create(smram_base, smram_size); |
| 496 |
const uintptr_t smram_top = region_last(&smram) + 1; |
| 497 |
|
| 498 |
const size_t stm_size = |
| 499 |
CONFIG(STM) ? CONFIG_MSEG_SIZE + CONFIG_BIOS_RESOURCE_LIST_SIZE : 0; |
| 500 |
|
| 501 |
if (CONFIG(STM)) { |
| 502 |
struct region stm = region_create(smram_top - stm_size, stm_size); |
| 503 |
if (append_and_check_region(smram, stm, region_list, "STM")) |
| 504 |
return -1; |
| 505 |
printk(BIOS_DEBUG, "MSEG size 0x%x\n", CONFIG_MSEG_SIZE); |
| 506 |
printk(BIOS_DEBUG, "BIOS res list 0x%x\n", CONFIG_BIOS_RESOURCE_LIST_SIZE); |
| 507 |
} |
| 508 |
|
| 509 |
const size_t handler_size = rmodule_memory_size(&smi_handler); |
| 510 |
const size_t handler_alignment = rmodule_load_alignment(&smi_handler); |
| 511 |
const uintptr_t handler_base = |
| 512 |
ALIGN_DOWN(smram_top - stm_size - handler_size, |
| 513 |
handler_alignment); |
| 514 |
struct region handler = region_create(handler_base, handler_size); |
| 515 |
if (append_and_check_region(smram, handler, region_list, "HANDLER")) |
| 516 |
return -1; |
| 517 |
|
| 518 |
uintptr_t stub_segment_base; |
| 519 |
if (ENV_X86_64) { |
| 520 |
uintptr_t pt_base = install_page_table(handler_base); |
| 521 |
struct region page_tables = region_create(pt_base, handler_base - pt_base); |
| 522 |
if (append_and_check_region(smram, page_tables, region_list, "PAGE TABLES")) |
| 523 |
return -1; |
| 524 |
params->cr3 = pt_base; |
| 525 |
stub_segment_base = pt_base - SMM_CODE_SEGMENT_SIZE; |
| 526 |
} else { |
| 527 |
stub_segment_base = handler_base - SMM_CODE_SEGMENT_SIZE; |
| 528 |
} |
| 529 |
|
| 530 |
if (!smm_create_map(stub_segment_base, params->num_concurrent_save_states, params)) { |
| 531 |
printk(BIOS_ERR, "%s: Error creating CPU map\n", __func__); |
| 532 |
return -1; |
| 533 |
} |
| 534 |
for (unsigned int i = 0; i < params->num_concurrent_save_states; i++) { |
| 535 |
printk(BIOS_DEBUG, "\nCPU %u\n", i); |
| 536 |
char string[13]; |
| 537 |
snprintf(string, sizeof(string), " ss%d", i); |
| 538 |
if (append_and_check_region(smram, cpus[i].ss, region_list, string)) |
| 539 |
return -1; |
| 540 |
snprintf(string, sizeof(string), " stub%d", i); |
| 541 |
if (append_and_check_region(smram, cpus[i].stub_code, region_list, string)) |
| 542 |
return -1; |
| 543 |
} |
| 544 |
|
| 545 |
struct region stacks = region_create(smram_base, |
| 546 |
params->num_concurrent_save_states * CONFIG_SMM_MODULE_STACK_SIZE); |
| 547 |
printk(BIOS_DEBUG, "\n"); |
| 548 |
if (append_and_check_region(smram, stacks, region_list, "stacks")) |
| 549 |
return -1; |
| 550 |
|
| 551 |
if (rmodule_load((void *)handler_base, &smi_handler)) |
| 552 |
return -1; |
| 553 |
|
| 554 |
struct smm_runtime *smihandler_params = rmodule_parameters(&smi_handler); |
| 555 |
params->handler = rmodule_entry(&smi_handler); |
| 556 |
setup_smihandler_params(smihandler_params, params); |
| 557 |
|
| 558 |
return smm_module_setup_stub(stub_segment_base, smram_size, params); |
| 559 |
} |