WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel][PATCH][VTD] add hypercalls needed for VTD

To: "Xu, Anthony" <anthony.xu@xxxxxxxxx>
Subject: Re: [Xen-ia64-devel][PATCH][VTD] add hypercalls needed for VTD
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Tue, 21 Oct 2008 18:44:58 +0900
Cc: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 21 Oct 2008 02:46:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <F7C8A4D3A9905B45A80E4C194793FA6501B3130E47@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <F7C8A4D3A9905B45A80E4C194793FA6501B3130E47@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
On Tue, Oct 21, 2008 at 05:05:51PM +0800, Xu, Anthony wrote:
> Add hypercalls needed for VTD
> 
> Signed-off-by; Anthony Xu < anthony.xu@xxxxxxxxx >


> diff -r 3b1ff707d130 -r 55251ad3e262 xen/arch/ia64/xen/hypercall.c
> --- a/xen/arch/ia64/xen/hypercall.c   Tue Oct 21 10:41:54 2008 +0800
> +++ b/xen/arch/ia64/xen/hypercall.c   Tue Oct 21 14:12:29 2008 +0800
> @@ -35,6 +35,7 @@
>  #include <public/arch-ia64/debug_op.h>
>  #include <asm/sioemu.h>
>  #include <public/arch-ia64/sioemu.h>
> +#include <xen/pci.h>
>  
>  static IA64FAULT
>  xen_hypercall (struct pt_regs *regs)
> @@ -313,6 +314,22 @@
>  iosapic_guest_write(
>      unsigned long physbase, unsigned int reg, u32 pval);
>  
> +
> +/*
> + * XXX We don't support MSI for PCI passthrough, so just return success
> + */
> +static int physdev_map_pirq(struct physdev_map_pirq *map)
> +{
> +     return 0;
> +}
> +
> +static int physdev_unmap_pirq(struct physdev_unmap_pirq *unmap)
> +{
> +     return 0;
> +}
> +     
> +
> +
>  long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
>  {
>      int irq;

-ENOSYS?
Or is other code confused with -ENOSYS?


> diff -r 3b1ff707d130 -r 55251ad3e262 xen/arch/ia64/xen/mm.c
> --- a/xen/arch/ia64/xen/mm.c  Tue Oct 21 10:41:54 2008 +0800
> +++ b/xen/arch/ia64/xen/mm.c  Tue Oct 21 14:12:29 2008 +0800
> @@ -1456,12 +1456,38 @@
>          BUG_ON(mfn != pte_pfn(ret_pte));
>      }
>  
> +    perfc_incr(zap_domain_page_one);
> +    if(!mfn_valid(mfn))
> +        return;
> +
>      page = mfn_to_page(mfn);
>      BUG_ON((page->count_info & PGC_count_mask) == 0);
>  
>      BUG_ON(clear_PGC_allocate && (page_get_owner(page) == NULL));
>      domain_put_page(d, mpaddr, pte, old_pte, clear_PGC_allocate);
> -    perfc_incr(zap_domain_page_one);
> +}

The BUG_ON() above this hunk should be updated too.
something like
-        BUG_ON(page_get_owner(mfn_to_page(mfn)) != d &&
-               page_get_owner(mfn_to_page(mfn)) != NULL);
+        BUG_ON(mfn_valid(mfn) &&
+               page_get_owner(mfn_to_page(mfn)) != d &&
+               page_get_owner(mfn_to_page(mfn)) != NULL);


thanks,
-- 
yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel