Index: sys/dev/cpuctl/cpuctl.c =================================================================== --- sys/dev/cpuctl/cpuctl.c +++ sys/dev/cpuctl/cpuctl.c @@ -405,10 +405,11 @@ } static int -update_amd(int cpu, cpuctl_update_args_t *args, struct thread *td) +update_amd(int cpu __unused, cpuctl_update_args_t *args, struct thread *td) { + cpuset_t cpus; void *ptr; - int ret; + int i, ret; if (args->size == 0 || args->data == NULL) { DPRINTF("[cpuctl,%d]: zero-sized firmware image", __LINE__); @@ -431,7 +432,21 @@ ret = EFAULT; goto fail; } - smp_rendezvous(NULL, amd_ucode_wrmsr, NULL, ptr); + + /* + * Update microcode on each physical CPU. + */ +#ifdef SMP + CPU_ZERO(&cpus); + CPU_FOREACH(i) { + if (!CPU_ISSET(i, &logical_cpus_mask)) + CPU_SET(i, &cpus); + } +#else + CPU_FILL(&cpus); + (void)i; +#endif + smp_rendezvous_cpus(cpus, NULL, amd_ucode_wrmsr, NULL, ptr); ret = 0; fail: free(ptr, M_CPUCTL);