From owner-svn-src-projects@FreeBSD.ORG Thu Oct 10 16:31:48 2013 Return-Path: Delivered-To: svn-src-projects@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 A16C966C; Thu, 10 Oct 2013 16:31:48 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 7F6EE2949; Thu, 10 Oct 2013 16:31:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9AGVmCI030160; Thu, 10 Oct 2013 16:31:48 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9AGVmIx030159; Thu, 10 Oct 2013 16:31:48 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201310101631.r9AGVmIx030159@svn.freebsd.org> From: "Cherry G. Mathew" Date: Thu, 10 Oct 2013 16:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r256277 - projects/amd64_xen_pv/sys/amd64/include/xen X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Oct 2013 16:31:48 -0000 Author: cherry Date: Thu Oct 10 16:31:47 2013 New Revision: 256277 URL: http://svnweb.freebsd.org/changeset/base/256277 Log: Cosmetic changes to make this closer to i386/include/xen/xen-os.h Approved by: gibbs (implicit) Modified: projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h Modified: projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h ============================================================================== --- projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h Thu Oct 10 16:25:53 2013 (r256276) +++ projects/amd64_xen_pv/sys/amd64/include/xen/xen-os.h Thu Oct 10 16:31:47 2013 (r256277) @@ -43,7 +43,9 @@ static inline int smp_processor_id(void) { + if (__predict_true(gdtset)) return PCPU_GET(cpuid); + return 0; } #else @@ -92,7 +94,7 @@ void trap_init(void); #define __cli() \ do { \ vcpu_info_t *_vcpu; \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 1; \ barrier(); \ } while (0) @@ -101,7 +103,7 @@ do { do { \ vcpu_info_t *_vcpu; \ barrier(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 0; \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ @@ -112,7 +114,7 @@ do { do { \ vcpu_info_t *_vcpu; \ barrier(); \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ @@ -127,7 +129,7 @@ do { #define __save_and_cli(x) \ do { \ vcpu_info_t *_vcpu; \ - _vcpu = &HYPERVISOR_shared_info->vcpu_info[PCPU_GET(cpuid)]; \ + _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ (x) = _vcpu->evtchn_upcall_mask; \ _vcpu->evtchn_upcall_mask = 1; \ barrier(); \