Date: Thu, 16 May 2019 14:48:08 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347702 - stable/11/sys/dev/cpuctl Message-ID: <201905161448.x4GEm8do014312@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Thu May 16 14:48:08 2019 New Revision: 347702 URL: https://svnweb.freebsd.org/changeset/base/347702 Log: MFC r347368: x86: Put other CPUs into tight loop when updating Intel microcode from loaded OS. Modified: stable/11/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/11/sys/dev/cpuctl/cpuctl.c Thu May 16 14:46:21 2019 (r347701) +++ stable/11/sys/dev/cpuctl/cpuctl.c Thu May 16 14:48:08 2019 (r347702) @@ -328,9 +328,26 @@ cpuctl_do_update(int cpu, cpuctl_update_args_t *data, return (ret); } +struct ucode_update_data { + void *ptr; + int cpu; + int ret; +}; + +static void +ucode_intel_load_rv(void *arg) +{ + struct ucode_update_data *d; + + d = arg; + if (PCPU_GET(cpuid) == d->cpu) + d->ret = ucode_intel_load(d->ptr, true, NULL, NULL); +} + static int update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td) { + struct ucode_update_data d; void *ptr; int is_bound, oldcpu, ret; @@ -358,12 +375,11 @@ update_intel(int cpu, cpuctl_update_args_t *args, stru oldcpu = td->td_oncpu; is_bound = cpu_sched_is_bound(td); set_cpu(cpu, td); - critical_enter(); - - ret = ucode_intel_load(ptr, true, NULL, NULL); - - critical_exit(); + d.ptr = ptr; + d.cpu = cpu; + smp_rendezvous(NULL, ucode_intel_load_rv, NULL, &d); restore_cpu(oldcpu, is_bound, td); + ret = d.ret; /* * Replace any existing update. This ensures that the new update
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161448.x4GEm8do014312>