From owner-freebsd-xen@FreeBSD.ORG Tue Sep 3 03:49:49 2013 Return-Path: Delivered-To: xen@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C0237299; Tue, 3 Sep 2013 03:49:49 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from aslan.scsiguy.com (mail.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8C82180; Tue, 3 Sep 2013 03:49:49 +0000 (UTC) Received: from [192.168.0.99] (macbook.scsiguy.com [192.168.0.99]) (authenticated bits=0) by aslan.scsiguy.com (8.14.7/8.14.5) with ESMTP id r833nkad004322 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Sep 2013 21:49:46 -0600 (MDT) (envelope-from gibbs@FreeBSD.org) From: "Justin T. Gibbs" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [CFR] Xen IPI patch Date: Mon, 2 Sep 2013 21:49:46 -0600 Message-Id: To: "xen@FreeBSD.org" Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) X-Mailer: Apple Mail (2.1508) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (aslan.scsiguy.com [70.89.174.89]); Mon, 02 Sep 2013 21:49:46 -0600 (MDT) Cc: Konstantin Belousov X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2013 03:49:49 -0000 In my continuing effort to get all of Roger's Xen enhancements into FreeBSD, I'm just about finished reviewing the next patch in his series. The current status of the patch can be found here: http://people.freebsd.org/~gibbs/xen_ipi.diff The main, and late breaking, wrinkle for this patch is the newly committed PCID support form AMD64. I've done my best to translate the updated assembly IPI handlers into the C equivalents needed for Xen. But, I'm by no means an x86 assembly expert, and my current Xen installation doesn't advertise PCID, so all of the new branches I've added have yet to be tested. I also wonder if PVHVM guests are supposed to perform the PCID work natively or use some other Hypervisor functionality. Other things I'm not happy about with the patch: - hvm.c wants to use invltlb_globpcid(), but it is private to pmap.c. I've moved it to cpufunc.h to be next to invltlb(), but the definition of CR4_PGE (from specialreg.h) isn't visible in all of the contexts that include cpufunc.h. So I hackishly define it if necessary. Ick. - With the divergence of IPI handling between i386 and amd64, x86/xen/hvm.c is growing too many ifdefs. Should we delegate the definitions of the ipi functions to amd64/xen/hvm.c and i386/xen/hvm.c? - There's too much code duplication in xen_invlrng() and some of the logic in the other handlers can probably be tightened up. Unfortunately, I'm out of time for tonight. Hopefully the list will have some great suggestions/fixes/improvements for this patch before I pick it up again tomorrow. Thanks, Justin