From: "KUWAMURA Shin'ya" Subject: [PATCH] [IA64] Support grant_table v2 for XENMAPSPACE_grant_table Date: Mon, 22 Feb 2010 15:58:16 +0900 (JST) Message-ID: <20100222.155816.193728341.kuwa@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Feb_22_15_58_16_2010_453)--" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-ia64-devel-bounces@lists.xensource.com Errors-To: xen-ia64-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com, xen-ia64-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org ----Next_Part(Mon_Feb_22_15_58_16_2010_453)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, This patch is ia64 counter part of 20281:95ea2052b41b. This fixes the issue that HVM domains with PV-on-HVM drivers panic. Signed-off-by: KUWAMURA Shin'ya -- KUWAMURA Shin'ya ----Next_Part(Mon_Feb_22_15_58_16_2010_453)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="support-ia64-grant-v2.patch" # HG changeset patch # User KUWAMURA Shin'ya # Date 1266821680 -32400 # Node ID 29ae377cd6bc38562586658c62e9e6c238f9668d # Parent 077089e37ac90d9aba7fc72e16a6b8523b294db1 [IA64] Support grant_table v2 for XENMAPSPACE_grant_table This patch is ia64 counter part of 20281:95ea2052b41b. This fixes the issue that HVM domains with PV-on-HVM drivers panic. Signed-off-by: KUWAMURA Shin'ya diff -r 077089e37ac9 -r 29ae377cd6bc xen/arch/ia64/xen/mm.c --- a/xen/arch/ia64/xen/mm.c Wed Feb 17 15:54:40 2010 +0000 +++ b/xen/arch/ia64/xen/mm.c Mon Feb 22 15:54:40 2010 +0900 @@ -3338,12 +3338,25 @@ arch_memory_op(int op, XEN_GUEST_HANDLE( case XENMAPSPACE_grant_table: spin_lock(&d->grant_table->lock); - if ((xatp.idx >= nr_grant_frames(d->grant_table)) && - (xatp.idx < max_nr_grant_frames)) - gnttab_grow_table(d, xatp.idx + 1); + if (d->grant_table->gt_version == 0) + d->grant_table->gt_version = 1; - if (xatp.idx < nr_grant_frames(d->grant_table)) - mfn = virt_to_mfn(d->grant_table->shared_raw[xatp.idx]); + if (d->grant_table->gt_version == 2 && + (xatp.idx & XENMAPIDX_grant_table_status)) + { + xatp.idx &= ~XENMAPIDX_grant_table_status; + if (xatp.idx < nr_status_frames(d->grant_table)) + mfn = virt_to_mfn(d->grant_table->status[xatp.idx]); + } + else + { + if ((xatp.idx >= nr_grant_frames(d->grant_table)) && + (xatp.idx < max_nr_grant_frames)) + gnttab_grow_table(d, xatp.idx + 1); + + if (xatp.idx < nr_grant_frames(d->grant_table)) + mfn = virt_to_mfn(d->grant_table->shared_raw[xatp.idx]); + } spin_unlock(&d->grant_table->lock); break; ----Next_Part(Mon_Feb_22_15_58_16_2010_453)-- Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel ----Next_Part(Mon_Feb_22_15_58_16_2010_453)----