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-devel

Re: [Xen-devel] [PATCH] Pass-through a graphic card

To: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Pass-through a graphic card
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Fri, 9 May 2008 12:27:13 +0100
Cc: Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Kamala Narasimhan <Kamala.Narasimhan@xxxxxxxxxx>
Delivery-date: Fri, 09 May 2008 04:27:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <48243170.7050706@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, Jean Guyader <jean.guyader@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Kamala Narasimhan <Kamala.Narasimhan@xxxxxxxxxx>
References: <48243170.7050706@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
Jean Guyader, le Fri 09 May 2008 12:11:44 +0100, a écrit :
>   - Then we start qemu with the new option -enable-dom0 to have the 
> dom0's keyboard and the mouse redirected into the guest.

I would suggest to a more expressive name, like -dom0-input

> Be careful, vnc must be at 0.

Can't you have the dom0 option override the vnc option?

> +    if (!(mem = fopen("/dev/mem", "r")))
> +        return 0;
> +
> +    fseek(mem, start, SEEK_SET);
> +    fread(buf, 1, size, mem);
> +    fclose(mem);

Mmm, no need for f functionnalities, you can just replace it with
open/lseek/read/close.

> +    bios_size = linux_get_vgabios(xc_handle, bios, 128 * 1024);
> +
> +    if (bios_size <= 0)
> +    {
> +        free(bios);
> +        return -1;
> +    }
> +    
> +    va_bios = xc_map_foreign_range(xc_handle, dom, 16 * XC_PAGE_SIZE,

use bios_size here instead?

> +                                   PROT_READ | PROT_WRITE, pfn);
> +
> +    memcpy(va_bios, bios, bios_size);
> +    hvm_info->vga_bios_paddr = pfn << XC_PAGE_SHIFT; 
> +    hvm_info->vga_bios_size = bios_size;
> +    munmap(va_bios, 16 * XC_PAGE_SIZE);
> +    free(bios);
> +
> +    rc |= xc_domain_memory_mapping(xc_handle, dom,
> +                                   0xa0000 >> XC_PAGE_SHIFT,
> +                                   0xa0000 >> XC_PAGE_SHIFT,
> +                                   2 * 16, 1);

use (0xc0000 - 0xa0000) >> XC_PAGE_SHIFT instead?

> @@ -190,7 +303,7 @@ static int setup_guest(int xc_handle,
>          goto error_out;
>      }
>  
> -    IPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n"
> +    fprintf(stderr, "VIRTUAL MEMORY ARRANGEMENT:\n"
>              "  Loader:        %016"PRIx64"->%016"PRIx64"\n"
>              "  TOTAL:         %016"PRIx64"->%016"PRIx64"\n"

Mmm, I guess you should not change that :)

Samuel

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