All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: Jean Guyader <jean.guyader@eu.citrix.com>
Cc: Ian Pratt <Ian.Pratt@eu.citrix.com>,
	xen-devel@lists.xensource.com,
	Keir Fraser <keir.fraser@eu.citrix.com>,
	Kamala Narasimhan <Kamala.Narasimhan@citrix.com>
Subject: Re: [PATCH] Pass-through a graphic card
Date: Fri, 9 May 2008 12:27:13 +0100	[thread overview]
Message-ID: <20080509112713.GO4786@implementation.uk.xensource.com> (raw)
In-Reply-To: <48243170.7050706@eu.citrix.com>

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

  parent reply	other threads:[~2008-05-09 11:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09 11:11 [PATCH] Pass-through a graphic card Jean Guyader
2008-05-09 11:18 ` Jean Guyader
2008-05-09 11:32   ` Samuel Thibault
2008-05-09 11:27 ` Samuel Thibault [this message]
2008-05-09 13:56 ` Jean Guyader
2008-05-09 14:02   ` Daniel P. Berrange
2008-05-09 14:25   ` Daniel P. Berrange
2008-05-09 15:47     ` Jean Guyader
2008-05-15 10:11 ` Jean Guyader
2008-05-15 11:13   ` Samuel Thibault
2008-05-15 11:17     ` Jean Guyader
2008-05-16  8:59       ` Jean Guyader
2008-05-16 17:15         ` Samuel Thibault
  -- strict thread matches above, loose matches on Subject: below --
2008-06-13 15:08 mail mark
2008-06-13 15:25 ` Jean Guyader
2008-06-21 17:36   ` mail mark
2008-06-21 19:28     ` Jean Guyader
2008-06-23 13:20       ` mail mark
2008-06-21 17:43   ` Neo Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080509112713.GO4786@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=Ian.Pratt@eu.citrix.com \
    --cc=Kamala.Narasimhan@citrix.com \
    --cc=jean.guyader@eu.citrix.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.