From owner-svn-src-stable-11@freebsd.org Tue May 22 14:36:47 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DAFEEF83E0; Tue, 22 May 2018 14:36:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23EEA7854A; Tue, 22 May 2018 14:36:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04DCE1550E; Tue, 22 May 2018 14:36:47 +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 w4MEak6s042051; Tue, 22 May 2018 14:36:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4MEakvW042050; Tue, 22 May 2018 14:36:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805221436.w4MEakvW042050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 May 2018 14:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r334047 - stable/11/sys/x86/xen X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/xen X-SVN-Commit-Revision: 334047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2018 14:36:47 -0000 Author: kib Date: Tue May 22 14:36:46 2018 New Revision: 334047 URL: https://svnweb.freebsd.org/changeset/base/334047 Log: MFC r333892: Fix PCID+PTI pmap operations on Xen/HVM. Approved by: re (marius) Modified: stable/11/sys/x86/xen/xen_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/xen/xen_apic.c ============================================================================== --- stable/11/sys/x86/xen/xen_apic.c Tue May 22 14:35:33 2018 (r334046) +++ stable/11/sys/x86/xen/xen_apic.c Tue May 22 14:36:46 2018 (r334047) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -439,6 +440,46 @@ xen_invltlb_pcid(void *arg) invltlb_pcid_handler(); return (FILTER_HANDLED); } + +static int +xen_invltlb_invpcid_pti(void *arg) +{ + + invltlb_invpcid_pti_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlpg_invpcid_handler(void *arg) +{ + + invlpg_invpcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlpg_pcid_handler(void *arg) +{ + + invlpg_pcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlrng_invpcid_handler(void *arg) +{ + + invlrng_invpcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlrng_pcid_handler(void *arg) +{ + + invlrng_pcid_handler(); + return (FILTER_HANDLED); +} #endif static int @@ -529,8 +570,18 @@ xen_setup_cpus(void) #ifdef __amd64__ if (pmap_pcid_enabled) { - xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = invpcid_works ? - xen_invltlb_invpcid : xen_invltlb_pcid; + if (pti) + xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = + invpcid_works ? xen_invltlb_invpcid_pti : + xen_invltlb_pcid; + else + xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = + invpcid_works ? xen_invltlb_invpcid : + xen_invltlb_pcid; + xen_ipis[IPI_TO_IDX(IPI_INVLPG)].filter = invpcid_works ? + xen_invlpg_invpcid_handler : xen_invlpg_pcid_handler; + xen_ipis[IPI_TO_IDX(IPI_INVLRNG)].filter = invpcid_works ? + xen_invlrng_invpcid_handler : xen_invlrng_pcid_handler; } #endif CPU_FOREACH(i)