From owner-svn-src-head@freebsd.org Sat Dec 5 08:52:38 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A0CDA41B3F; Sat, 5 Dec 2015 08:52:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65244112F; Sat, 5 Dec 2015 08:52:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB58qbno091472; Sat, 5 Dec 2015 08:52:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB58qbW9091471; Sat, 5 Dec 2015 08:52:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512050852.tB58qbW9091471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Dec 2015 08:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291851 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2015 08:52:38 -0000 Author: kib Date: Sat Dec 5 08:52:37 2015 New Revision: 291851 URL: https://svnweb.freebsd.org/changeset/base/291851 Log: It seems that at least some KVM versions advertise support for EIO suppression but the version of the IOAPIC reported is 0x11 and neither IOAPIC EOIR nor the Linux trick of temporal reprogramming of the pin to edge-trigger mode to issue EOI work. Disable eoi suppression if KVM is detected. The mode can still be forced with the tunable. Reported and tested by: Roman Mamontov Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Sat Dec 5 08:46:41 2015 (r291850) +++ head/sys/x86/x86/local_apic.c Sat Dec 5 08:52:37 2015 (r291851) @@ -467,10 +467,20 @@ native_lapic_init(vm_paddr_t addr) * we by default enable suppression even when system only has * one IO-APIC, since EOI is broadcasted to all APIC agents, * including CPUs, otherwise. + * + * It seems that at least some KVM versions report + * EOI_SUPPRESSION bit, but auto-EOI does not work. */ ver = lapic_read32(LAPIC_VERSION); if ((ver & APIC_VER_EOI_SUPPRESSION) != 0) { lapic_eoi_suppression = 1; + if (vm_guest == VM_GUEST_VM && + !strcmp(hv_vendor, "KVMKVMKVM")) { + if (bootverbose) + printf( + "KVM -- disabling lapic eoi suppression\n"); + lapic_eoi_suppression = 0; + } TUNABLE_INT_FETCH("hw.lapic_eoi_suppression", &lapic_eoi_suppression); }