From patchwork Wed Sep 7 22:04:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Lai X-Patchwork-Id: 9320127 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 865B260752 for ; Wed, 7 Sep 2016 22:04:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57C8729443 for ; Wed, 7 Sep 2016 22:04:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CA0229445; Wed, 7 Sep 2016 22:04:14 +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 6E85829443 for ; Wed, 7 Sep 2016 22:04:13 +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 1bhkv6-0003Ua-Eg; Wed, 07 Sep 2016 22:02:12 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhkv4-0003S9-Jz for xen-devel@lists.xensource.com; Wed, 07 Sep 2016 22:02:10 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 14/63-06162-16E80D75; Wed, 07 Sep 2016 22:02:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeJIrShJLcpLzFFi42Jpa+uQ0E3suxB u0PJD2uLelPfsDowe2/t2sQcwRrFm5iXlVySwZtxerFZwsaBi+YWHLA2MR8K6GDk5hAQqJBas n84GYksI8EocWTaDFcL2lbh2czs7TM2G+a8Yuxi5gOyljBKL7n9ihUiUSBy92wBWxCagKrH83 CRGEFtEQFFi3ep3LCA2s4CbxJfL78BqhAWCJHavfAZkc3CwANWv2csBEuYVcJb42PYBaq+cxM 1zncwgNqeAi8SpQwvYIFY5S7y/9ZN1AiP/AkaGVYwaxalFZalFukbmeklFmekZJbmJmTm6hgb GermpxcWJ6ak5iUnFesn5uZsYgaFTz8DAuIOxZa/fIUZJDiYlUV6f4gvhQnxJ+SmVGYnFGfFF pTmpxYcYZTg4lCR45/cC5QSLUtNTK9Iyc4BBDJOW4OBREuEVBknzFhck5hZnpkOkTjEqSonzp oMkBEASGaV5cG2wyLnEKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZh3IsgUnsy8Erjpr4AWMw EtFjp1HmRxSSJCSqqBkUWw8cjtzMyq7yumrwqQ4ZSrKXVMy7uj+8vJI3r31R3SlWFJ1b++Tag +9+/XSS1xzh6v0qNz+VXSHnz4W/No1csnbgI7/n3fOCE+tFBk2o2ej5ypM8089yrarP7V1Gy+ +liXw6FYdyG7Lsk5Z114j7tdEHi67L9FgvK7y09WrQxfzGDeHKWuoMRSnJFoqMVcVJwIADfhj U2XAgAA X-Env-Sender: pclai@intel.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1473285726!58828902!1 X-Originating-IP: [134.134.136.24] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzkwOTcx\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34917 invoked from network); 7 Sep 2016 22:02:09 -0000 Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by server-10.tower-31.messagelabs.com with DHE-RSA-CAMELLIA256-SHA encrypted SMTP; 7 Sep 2016 22:02:09 -0000 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP; 07 Sep 2016 15:02:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,297,1470726000"; d="scan'208";a="6151894" Received: from scymds02.sc.intel.com ([10.82.195.37]) by orsmga004.jf.intel.com with ESMTP; 07 Sep 2016 15:02:05 -0700 Received: from pclaidev.sc.intel.com (pclaidev.sc.intel.com [143.183.85.54]) by scymds02.sc.intel.com with ESMTP id u87M25uH026454; Wed, 7 Sep 2016 15:02:05 -0700 Received: by pclaidev.sc.intel.com (Postfix, from userid 1002) id 35E0C2028E; Wed, 7 Sep 2016 15:04:26 -0700 (PDT) From: Paul Lai To: xen-devel@lists.xensource.com Date: Wed, 7 Sep 2016 15:04:26 -0700 Message-Id: <1473285866-6868-5-git-send-email-paul.c.lai@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473285866-6868-1-git-send-email-paul.c.lai@intel.com> References: <1473285866-6868-1-git-send-email-paul.c.lai@intel.com> Cc: ravi.sahita@intel.com, george.dunlap@citrix.com, jbeulich@suse.com Subject: [Xen-devel] [PATCH Altp2m cleanup v4 4/4] Making altp2m struct dynamically allocated. 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 Ravi Sahita's dynamically allocated altp2m structs Signed-off-by: Paul Lai Reviewed-by: Ravi Sahita --- xen/arch/x86/hvm/hvm.c | 8 +++--- xen/arch/x86/hvm/vmx/vmx.c | 2 +- xen/arch/x86/mm/altp2m.c | 16 +++++------ xen/arch/x86/mm/mem_sharing.c | 2 +- xen/arch/x86/mm/mm-locks.h | 4 +-- xen/arch/x86/mm/p2m-ept.c | 10 +++---- xen/arch/x86/mm/p2m.c | 63 ++++++++++++++++++++++++------------------- xen/common/monitor.c | 1 + xen/include/asm-x86/altp2m.h | 7 ++++- xen/include/asm-x86/domain.h | 6 ++--- xen/include/asm-x86/p2m.h | 9 ++++++- 11 files changed, 73 insertions(+), 55 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index e63ef0b..e378b9c 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -5323,7 +5323,7 @@ static int do_altp2m_op( if ( (a.cmd != HVMOP_altp2m_get_domain_state) && (a.cmd != HVMOP_altp2m_set_domain_state) && - !d->arch.altp2m_active ) + !altp2m_active(d) ) { rc = -EOPNOTSUPP; goto out; @@ -5357,11 +5357,11 @@ static int do_altp2m_op( break; } - ostate = d->arch.altp2m_active; - d->arch.altp2m_active = !!a.u.domain_state.state; + ostate = altp2m_active(d); + set_altp2m_active(d, a.u.domain_state.state); /* If the alternate p2m state has changed, handle appropriately */ - if ( d->arch.altp2m_active != ostate && + if ( altp2m_active(d) != ostate && (ostate || !(rc = p2m_init_altp2m_by_id(d, 0))) ) { for_each_vcpu( d, v ) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 2759e6f..45ec308 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2043,7 +2043,7 @@ static void vmx_vcpu_update_vmfunc_ve(struct vcpu *v) { v->arch.hvm_vmx.secondary_exec_control |= mask; __vmwrite(VM_FUNCTION_CONTROL, VMX_VMFUNC_EPTP_SWITCHING); - __vmwrite(EPTP_LIST_ADDR, virt_to_maddr(d->arch.altp2m_eptp)); + __vmwrite(EPTP_LIST_ADDR, virt_to_maddr(d->arch.altp2m->eptp)); if ( cpu_has_vmx_virt_exceptions ) { diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c index bf3f46e..6803b36 100644 --- a/xen/arch/x86/mm/altp2m.c +++ b/xen/arch/x86/mm/altp2m.c @@ -78,23 +78,23 @@ altp2m_domain_init(struct domain *d) goto out; } /* Init alternate p2m data. */ - if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL ) + if ( (d->arch.altp2m->eptp = alloc_xenheap_page()) == NULL ) { rc = -ENOMEM; goto out; } for ( i = 0; i < MAX_EPTP; i++ ) - d->arch.altp2m_eptp[i] = mfn_x(INVALID_MFN); + d->arch.altp2m->eptp[i] = mfn_x(INVALID_MFN); for ( i = 0; i < MAX_ALTP2M; i++ ) { - rc = p2m_alloc_table(d->arch.altp2m_p2m[i]); + rc = p2m_alloc_table(d->arch.altp2m->p2m[i]); if ( rc != 0 ) goto out; } - d->arch.altp2m_active = 0; + set_altp2m_active(d, false); out: return rc; } @@ -107,13 +107,13 @@ altp2m_domain_teardown(struct domain *d) if ( !hvm_altp2m_supported() ) return; - d->arch.altp2m_active = 0; + set_altp2m_active(d, false); - free_xenheap_page(d->arch.altp2m_eptp); - d->arch.altp2m_eptp = NULL; + free_xenheap_page(d->arch.altp2m->eptp); + d->arch.altp2m->eptp = NULL; for ( i = 0; i < MAX_ALTP2M; i++ ) - p2m_teardown(d->arch.altp2m_p2m[i]); + p2m_teardown(d->arch.altp2m->p2m[i]); } /* diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index e7c6b74..3fd8380 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -877,7 +877,7 @@ int mem_sharing_nominate_page(struct domain *d, for ( i = 0; i < MAX_ALTP2M; i++ ) { - ap2m = d->arch.altp2m_p2m[i]; + ap2m = d->arch.altp2m->p2m[i]; if ( !ap2m ) continue; diff --git a/xen/arch/x86/mm/mm-locks.h b/xen/arch/x86/mm/mm-locks.h index 74fdfc1..71d3891 100644 --- a/xen/arch/x86/mm/mm-locks.h +++ b/xen/arch/x86/mm/mm-locks.h @@ -266,8 +266,8 @@ declare_mm_order_constraint(per_page_sharing) */ declare_mm_lock(altp2mlist) -#define altp2m_list_lock(d) mm_lock(altp2mlist, &(d)->arch.altp2m_list_lock) -#define altp2m_list_unlock(d) mm_unlock(&(d)->arch.altp2m_list_lock) +#define altp2m_list_lock(d) mm_lock(altp2mlist, &(d)->arch.altp2m->list_lock) +#define altp2m_list_unlock(d) mm_unlock(&(d)->arch.altp2m->list_lock) /* P2M lock (per-altp2m-table) * diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index 7ae3168..a54c1cf 100644 --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -1331,14 +1331,14 @@ void setup_ept_dump(void) void p2m_init_altp2m_ept( struct domain *d, unsigned int i) { - struct p2m_domain *p2m = d->arch.altp2m_p2m[i]; + struct p2m_domain *p2m = d->arch.altp2m->p2m[i]; struct ept_data *ept; p2m->min_remapped_gfn = gfn_x(INVALID_GFN); - p2m->max_remapped_gfn = 0; + p2m->max_remapped_gfn = gfn_x(_gfn(0UL)); ept = &p2m->ept; ept->asr = pagetable_get_pfn(p2m_get_pagetable(p2m)); - d->arch.altp2m_eptp[i] = ept_get_eptp(ept); + d->arch.altp2m->eptp[i] = ept_get_eptp(ept); } unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp) @@ -1351,10 +1351,10 @@ unsigned int p2m_find_altp2m_by_eptp(struct domain *d, uint64_t eptp) for ( i = 0; i < MAX_ALTP2M; i++ ) { - if ( d->arch.altp2m_eptp[i] == mfn_x(INVALID_MFN) ) + if ( d->arch.altp2m->eptp[i] == mfn_x(INVALID_MFN) ) continue; - p2m = d->arch.altp2m_p2m[i]; + p2m = d->arch.altp2m->p2m[i]; ept = &p2m->ept; if ( eptp == ept_get_eptp(ept) ) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 9a97962..b6ede25 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -191,14 +191,17 @@ static void p2m_teardown_altp2m(struct domain *d) unsigned int i; struct p2m_domain *p2m; + if ( d->arch.altp2m == NULL ) + return; + for ( i = 0; i < MAX_ALTP2M; i++ ) { - if ( !d->arch.altp2m_p2m[i] ) - continue; - p2m = d->arch.altp2m_p2m[i]; + p2m = d->arch.altp2m->p2m[i]; p2m_free_one(p2m); - d->arch.altp2m_p2m[i] = NULL; + d->arch.altp2m->p2m[i] = NULL; } + + xfree(d->arch.altp2m); } static int p2m_init_altp2m(struct domain *d) @@ -206,10 +209,14 @@ static int p2m_init_altp2m(struct domain *d) unsigned int i; struct p2m_domain *p2m; - mm_lock_init(&d->arch.altp2m_list_lock); + d->arch.altp2m = xzalloc(struct altp2m_domain); + if ( d->arch.altp2m == NULL ) + return -ENOMEM; + + mm_lock_init(&d->arch.altp2m->list_lock); for ( i = 0; i < MAX_ALTP2M; i++ ) { - d->arch.altp2m_p2m[i] = p2m = p2m_init_one(d); + d->arch.altp2m->p2m[i] = p2m = p2m_init_one(d); if ( p2m == NULL ) { p2m_teardown_altp2m(d); @@ -1827,10 +1834,10 @@ long p2m_set_mem_access(struct domain *d, gfn_t gfn, uint32_t nr, if ( altp2m_idx ) { if ( altp2m_idx >= MAX_ALTP2M || - d->arch.altp2m_eptp[altp2m_idx] == mfn_x(INVALID_MFN) ) + d->arch.altp2m->eptp[altp2m_idx] == mfn_x(INVALID_MFN) ) return -EINVAL; - ap2m = d->arch.altp2m_p2m[altp2m_idx]; + ap2m = d->arch.altp2m->p2m[altp2m_idx]; } switch ( access ) @@ -2271,7 +2278,7 @@ bool_t p2m_switch_vcpu_altp2m_by_id(struct vcpu *v, unsigned int idx) altp2m_list_lock(d); - if ( d->arch.altp2m_eptp[idx] != mfn_x(INVALID_MFN) ) + if ( d->arch.altp2m->eptp[idx] != mfn_x(INVALID_MFN) ) { if ( idx != vcpu_altp2m(v).p2midx ) { @@ -2356,11 +2363,11 @@ void p2m_flush_altp2m(struct domain *d) for ( i = 0; i < MAX_ALTP2M; i++ ) { - p2m_flush_table(d->arch.altp2m_p2m[i]); + p2m_flush_table(d->arch.altp2m->p2m[i]); /* Uninit and reinit ept to force TLB shootdown */ - ept_p2m_uninit(d->arch.altp2m_p2m[i]); - ept_p2m_init(d->arch.altp2m_p2m[i]); - d->arch.altp2m_eptp[i] = mfn_x(INVALID_MFN); + ept_p2m_uninit(d->arch.altp2m->p2m[i]); + ept_p2m_init(d->arch.altp2m->p2m[i]); + d->arch.altp2m->eptp[i] = mfn_x(INVALID_MFN); } altp2m_list_unlock(d); @@ -2375,7 +2382,7 @@ int p2m_init_altp2m_by_id(struct domain *d, unsigned int idx) altp2m_list_lock(d); - if ( d->arch.altp2m_eptp[idx] == mfn_x(INVALID_MFN) ) + if ( d->arch.altp2m->eptp[idx] == mfn_x(INVALID_MFN) ) { p2m_init_altp2m_ept(d, idx); rc = 0; @@ -2394,7 +2401,7 @@ int p2m_init_next_altp2m(struct domain *d, uint16_t *idx) for ( i = 0; i < MAX_ALTP2M; i++ ) { - if ( d->arch.altp2m_eptp[i] != mfn_x(INVALID_MFN) ) + if ( d->arch.altp2m->eptp[i] != mfn_x(INVALID_MFN) ) continue; p2m_init_altp2m_ept(d, i); @@ -2420,17 +2427,17 @@ int p2m_destroy_altp2m_by_id(struct domain *d, unsigned int idx) altp2m_list_lock(d); - if ( d->arch.altp2m_eptp[idx] != mfn_x(INVALID_MFN) ) + if ( d->arch.altp2m->eptp[idx] != mfn_x(INVALID_MFN) ) { - p2m = d->arch.altp2m_p2m[idx]; + p2m = d->arch.altp2m->p2m[idx]; if ( !_atomic_read(p2m->active_vcpus) ) { - p2m_flush_table(d->arch.altp2m_p2m[idx]); + p2m_flush_table(d->arch.altp2m->p2m[idx]); /* Uninit and reinit ept to force TLB shootdown */ - ept_p2m_uninit(d->arch.altp2m_p2m[idx]); - ept_p2m_init(d->arch.altp2m_p2m[idx]); - d->arch.altp2m_eptp[idx] = mfn_x(INVALID_MFN); + ept_p2m_uninit(d->arch.altp2m->p2m[idx]); + ept_p2m_init(d->arch.altp2m->p2m[idx]); + d->arch.altp2m->eptp[idx] = mfn_x(INVALID_MFN); rc = 0; } } @@ -2454,7 +2461,7 @@ int p2m_switch_domain_altp2m_by_id(struct domain *d, unsigned int idx) altp2m_list_lock(d); - if ( d->arch.altp2m_eptp[idx] != mfn_x(INVALID_MFN) ) + if ( d->arch.altp2m->eptp[idx] != mfn_x(INVALID_MFN) ) { for_each_vcpu( d, v ) if ( idx != vcpu_altp2m(v).p2midx ) @@ -2485,11 +2492,11 @@ int p2m_change_altp2m_gfn(struct domain *d, unsigned int idx, unsigned int page_order; int rc = -EINVAL; - if ( idx >= MAX_ALTP2M || d->arch.altp2m_eptp[idx] == mfn_x(INVALID_MFN) ) + if ( idx >= MAX_ALTP2M || d->arch.altp2m->eptp[idx] == mfn_x(INVALID_MFN) ) return rc; hp2m = p2m_get_hostp2m(d); - ap2m = d->arch.altp2m_p2m[idx]; + ap2m = d->arch.altp2m->p2m[idx]; p2m_lock(hp2m); p2m_lock(ap2m); @@ -2583,10 +2590,10 @@ void p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn, for ( i = 0; i < MAX_ALTP2M; i++ ) { - if ( d->arch.altp2m_eptp[i] == mfn_x(INVALID_MFN) ) + if ( d->arch.altp2m->eptp[i] == mfn_x(INVALID_MFN) ) continue; - p2m = d->arch.altp2m_p2m[i]; + p2m = d->arch.altp2m->p2m[i]; m = get_gfn_type_access(p2m, gfn_x(gfn), &t, &a, 0, NULL); /* Check for a dropped page that may impact this altp2m */ @@ -2607,10 +2614,10 @@ void p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn, for ( i = 0; i < MAX_ALTP2M; i++ ) { if ( i == last_reset_idx || - d->arch.altp2m_eptp[i] == mfn_x(INVALID_MFN) ) + d->arch.altp2m->eptp[i] == mfn_x(INVALID_MFN) ) continue; - p2m = d->arch.altp2m_p2m[i]; + p2m = d->arch.altp2m->p2m[i]; p2m_lock(p2m); p2m_reset_altp2m(p2m); p2m_unlock(p2m); diff --git a/xen/common/monitor.c b/xen/common/monitor.c index 451f42f..28b0458 100644 --- a/xen/common/monitor.c +++ b/xen/common/monitor.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/include/asm-x86/altp2m.h b/xen/include/asm-x86/altp2m.h index 0090c89..65a7ead 100644 --- a/xen/include/asm-x86/altp2m.h +++ b/xen/include/asm-x86/altp2m.h @@ -24,7 +24,12 @@ /* Alternate p2m HVM on/off per domain */ static inline bool_t altp2m_active(const struct domain *d) { - return d->arch.altp2m_active; + return d->arch.altp2m->active; +} + +static inline void set_altp2m_active(const struct domain *d, bool_t v) +{ + d->arch.altp2m->active = v; } /* Alternate p2m VCPU */ diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index 5807a1f..3b9fcc1 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -242,6 +242,7 @@ typedef xen_domctl_cpuid_t cpuid_input_t; #define INVALID_ALTP2M 0xffff #define MAX_EPTP (PAGE_SIZE / sizeof(uint64_t)) struct p2m_domain; +struct altp2m_domain; struct time_scale { int shift; u32 mul_frac; @@ -320,10 +321,7 @@ struct arch_domain mm_lock_t nested_p2m_lock; /* altp2m: allow multiple copies of host p2m */ - bool_t altp2m_active; - struct p2m_domain *altp2m_p2m[MAX_ALTP2M]; - mm_lock_t altp2m_list_lock; - uint64_t *altp2m_eptp; + struct altp2m_domain *altp2m; /* NB. protected by d->event_lock and by irq_desc[irq].lock */ struct radix_tree_root irq_pirq; diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index c138522..13b3eb7 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -338,6 +338,13 @@ struct p2m_domain { }; }; +struct altp2m_domain { + bool_t active; + struct p2m_domain *p2m[MAX_ALTP2M]; + mm_lock_t list_lock; + uint64_t *eptp; +}; + /* get host p2m table */ #define p2m_get_hostp2m(d) ((d)->arch.p2m) @@ -781,7 +788,7 @@ static inline struct p2m_domain *p2m_get_altp2m(struct vcpu *v) BUG_ON(index >= MAX_ALTP2M); - return v->domain->arch.altp2m_p2m[index]; + return v->domain->arch.altp2m->p2m[index]; } /* Switch alternate p2m for a single vcpu */