Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/mp_machdep.c
Show First 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | start_all_aps(void) | ||||
pmap_invalidate_all(kernel_pmap); | pmap_invalidate_all(kernel_pmap); | ||||
/* copy the AP 1st level boot code */ | /* copy the AP 1st level boot code */ | ||||
bcopy(mptramp_start, (void *)PHYS_TO_DMAP(boot_address), bootMP_size); | bcopy(mptramp_start, (void *)PHYS_TO_DMAP(boot_address), bootMP_size); | ||||
if (bootverbose) | if (bootverbose) | ||||
printf("AP boot address %#lx\n", boot_address); | printf("AP boot address %#lx\n", boot_address); | ||||
/* save the current value of the warm-start vector */ | /* save the current value of the warm-start vector */ | ||||
if (!efi_boot) | if (firmware_type != FW_UEFI) | ||||
kib: In all that cases, check for == FW_BIOS, and not != FW_UEFI | |||||
Done Inline ActionsSame issue as above, #define efi_boot (firmware_type == FW_UEFI) would preserve existing logic. Now I can believe the current logic is wrong, but you're certain this is a correct change? ehem_freebsd_m5p.com: Same issue as above, `#define efi_boot (firmware_type == FW_UEFI)` would preserve existing… | |||||
mpbioswarmvec = *((u_int32_t *) WARMBOOT_OFF); | mpbioswarmvec = *((u_int32_t *) WARMBOOT_OFF); | ||||
outb(CMOS_REG, BIOS_RESET); | outb(CMOS_REG, BIOS_RESET); | ||||
mpbiosreason = inb(CMOS_DATA); | mpbiosreason = inb(CMOS_DATA); | ||||
/* setup a vector to our boot code */ | /* setup a vector to our boot code */ | ||||
if (!efi_boot) { | if (firmware_type != FW_UEFI) { | ||||
*((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; | *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; | ||||
*((volatile u_short *)WARMBOOT_SEG) = (boot_address >> 4); | *((volatile u_short *)WARMBOOT_SEG) = (boot_address >> 4); | ||||
} | } | ||||
outb(CMOS_REG, BIOS_RESET); | outb(CMOS_REG, BIOS_RESET); | ||||
outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ | outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ | ||||
/* Relocate pcpu areas to the correct domain. */ | /* Relocate pcpu areas to the correct domain. */ | ||||
#ifdef NUMA | #ifdef NUMA | ||||
Show All 30 Lines | #endif | ||||
bootpcpu = &__pcpu[cpu]; | bootpcpu = &__pcpu[cpu]; | ||||
bootSTK = (char *)bootstacks[cpu] + | bootSTK = (char *)bootstacks[cpu] + | ||||
kstack_pages * PAGE_SIZE - 8; | kstack_pages * PAGE_SIZE - 8; | ||||
bootAP = cpu; | bootAP = cpu; | ||||
/* attempt to start the Application Processor */ | /* attempt to start the Application Processor */ | ||||
if (!start_ap(apic_id, boot_address)) { | if (!start_ap(apic_id, boot_address)) { | ||||
/* restore the warmstart vector */ | /* restore the warmstart vector */ | ||||
if (!efi_boot) | if (firmware_type != FW_UEFI) | ||||
*(u_int32_t *)WARMBOOT_OFF = mpbioswarmvec; | *(u_int32_t *)WARMBOOT_OFF = mpbioswarmvec; | ||||
panic("AP #%d (PHY# %d) failed!", cpu, apic_id); | panic("AP #%d (PHY# %d) failed!", cpu, apic_id); | ||||
} | } | ||||
CPU_SET(cpu, &all_cpus); /* record AP in CPU map */ | CPU_SET(cpu, &all_cpus); /* record AP in CPU map */ | ||||
} | } | ||||
/* restore the warmstart vector */ | /* restore the warmstart vector */ | ||||
if (!efi_boot) | if (firmware_type != FW_UEFI) | ||||
*(u_int32_t *)WARMBOOT_OFF = mpbioswarmvec; | *(u_int32_t *)WARMBOOT_OFF = mpbioswarmvec; | ||||
outb(CMOS_REG, BIOS_RESET); | outb(CMOS_REG, BIOS_RESET); | ||||
outb(CMOS_DATA, mpbiosreason); | outb(CMOS_DATA, mpbiosreason); | ||||
/* Destroy transient 1:1 mapping */ | /* Destroy transient 1:1 mapping */ | ||||
kernel_pmap->pm_pmltop[0] = old_pml45; | kernel_pmap->pm_pmltop[0] = old_pml45; | ||||
invlpg(0); | invlpg(0); | ||||
▲ Show 20 Lines • Show All 642 Lines • Show Last 20 Lines |
In all that cases, check for == FW_BIOS, and not != FW_UEFI