From patchwork Sat Jul 9 04:13:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corneliu ZUZU X-Patchwork-Id: 9221973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A5E2660467 for ; Sat, 9 Jul 2016 04:16:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9749D285F2 for ; Sat, 9 Jul 2016 04:16:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BD402863F; Sat, 9 Jul 2016 04:16:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EBC0D285F2 for ; Sat, 9 Jul 2016 04:16:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLjeu-0001MU-8E; Sat, 09 Jul 2016 04:14:28 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLjet-0001MF-6N for xen-devel@lists.xen.org; Sat, 09 Jul 2016 04:14:27 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id CF/9B-31810-22A70875; Sat, 09 Jul 2016 04:14:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRWlGSWpSXmKPExsUSfTxjoa5iVUO 4waZD+hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8b8BcuYC85pVHTue8jYwHhKoYuRk0NIwF3i cXMfSxcjF5C9hlHizvnZTBDOSUaJGWtOM0FUuUncPNzOCJFYxygxb+1pNpAEm4C2xLlD98CKR ASkJa59vgxWxCzwk1Fi7cfpzCAJYQEzicmbTwI1cHCwCKhK9B9KBAnzCrhIHNu7mhEkLCEgJ7 HgQjpImFPAVeLc29esEHtdJG7smwQ2XkIgR2Lls1nsEOVSEv9blUA2SQgsZZFYf2UfK0SNjMS jiTfZJjAKLWBkWMWoXpxaVJZapGuol1SUmZ5RkpuYmaNraGCsl5taXJyYnpqTmFSsl5yfu4kR GIYMQLCDcflHp0OMkhxMSqK8F2wbwoX4kvJTKjMSizPii0pzUosPMcpwcChJ8K6oAMoJFqWmp 1akZeYAIwImLcHBoyTCexgkzVtckJhbnJkOkTrFqCglzrsDJCEAksgozYNrg0XhJUZZKWFeRq BDhHgKUotyM0tQ5V8xinMwKgnz/geZwpOZVwI3/RXQYiagxQYB9SCLSxIRUlINjJxlU/0YMwW VtvvmfIh7tf2fldhKXZns2N0ZW3eLLv7i9JfzUqPkF/ev+cU+FTW2Ue5aMQvbGir2JIW/kAts PC36L1a3IvbkqldPTC4sNjJYlt9/Tbhve+LjrwI9wlVfHvWy5JzcHHRstUV+Y97qL4yf488Fb ygSf593o049+NrZu+tPa715pMRSnJFoqMVcVJwIAIyUAWy9AgAA X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1468037665!49628168!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10777 invoked from network); 9 Jul 2016 04:14:25 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-14.tower-31.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 9 Jul 2016 04:14:25 -0000 Received: (qmail 11784 invoked from network); 9 Jul 2016 07:14:25 +0300 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.bbu.dsd.mx.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 9 Jul 2016 07:14:25 +0300 Received: from smtp03.buh.bitdefender.org (unknown [10.17.80.77]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id EA4297FBEA for ; Sat, 9 Jul 2016 07:14:24 +0300 (EEST) Received: (qmail 4370 invoked from network); 9 Jul 2016 07:14:24 +0300 Received: from 188-24-34-246.rdsnet.ro (HELO localhost.localdomain) (czuzu@bitdefender.com@188.24.34.246) by smtp03.buh.bitdefender.org with SMTP; 9 Jul 2016 07:14:24 +0300 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Sat, 9 Jul 2016 07:13:44 +0300 Message-Id: <1468037624-6574-1-git-send-email-czuzu@bitdefender.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1468037509-6428-1-git-send-email-czuzu@bitdefender.com> References: <1468037509-6428-1-git-send-email-czuzu@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp03.buh.bitdefender.org, sigver: 7.66242 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 425852, Stamp: 3], Multi: [Enabled, t: (0.000016, 0.005737)], BW: [Enabled, t: (0.000007,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.004269), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_LEGIT_SUMM_400_WORDS; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.010405)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.012894), Hit: No, Details: v2.3.10; Id: 2m1ghhh.1amv7hmgm.cq47], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Tamas K Lengyel , Razvan Cojocaru , Andrew Cooper , Julien Grall , Stefano Stabellini , Jan Beulich Subject: [Xen-devel] [PATCH 03/16] x86/monitor: mechanical renames X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Arch-specific vm-event functions in x86/vm_event.h -e.g. vm_event_init_domain()- don't have an 'arch_' prefix. Apply the same rule for monitor functions - originally the only two monitor functions that had an 'arch_' prefix were arch_monitor_domctl_event() and arch_monitor_domctl_op(), but I gave them that prefix because -they had a counterpart function in common code-, that being monitor_domctl(). Let this also be the rule for future 'arch_' functions additions, and with this patch remove the 'arch_' prefix from the monitor functions that don't have a counterpart in common-code (all but those 2 aforementioned). Signed-off-by: Corneliu ZUZU --- xen/arch/x86/monitor.c | 4 ++-- xen/common/monitor.c | 4 ++-- xen/common/vm_event.c | 4 ++-- xen/include/asm-arm/monitor.h | 8 +++----- xen/include/asm-x86/monitor.h | 12 ++++++------ 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c index 205df41..043815a 100644 --- a/xen/arch/x86/monitor.c +++ b/xen/arch/x86/monitor.c @@ -22,7 +22,7 @@ #include #include -int arch_monitor_init_domain(struct domain *d) +int monitor_init_domain(struct domain *d) { if ( !d->arch.monitor.msr_bitmap ) d->arch.monitor.msr_bitmap = xzalloc(struct monitor_msr_bitmap); @@ -33,7 +33,7 @@ int arch_monitor_init_domain(struct domain *d) return 0; } -void arch_monitor_cleanup_domain(struct domain *d) +void monitor_cleanup_domain(struct domain *d) { xfree(d->arch.monitor.msr_bitmap); diff --git a/xen/common/monitor.c b/xen/common/monitor.c index c73d1d5..5219238 100644 --- a/xen/common/monitor.c +++ b/xen/common/monitor.c @@ -50,12 +50,12 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop) if ( unlikely(mop->event > 31) ) return -EINVAL; /* Check if event type is available. */ - if ( unlikely(!(arch_monitor_get_capabilities(d) & (1U << mop->event))) ) + if ( unlikely(!(monitor_get_capabilities(d) & (1U << mop->event))) ) return -EOPNOTSUPP; break; case XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES: - mop->event = arch_monitor_get_capabilities(d); + mop->event = monitor_get_capabilities(d); return 0; default: diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c index 941345b..b4f9fd3 100644 --- a/xen/common/vm_event.c +++ b/xen/common/vm_event.c @@ -669,7 +669,7 @@ int vm_event_domctl(struct domain *d, xen_domctl_vm_event_op_t *vec, { case XEN_VM_EVENT_ENABLE: /* domain_pause() not required here, see XSA-99 */ - rc = arch_monitor_init_domain(d); + rc = monitor_init_domain(d); if ( rc ) break; rc = vm_event_enable(d, vec, ved, _VPF_mem_access, @@ -682,7 +682,7 @@ int vm_event_domctl(struct domain *d, xen_domctl_vm_event_op_t *vec, { domain_pause(d); rc = vm_event_disable(d, ved); - arch_monitor_cleanup_domain(d); + monitor_cleanup_domain(d); domain_unpause(d); } break; diff --git a/xen/include/asm-arm/monitor.h b/xen/include/asm-arm/monitor.h index 4af707a..c72ee42 100644 --- a/xen/include/asm-arm/monitor.h +++ b/xen/include/asm-arm/monitor.h @@ -46,20 +46,18 @@ int arch_monitor_domctl_event(struct domain *d, return -EOPNOTSUPP; } -static inline -int arch_monitor_init_domain(struct domain *d) +static inline int monitor_init_domain(struct domain *d) { /* No arch-specific domain initialization on ARM. */ return 0; } -static inline -void arch_monitor_cleanup_domain(struct domain *d) +static inline void monitor_cleanup_domain(struct domain *d) { /* No arch-specific domain cleanup on ARM. */ } -static inline uint32_t arch_monitor_get_capabilities(struct domain *d) +static inline uint32_t monitor_get_capabilities(struct domain *d) { uint32_t capabilities = 0; diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h index 0501ca2..c5ae7ef 100644 --- a/xen/include/asm-x86/monitor.h +++ b/xen/include/asm-x86/monitor.h @@ -60,7 +60,10 @@ int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop) return rc; } -static inline uint32_t arch_monitor_get_capabilities(struct domain *d) +int arch_monitor_domctl_event(struct domain *d, + struct xen_domctl_monitor_op *mop); + +static inline uint32_t monitor_get_capabilities(struct domain *d) { uint32_t capabilities = 0; @@ -84,12 +87,9 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d) return capabilities; } -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop); - -int arch_monitor_init_domain(struct domain *d); +int monitor_init_domain(struct domain *d); -void arch_monitor_cleanup_domain(struct domain *d); +void monitor_cleanup_domain(struct domain *d); bool_t monitored_msr(const struct domain *d, u32 msr);