Date: Sat, 3 Aug 2019 16:57:15 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350560 - head/sys/amd64/vmm/io Message-ID: <201908031657.x73GvFEU039797@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sat Aug 3 16:57:14 2019 New Revision: 350560 URL: https://svnweb.freebsd.org/changeset/base/350560 Log: bhyve: Ignore MSI/MSI-X interrupts sent to non-active vCPUs in physical destination mode. This is mostly a nop, because the vmm initializes all vCPUs up to vm_maxcpus, so even if the target CPU is not active, lapic/vlapic code still has the valid data to use. As John notes, dropping such interrupts more closely matches the real harware, which ignores all interrupts for not started APs. Reviewed by: jhb admbugs: 837 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/vmm/io/vlapic.c Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Sat Aug 3 16:56:44 2019 (r350559) +++ head/sys/amd64/vmm/io/vlapic.c Sat Aug 3 16:57:14 2019 (r350560) @@ -838,7 +838,8 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32 */ CPU_ZERO(dmask); vcpuid = vm_apicid2vcpuid(vm, dest); - if (vcpuid < vm_get_maxcpus(vm)) + amask = vm_active_cpus(vm); + if (vcpuid < vm_get_maxcpus(vm) && CPU_ISSET(vcpuid, &amask)) CPU_SET(vcpuid, dmask); } else { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908031657.x73GvFEU039797>