ia64/xen-unstable

changeset 15338:96617c4f19aa

Merge with xen-unstable.hg (staging)
author Alex Williamson <alex.williamson@hp.com>
date Tue Jun 12 20:41:08 2007 -0600 (2007-06-12)
parents 883ede7d9c1c c56ebab69b84
children da5f8f1961e5
files tools/libxc/ia64/xc_ia64_hvm_build.c
line diff
     1.1 --- a/docs/src/user.tex	Tue Jun 12 16:54:19 2007 -0600
     1.2 +++ b/docs/src/user.tex	Tue Jun 12 20:41:08 2007 -0600
     1.3 @@ -3188,6 +3188,13 @@ editing \path{grub.conf}.
     1.4    \end{description}
     1.5  The mode may optionally be followed by `{\bf,keep}' to cause Xen to keep
     1.6  writing to the VGA console after domain 0 starts booting (e.g., `vga=text-80x50,keep').
     1.7 +\item [ no-real-mode ] (x86 only) Do not execute real-mode bootstrap
     1.8 +  code when booting Xen. This option should not be used except for
     1.9 +  debugging. It will effectively disable the {\bf vga} option, which
    1.10 +  relies on real mode to set the video mode.
    1.11 +\item [ edid=no,force ] (x86 only) Either force retrieval of monitor
    1.12 +  EDID information via VESA DDC, or disable it (edid=no). This option
    1.13 +  should not normally be required except for debugging purposes.
    1.14  \item [ console\_to\_ring ] Place guest console output into the
    1.15    hypervisor console ring buffer. This is disabled by default.
    1.16    When enabled, both hypervisor output and guest console output
     2.1 --- a/tools/blktap/drivers/blktapctrl.c	Tue Jun 12 16:54:19 2007 -0600
     2.2 +++ b/tools/blktap/drivers/blktapctrl.c	Tue Jun 12 20:41:08 2007 -0600
     2.3 @@ -143,7 +143,8 @@ static int get_new_dev(int *major, int *
     2.4  		return -1;
     2.5  	}
     2.6  
     2.7 -	asprintf(&devname,"%s/%s%d",BLKTAP_DEV_DIR, BLKTAP_DEV_NAME, *minor);
     2.8 +	if (asprintf(&devname,"%s/%s%d",BLKTAP_DEV_DIR, BLKTAP_DEV_NAME, *minor) == -1)
     2.9 +		return -1;
    2.10  	make_blktap_dev(devname,*major,*minor);	
    2.11  	DPRINTF("Received device id %d and major %d, "
    2.12  		"sent domid %d and be_id %d\n",
    2.13 @@ -495,20 +496,27 @@ int blktapctrl_new_blkif(blkif_t *blkif)
    2.14  
    2.15  		if (!exist) {
    2.16  			DPRINTF("Process does not exist:\n");
    2.17 -			asprintf(&rdctldev, 
    2.18 -				 "%s/tapctrlread%d", BLKTAP_CTRL_DIR, minor);
    2.19 -			blkif->fds[READ] = open_ctrl_socket(rdctldev);
    2.20 +			if (asprintf(&rdctldev,
    2.21 +				     "%s/tapctrlread%d", BLKTAP_CTRL_DIR, minor) == -1)
    2.22 +				return -1;
    2.23 +			if (asprintf(&wrctldev,
    2.24 +				     "%s/tapctrlwrite%d", BLKTAP_CTRL_DIR, minor) == -1) {
    2.25 +				free(rdctldev);
    2.26 +				return -1;
    2.27 +			}
    2.28 +			if (asprintf(&cmd, "tapdisk %s %s", wrctldev, rdctldev) == -1) {
    2.29 +				free(rdctldev);
    2.30 +				free(wrctldev);
    2.31 +				return -1;
    2.32 +			}
    2.33  
    2.34 -
    2.35 -			asprintf(&wrctldev, 
    2.36 -				 "%s/tapctrlwrite%d", BLKTAP_CTRL_DIR, minor);
    2.37 +			blkif->fds[READ] = open_ctrl_socket(rdctldev);
    2.38  			blkif->fds[WRITE] = open_ctrl_socket(wrctldev);
    2.39  			
    2.40  			if (blkif->fds[READ] == -1 || blkif->fds[WRITE] == -1) 
    2.41  				goto fail;
    2.42  
    2.43  			/*launch the new process*/
    2.44 -			asprintf(&cmd, "tapdisk %s %s", wrctldev, rdctldev);
    2.45  			DPRINTF("Launching process, CMDLINE [%s]\n",cmd);
    2.46  			if (system(cmd) == -1) {
    2.47  				DPRINTF("Unable to fork, cmdline: [%s]\n",cmd);
    2.48 @@ -692,7 +700,8 @@ int main(int argc, char *argv[])
    2.49  	register_new_unmap_hook(unmap_blktapctrl);
    2.50  
    2.51  	/* Attach to blktap0 */
    2.52 -	asprintf(&devname,"%s/%s0", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME);
    2.53 +	if (asprintf(&devname,"%s/%s0", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME) == -1)
    2.54 +                goto open_failed;
    2.55  	if ((ret = xc_find_device_number("blktap0")) < 0) {
    2.56  		DPRINTF("couldn't find device number for 'blktap0'\n");
    2.57  		goto open_failed;
     3.1 --- a/tools/blktap/drivers/block-qcow.c	Tue Jun 12 16:54:19 2007 -0600
     3.2 +++ b/tools/blktap/drivers/block-qcow.c	Tue Jun 12 20:41:08 2007 -0600
     3.3 @@ -871,7 +871,10 @@ int tdqcow_open (struct disk_driver *dd,
     3.4  	}
     3.5  
     3.6  	s->fd = fd;
     3.7 -	asprintf(&s->name,"%s", name);
     3.8 +	if (asprintf(&s->name,"%s", name) == -1) {
     3.9 +		close(fd);
    3.10 +		return -1;
    3.11 +	}
    3.12  
    3.13  	ASSERT(sizeof(QCowHeader) + sizeof(QCowHeader_ext) < 512);
    3.14  
    3.15 @@ -1165,7 +1168,7 @@ int tdqcow_close(struct disk_driver *dd)
    3.16  		offset = sizeof(QCowHeader) + sizeof(uint32_t);
    3.17  		lseek(fd, offset, SEEK_SET);
    3.18  		out = cpu_to_be32(cksum);
    3.19 -		write(fd, &out, sizeof(uint32_t));
    3.20 +		if (write(fd, &out, sizeof(uint32_t))) ;
    3.21  		close(fd);
    3.22  	}
    3.23  
     4.1 --- a/tools/blktap/drivers/tapdisk.c	Tue Jun 12 16:54:19 2007 -0600
     4.2 +++ b/tools/blktap/drivers/tapdisk.c	Tue Jun 12 20:41:08 2007 -0600
     4.3 @@ -220,7 +220,8 @@ static int map_new_dev(struct td_state *
     4.4  	fd_list_entry_t *ptr;
     4.5  	int page_size;
     4.6  
     4.7 -	asprintf(&devname,"%s/%s%d", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME, minor);
     4.8 +	if (asprintf(&devname,"%s/%s%d", BLKTAP_DEV_DIR, BLKTAP_DEV_NAME, minor) == -1)
     4.9 +		return -1;
    4.10  	tap_fd = open(devname, O_RDWR);
    4.11  	if (tap_fd == -1) 
    4.12  	{
     5.1 --- a/tools/blktap/lib/xenbus.c	Tue Jun 12 16:54:19 2007 -0600
     5.2 +++ b/tools/blktap/lib/xenbus.c	Tue Jun 12 20:41:08 2007 -0600
     5.3 @@ -360,8 +360,7 @@ int add_blockdevice_probe_watch(struct x
     5.4  	char *path;
     5.5  	struct xenbus_watch *vbd_watch;
     5.6  	
     5.7 -	asprintf(&path, "/local/domain/%s/backend/tap", domid);
     5.8 -	if (path == NULL) 
     5.9 +	if (asprintf(&path, "/local/domain/%s/backend/tap", domid) == -1)
    5.10  		return -ENOMEM;
    5.11  	
    5.12  	vbd_watch = (struct xenbus_watch *)malloc(sizeof(struct xenbus_watch));
    5.13 @@ -399,8 +398,7 @@ int watch_for_domid(struct xs_handle *h)
    5.14  	struct xenbus_watch *domid_watch;
    5.15  	char *path = NULL;
    5.16  
    5.17 -	asprintf(&path, "/local/domain");
    5.18 -	if (path == NULL) 
    5.19 +	if (asprintf(&path, "/local/domain") == -1)
    5.20  		return -ENOMEM;
    5.21  
    5.22  	domid_watch = malloc(sizeof(struct xenbus_watch));
     6.1 --- a/tools/blktap/lib/xs_api.c	Tue Jun 12 16:54:19 2007 -0600
     6.2 +++ b/tools/blktap/lib/xs_api.c	Tue Jun 12 20:41:08 2007 -0600
     6.3 @@ -126,10 +126,12 @@ int xs_printf(struct xs_handle *h, const
     6.4  	ret = vasprintf(&buf, fmt, ap);
     6.5  	va_end(ap);
     6.6  	
     6.7 -	asprintf(&path, "%s/%s", dir, node);
     6.8 -	
     6.9 -	if ((path == NULL) || (buf == NULL))
    6.10 -		return 0;
    6.11 +	if (ret == -1)
    6.12 +		return ENOMEM;
    6.13 +	if (asprintf(&path, "%s/%s", dir, node) == -1) {
    6.14 +		free(buf);
    6.15 +		return ENOMEM;
    6.16 +	}
    6.17  
    6.18  	ret = xs_write(h, XBT_NULL, path, buf, strlen(buf)+1);
    6.19  	
    6.20 @@ -180,10 +182,11 @@ char *get_dom_domid(struct xs_handle *h)
    6.21  	
    6.22  	e = xs_directory(h, xth, "/local/domain", &num);
    6.23  	if (e == NULL)
    6.24 -		return NULL;
    6.25 +		goto done;
    6.26  
    6.27  	for (i = 0; (i < num) && (domid == NULL); i++) {
    6.28 -		asprintf(&path, "/local/domain/%s/name", e[i]);
    6.29 +		if (asprintf(&path, "/local/domain/%s/name", e[i]) == -1)
    6.30 +			break;
    6.31  		val = xs_read(h, xth, path, &len);
    6.32  		free(path);
    6.33  		if (val == NULL)
    6.34 @@ -191,29 +194,31 @@ char *get_dom_domid(struct xs_handle *h)
    6.35  		
    6.36  		if (strcmp(val, DOMNAME) == 0) {
    6.37  			/* match! */
    6.38 -			asprintf(&path, "/local/domain/%s/domid", e[i]);
    6.39 +			if (asprintf(&path, "/local/domain/%s/domid", e[i]) == -1) {
    6.40 +				free(val);
    6.41 +				break;
    6.42 +			}
    6.43  			domid = xs_read(h, xth, path, &len);
    6.44  			free(path);
    6.45  		}
    6.46  		free(val);
    6.47  	}
    6.48 +done:
    6.49  	xs_transaction_end(h, xth, 0);
    6.50 -	
    6.51 -	free(e);
    6.52 +	if (e)
    6.53 +		free(e);
    6.54  	return domid;
    6.55  }
    6.56  
    6.57  int convert_dev_name_to_num(char *name) {
    6.58 -	char *p_sd, *p_hd, *p_xvd, *p_plx, *p, *alpha,*ptr;
    6.59 +	char *p, *ptr;
    6.60  	int majors[10] = {3,22,33,34,56,57,88,89,90,91};
    6.61  	int maj,i,ret = 0;
    6.62 -
    6.63 -	asprintf(&p_sd,"/dev/sd");
    6.64 -	asprintf(&p_hd,"/dev/hd");
    6.65 -	asprintf(&p_xvd,"/dev/xvd");
    6.66 -	asprintf(&p_plx,"plx");
    6.67 -	asprintf(&alpha,"abcdefghijklmnop");
    6.68 -	
    6.69 +	char *p_sd = "/dev/sd";
    6.70 +	char *p_hd = "/dev/hd";
    6.71 +	char *p_xvd = "/dev/xvd";
    6.72 +	char *p_plx = "plx";
    6.73 +	char *alpha = "abcdefghijklmnop";
    6.74  
    6.75  	if (strstr(name, p_sd) != NULL) {
    6.76  		p = name + strlen(p_sd);
    6.77 @@ -251,12 +256,6 @@ int convert_dev_name_to_num(char *name) 
    6.78  		ret = BASE_DEV_VAL;
    6.79  	}
    6.80  
    6.81 -	free(p_sd);
    6.82 -	free(p_hd);
    6.83 -	free(p_xvd);
    6.84 -	free(p_plx);
    6.85 -	free(alpha);
    6.86 -
    6.87  	return ret;
    6.88  }
    6.89  
     7.1 --- a/tools/console/daemon/io.c	Tue Jun 12 16:54:19 2007 -0600
     7.2 +++ b/tools/console/daemon/io.c	Tue Jun 12 20:41:08 2007 -0600
     7.3 @@ -303,7 +303,10 @@ int xs_gather(struct xs_handle *xs, cons
     7.4  		void *result = va_arg(ap, void *);
     7.5  		char *p;
     7.6  
     7.7 -		asprintf(&path, "%s/%s", dir, name);
     7.8 +		if (asprintf(&path, "%s/%s", dir, name) == -1) {
     7.9 +			ret = ENOMEM;
    7.10 +			break;
    7.11 +		}
    7.12  		p = xs_read(xs, XBT_NULL, path, NULL);
    7.13  		free(path);
    7.14  		if (p == NULL) {
     8.1 --- a/tools/firmware/hvmloader/util.c	Tue Jun 12 16:54:19 2007 -0600
     8.2 +++ b/tools/firmware/hvmloader/util.c	Tue Jun 12 20:41:08 2007 -0600
     8.3 @@ -405,7 +405,7 @@ static char *printnum(char *p, unsigned 
     8.4      return p;
     8.5  }
     8.6  
     8.7 -static void _doprint(void (*put)(char), char const *fmt, va_list ap)
     8.8 +static void _doprint(void (*put)(char), const char *fmt, va_list ap)
     8.9  {
    8.10      register char *str, c;
    8.11      int lflag, zflag, nflag;
     9.1 --- a/tools/firmware/rombios/32bit/util.c	Tue Jun 12 16:54:19 2007 -0600
     9.2 +++ b/tools/firmware/rombios/32bit/util.c	Tue Jun 12 20:41:08 2007 -0600
     9.3 @@ -290,7 +290,7 @@ static char *printnum(char *p, unsigned 
     9.4      return p;
     9.5  }
     9.6  
     9.7 -static void _doprint(void (*put)(char), char const *fmt, va_list ap)
     9.8 +static void _doprint(void (*put)(char), const char *fmt, va_list ap)
     9.9  {
    9.10      register char *str, c;
    9.11      int lflag, zflag, nflag;
    10.1 --- a/tools/firmware/vmxassist/util.c	Tue Jun 12 16:54:19 2007 -0600
    10.2 +++ b/tools/firmware/vmxassist/util.c	Tue Jun 12 20:41:08 2007 -0600
    10.3 @@ -27,7 +27,7 @@
    10.4  
    10.5  static void putchar(int);
    10.6  static char *printnum(char *, unsigned long, int);
    10.7 -static void _doprint(void (*)(int), char const *, va_list);
    10.8 +static void _doprint(void (*)(int), const char *, va_list);
    10.9  
   10.10  void
   10.11  cpuid_addr_value(uint64_t addr, uint64_t *value)
   10.12 @@ -321,7 +321,7 @@ putchar(int ch)
   10.13   * but still powerful enough for most tasks.
   10.14   */
   10.15  static void
   10.16 -_doprint(void (*put)(int), char const *fmt, va_list ap)
   10.17 +_doprint(void (*put)(int), const char *fmt, va_list ap)
   10.18  {
   10.19  	register char *str, c;
   10.20  	int lflag, zflag, nflag;
    11.1 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Tue Jun 12 16:54:19 2007 -0600
    11.2 +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Tue Jun 12 20:41:08 2007 -0600
    11.3 @@ -713,11 +713,15 @@ int xc_ia64_save_to_nvram(int xc_handle,
    11.4      xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
    11.5  
    11.6      if ( !IS_VALID_NVRAM_FD(nvram_fd) )
    11.7 -    {
    11.8          PERROR("Nvram not be initialized. Nvram save fail!\n");
    11.9 -        return -1;
   11.10 -    }
   11.11 -    return copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);	
   11.12 +    else
   11.13 +        copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd);	
   11.14 +	
   11.15 +    // although save to nvram maybe fail, we don't return any error number
   11.16 +    // to Xend. This is quite logical because damage of NVRAM on native would 
   11.17 +    // not block OS's executive path. Return error number will cause an
   11.18 +    // exception of Xend and block XenU when it destroy.
   11.19 +    return 0;
   11.20  }
   11.21  
   11.22  #define NVRAM_FILE_PATH	"/usr/lib/xen/boot/nvram_"
   11.23 @@ -1004,8 +1008,10 @@ setup_guest(int xc_handle, uint32_t dom,
   11.24      xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
   11.25      if ( !IS_VALID_NVRAM_FD(nvram_fd) )
   11.26          nvram_start = 0;
   11.27 -    else if ( copy_from_nvram_to_GFW(xc_handle, dom, (int)nvram_fd ) == -1 )
   11.28 +    else if ( copy_from_nvram_to_GFW(xc_handle, dom, (int)nvram_fd ) == -1 ) {
   11.29          nvram_start = 0;
   11.30 +        close(nvram_fd);
   11.31 +    }
   11.32  
   11.33      vcpus = domctl.u.getdomaininfo.max_vcpu_id + 1;
   11.34  
    12.1 --- a/tools/libxc/xc_core_x86.c	Tue Jun 12 16:54:19 2007 -0600
    12.2 +++ b/tools/libxc/xc_core_x86.c	Tue Jun 12 20:41:08 2007 -0600
    12.3 @@ -49,7 +49,7 @@ xc_core_arch_memory_map_get(int xc_handl
    12.4      }
    12.5  
    12.6      map->addr = 0;
    12.7 -    map->size = p2m_size << PAGE_SHIFT;
    12.8 +    map->size = ((uint64_t)p2m_size) << PAGE_SHIFT;
    12.9  
   12.10      *mapp = map;
   12.11      *nr_entries = 1;
    13.1 --- a/tools/libxc/xc_private.c	Tue Jun 12 16:54:19 2007 -0600
    13.2 +++ b/tools/libxc/xc_private.c	Tue Jun 12 20:41:08 2007 -0600
    13.3 @@ -17,7 +17,7 @@ static xc_error_handler error_handler = 
    13.4  static xc_error_handler error_handler = NULL;
    13.5  #endif
    13.6  
    13.7 -void xc_default_error_handler(const xc_error const *err)
    13.8 +void xc_default_error_handler(const xc_error *err)
    13.9  {
   13.10      const char *desc = xc_error_code_to_desc(err->code);
   13.11      fprintf(stderr, "ERROR %s: %s\n", desc, err->message);
    14.1 --- a/tools/libxc/xenctrl.h	Tue Jun 12 16:54:19 2007 -0600
    14.2 +++ b/tools/libxc/xenctrl.h	Tue Jun 12 20:41:08 2007 -0600
    14.3 @@ -823,12 +823,12 @@ const xc_error *xc_get_last_error(void);
    14.4   */
    14.5  void xc_clear_last_error(void);
    14.6  
    14.7 -typedef void (*xc_error_handler)(const xc_error * const err);
    14.8 +typedef void (*xc_error_handler)(const xc_error *err);
    14.9  
   14.10  /*
   14.11   * The default error handler which prints to stderr
   14.12   */
   14.13 -void xc_default_error_handler(const xc_error * const err);
   14.14 +void xc_default_error_handler(const xc_error *err);
   14.15  
   14.16  /*
   14.17   * Convert an error code into a text description
    15.1 --- a/tools/python/xen/xm/main.py	Tue Jun 12 16:54:19 2007 -0600
    15.2 +++ b/tools/python/xen/xm/main.py	Tue Jun 12 20:41:08 2007 -0600
    15.3 @@ -140,7 +140,7 @@ SUBCOMMAND_HELP = {
    15.4                       'Send a trigger to a domain.'),
    15.5      'vcpu-list'   : ('[<Domain>]',
    15.6                       'List the VCPUs for a domain or all domains.'),
    15.7 -    'vcpu-pin'    : ('<Domain> <VCPU> <CPUs|all>',
    15.8 +    'vcpu-pin'    : ('<Domain> <VCPU|all> <CPUs|all>',
    15.9                       'Set which CPUs a VCPU can use.'),
   15.10      'vcpu-set'    : ('<Domain> <vCPUs>',
   15.11                       'Set the number of active VCPUs for allowed for the'
   15.12 @@ -1330,7 +1330,7 @@ def xm_vcpu_pin(args):
   15.13          return cpus
   15.14  
   15.15      dom  = args[0]
   15.16 -    vcpu = int(args[1])
   15.17 +    vcpu = args[1]
   15.18      if args[2] == 'all':
   15.19          cpumap = cpu_make_map('0-63')
   15.20      else:
    16.1 --- a/xen/arch/x86/boot/Makefile	Tue Jun 12 16:54:19 2007 -0600
    16.2 +++ b/xen/arch/x86/boot/Makefile	Tue Jun 12 20:41:08 2007 -0600
    16.3 @@ -1,3 +1,3 @@
    16.4  obj-y += head.o
    16.5  
    16.6 -head.o: head.S $(TARGET_SUBARCH).S trampoline.S mem.S video.S cmdline.S
    16.7 +head.o: head.S $(TARGET_SUBARCH).S trampoline.S mem.S video.S cmdline.S edd.S
    17.1 --- a/xen/arch/x86/boot/cmdline.S	Tue Jun 12 16:54:19 2007 -0600
    17.2 +++ b/xen/arch/x86/boot/cmdline.S	Tue Jun 12 20:41:08 2007 -0600
    17.3 @@ -157,10 +157,10 @@ cmdline_parse_early:
    17.4          mov     sym_phys(multiboot_ptr),%ebx
    17.5          mov     MB_flags(%ebx),%eax
    17.6          test    $4,%al
    17.7 -        jz      1f
    17.8 +        jz      .Lcmdline_exit
    17.9          mov     MB_cmdline(%ebx),%eax
   17.10          test    %eax,%eax
   17.11 -        jz      1f
   17.12 +        jz      .Lcmdline_exit
   17.13  
   17.14          /* Check for 'no-real-mode' command-line option. */
   17.15          pushl   $sym_phys(.Lno_rm_opt)
   17.16 @@ -169,14 +169,58 @@ cmdline_parse_early:
   17.17          test    %eax,%eax
   17.18          setnz   bootsym_phys(skip_realmode)
   17.19  
   17.20 +.Lparse_edd:
   17.21 +        /* Check for 'edd=' command-line option. */
   17.22 +        movl    $sym_phys(.Ledd_opt),4(%esp)
   17.23 +        call    .Lfind_option
   17.24 +        test    %eax,%eax
   17.25 +        jz      .Lparse_edid
   17.26 +        cmpb    $'=',3(%eax)
   17.27 +        jne     .Lparse_edid
   17.28 +        add     $4,%eax
   17.29 +        movb    $2,bootsym_phys(opt_edd)  /* opt_edd=2: edd=off */
   17.30 +        cmpw    $0x666f,(%eax)            /* 0x666f == "of" */
   17.31 +        je      .Lparse_edid
   17.32 +        decb    bootsym_phys(opt_edd)     /* opt_edd=1: edd=skipmbr */
   17.33 +        cmpw    $0x6b73,(%eax)            /* 0x6b73 == "sk" */
   17.34 +        je      .Lparse_edid
   17.35 +        decb    bootsym_phys(opt_edid)    /* opt_edd=0: edd=on (default) */
   17.36 +
   17.37 +.Lparse_edid:
   17.38 +        /* Check for 'edid=' command-line option. */
   17.39 +        movl    $sym_phys(.Ledid_opt),4(%esp)
   17.40 +        call    .Lfind_option
   17.41 +        test    %eax,%eax
   17.42 +        jz      .Lparse_vga
   17.43 +        cmpb    $'=',4(%eax)
   17.44 +        jne     .Lparse_vga
   17.45 +        add     $5,%eax
   17.46 +        mov     %eax,%ebx
   17.47 +        push    %ebx
   17.48 +        pushl   $sym_phys(.Ledid_force)
   17.49 +        call    .Lstr_prefix
   17.50 +        add     $8,%esp
   17.51 +        movb    $2,bootsym_phys(opt_edid) /* opt_edid=2: edid=force */
   17.52 +        test    %eax,%eax
   17.53 +        jz      .Lparse_vga
   17.54 +        push    %ebx
   17.55 +        pushl   $sym_phys(.Ledid_no)
   17.56 +        call    .Lstr_prefix
   17.57 +        add     $8,%esp
   17.58 +        decb    bootsym_phys(opt_edid)    /* opt_edid=1: edid=no */
   17.59 +        test    %eax,%eax
   17.60 +        jz      .Lparse_vga
   17.61 +        decb    bootsym_phys(opt_edid)    /* opt_edid=0: default */
   17.62 +
   17.63 +.Lparse_vga:
   17.64          /* Check for 'vga=' command-line option. */
   17.65          movl    $sym_phys(.Lvga_opt),4(%esp)
   17.66          call    .Lfind_option
   17.67          add     $8,%esp
   17.68          test    %eax,%eax
   17.69 -        jz      1f
   17.70 +        jz      .Lcmdline_exit
   17.71          cmpb    $'=',3(%eax)
   17.72 -        jne     1f
   17.73 +        jne     .Lcmdline_exit
   17.74          add     $4,%eax
   17.75  
   17.76          /* Found the 'vga=' option. Default option is to display vga menu. */
   17.77 @@ -189,7 +233,7 @@ cmdline_parse_early:
   17.78          call    .Lstr_prefix
   17.79          add     $8,%esp
   17.80          test    %eax,%eax
   17.81 -        jnz     3f
   17.82 +        jnz     .Lparse_vga_gfx
   17.83  
   17.84          /* We have 'vga=text-80x<rows>'. */
   17.85          add     $8,%ebx
   17.86 @@ -198,22 +242,23 @@ cmdline_parse_early:
   17.87          add     $4,%esp
   17.88          mov     %ax,%bx
   17.89          lea     sym_phys(.Lvga_text_modes),%esi
   17.90 -2:      lodsw
   17.91 +1:      lodsw
   17.92          test    %ax,%ax
   17.93 -        jz      1f
   17.94 +        jz      .Lcmdline_exit
   17.95          cmp     %ax,%bx
   17.96          lodsw
   17.97 -        jne     2b
   17.98 +        jne     1b
   17.99          mov     %ax,bootsym_phys(boot_vid_mode)
  17.100 -        jmp     1f
  17.101 +        jmp     .Lcmdline_exit
  17.102  
  17.103 +.Lparse_vga_gfx:
  17.104          /* Check for 'vga=gfx-<width>x<height>x<depth>'. */
  17.105 -3:      push    %ebx
  17.106 +        push    %ebx
  17.107          pushl   $sym_phys(.Lvga_gfx)
  17.108          call    .Lstr_prefix
  17.109          add     $8,%esp
  17.110          test    %eax,%eax
  17.111 -        jnz     3f
  17.112 +        jnz     .Lparse_vga_mode
  17.113  
  17.114          /* We have 'vga=gfx-<width>x<height>x<depth>'. */
  17.115          /* skip 'gfx-' */
  17.116 @@ -226,7 +271,7 @@ 3:      push    %ebx
  17.117          /* skip 'x' */
  17.118          lodsb
  17.119          cmpb    $'x',%al
  17.120 -        jne     1f
  17.121 +        jne     .Lcmdline_exit
  17.122          /* parse <height> */
  17.123          push    %esi
  17.124          call    .Latoi
  17.125 @@ -235,7 +280,7 @@ 3:      push    %ebx
  17.126          /* skip 'x' */
  17.127          lodsb
  17.128          cmpb    $'x',%al
  17.129 -        jne     1f
  17.130 +        jne     .Lcmdline_exit
  17.131          /* parse <depth> */
  17.132          push    %esi
  17.133          call    .Latoi
  17.134 @@ -243,15 +288,16 @@ 3:      push    %ebx
  17.135          mov     %ax,bootsym_phys(vesa_size)+4
  17.136          /* commit to vesa mode */
  17.137          movw    $VIDEO_VESA_BY_SIZE,bootsym_phys(boot_vid_mode)
  17.138 -        jmp     1f
  17.139 +        jmp     .Lcmdline_exit
  17.140  
  17.141 +.Lparse_vga_mode:
  17.142          /* Check for 'vga=mode-<mode>'. */
  17.143 -3:      push    %ebx
  17.144 +        push    %ebx
  17.145          pushl   $sym_phys(.Lvga_mode)
  17.146          call    .Lstr_prefix
  17.147          add     $8,%esp
  17.148          test    %eax,%eax
  17.149 -        jnz     1f
  17.150 +        jnz     .Lcmdline_exit
  17.151  
  17.152          /* We have 'vga=mode-<mode>'. */
  17.153          add     $5,%ebx
  17.154 @@ -260,7 +306,8 @@ 3:      push    %ebx
  17.155          add     $4,%esp
  17.156          mov     %ax,bootsym_phys(boot_vid_mode)
  17.157  
  17.158 -1:      popa
  17.159 +.Lcmdline_exit:
  17.160 +        popa
  17.161          ret
  17.162  
  17.163  .Lvga_text_modes: /* rows, mode_number */
  17.164 @@ -283,3 +330,11 @@ 1:      popa
  17.165          .asciz  "mode-"
  17.166  .Lno_rm_opt:
  17.167          .asciz  "no-real-mode"
  17.168 +.Ledid_opt:
  17.169 +        .asciz  "edid"
  17.170 +.Ledid_force:
  17.171 +        .asciz  "force"
  17.172 +.Ledid_no:
  17.173 +        .asciz  "no"
  17.174 +.Ledd_opt:
  17.175 +        .asciz  "edd"
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/xen/arch/x86/boot/edd.S	Tue Jun 12 20:41:08 2007 -0600
    18.3 @@ -0,0 +1,161 @@
    18.4 +/******************************************************************************
    18.5 + * edd.S
    18.6 + *
    18.7 + * BIOS Enhanced Disk Drive support
    18.8 + * 
    18.9 + * Copyright (C) 2002, 2003, 2004 Dell, Inc.
   18.10 + * by Matt Domsch <Matt_Domsch@dell.com> October 2002
   18.11 + * conformant to T13 Committee www.t13.org
   18.12 + *   projects 1572D, 1484D, 1386D, 1226DT
   18.13 + * disk signature read by Matt Domsch <Matt_Domsch@dell.com>
   18.14 + *      and Andrew Wilks <Andrew_Wilks@dell.com> September 2003, June 2004
   18.15 + * legacy CHS retrieval by Patrick J. LoPresti <patl@users.sourceforge.net>
   18.16 + *      March 2004
   18.17 + * Command line option parsing, Matt Domsch, November 2004
   18.18 + *
   18.19 + * Updated and ported for Xen by Keir Fraser <keir@xensource.com> June 2007
   18.20 + */
   18.21 +
   18.22 +        .code16
   18.23 +
   18.24 +/* Offset of disc signature in the MBR. */
   18.25 +#define EDD_MBR_SIG_OFFSET      0x1B8
   18.26 +
   18.27 +/* Maximum number of EDD information structures at boot_edd_info. */
   18.28 +#define EDD_INFO_MAX            6
   18.29 +
   18.30 +/* Maximum number of MBR signatures at boot_edd_signature. */
   18.31 +#define EDD_MBR_SIG_MAX         16
   18.32 +
   18.33 +/* Size of components of EDD information structure. */
   18.34 +#define EDDEXTSIZE              8
   18.35 +#define EDDPARMSIZE             74
   18.36 +
   18.37 +get_edd:
   18.38 +        cmpb    $2, bootsym(opt_edd)            # edd=off ?
   18.39 +        je      edd_done
   18.40 +        cmpb    $1, bootsym(opt_edd)            # edd=skipmbr ?
   18.41 +        je      edd_start
   18.42 +
   18.43 +# Read the first sector of each BIOS disk device and store the 4-byte signature
   18.44 +edd_mbr_sig_start:
   18.45 +        movb    $0x80, %dl                      # from device 80
   18.46 +        movw    $bootsym(boot_edd_signature),%bx # store buffer ptr in bx
   18.47 +edd_mbr_sig_read:
   18.48 +        movl    $0xFFFFFFFF, %eax
   18.49 +        movl    %eax, (%bx)                     # assume failure
   18.50 +        pushw   %bx
   18.51 +        movb    $0x02, %ah                      # 0x02 Read Sectors
   18.52 +        movb    $1, %al                         # read 1 sector
   18.53 +        movb    $0, %dh                         # at head 0
   18.54 +        movw    $1, %cx                         # cylinder 0, sector 0
   18.55 +        pushw   %es
   18.56 +        pushw   %ds
   18.57 +        popw    %es
   18.58 +        movw    $bootsym(boot_edd_info), %bx    # disk's data goes into info
   18.59 +        pushw   %dx             # work around buggy BIOSes
   18.60 +        stc                     # work around buggy BIOSes
   18.61 +        int     $0x13
   18.62 +        sti                     # work around buggy BIOSes
   18.63 +        popw    %dx
   18.64 +        popw    %es
   18.65 +        popw    %bx
   18.66 +        jc      edd_mbr_sig_done                # on failure, we're done.
   18.67 +        cmpb    $0, %ah                         # some BIOSes do not set CF
   18.68 +        jne     edd_mbr_sig_done                # on failure, we're done.
   18.69 +        movl    bootsym(boot_edd_info)+EDD_MBR_SIG_OFFSET,%eax
   18.70 +        movl    %eax, (%bx)                     # store signature from MBR
   18.71 +        incb    bootsym(boot_edd_signature_nr)  # note that we stored something
   18.72 +        incb    %dl                             # increment to next device
   18.73 +        addw    $4, %bx                         # increment sig buffer ptr
   18.74 +        cmpb    $EDD_MBR_SIG_MAX,bootsym(boot_edd_signature_nr)
   18.75 +        jb      edd_mbr_sig_read
   18.76 +edd_mbr_sig_done:
   18.77 +
   18.78 +# Do the BIOS Enhanced Disk Drive calls
   18.79 +# This consists of two calls:
   18.80 +#    int 13h ah=41h "Check Extensions Present"
   18.81 +#    int 13h ah=48h "Get Device Parameters"
   18.82 +#    int 13h ah=08h "Legacy Get Device Parameters"
   18.83 +#
   18.84 +# A buffer of size EDD_INFO_MAX*(EDDEXTSIZE+EDDPARMSIZE) is reserved at
   18.85 +# boot_edd_info, the first four bytes of which are used to store the device
   18.86 +# number, interface support map and version results from fn41. The next four
   18.87 +# bytes are used to store the legacy cylinders, heads, and sectors from fn08.
   18.88 +# The following 74 bytes are used to store the results from fn48.
   18.89 +# This code is sensitive to the size of the structs in edd.h
   18.90 +edd_start:
   18.91 +        /* ds:si points at fn48 results. Fn41 results go immediately before. */
   18.92 +        movw    $bootsym(boot_edd_info)+EDDEXTSIZE, %si
   18.93 +        movb    $0x80, %dl                      # BIOS device 0x80
   18.94 +
   18.95 +edd_check_ext:
   18.96 +        movb    $0x41, %ah                      # 0x41 Check Extensions Present
   18.97 +        movw    $0x55AA, %bx                    # magic
   18.98 +        int     $0x13                           # make the call
   18.99 +        jc      edd_done                        # no more BIOS devices
  18.100 +
  18.101 +        cmpw    $0xAA55, %bx                    # is magic right?
  18.102 +        jne     edd_next                        # nope, next...
  18.103 +
  18.104 +        movb    %dl, %ds:-8(%si)                # store device number
  18.105 +        movb    %ah, %ds:-7(%si)                # store version
  18.106 +        movw    %cx, %ds:-6(%si)                # store extensions
  18.107 +        incb    bootsym(boot_edd_info_nr)       # note that we stored something
  18.108 +
  18.109 +edd_get_device_params:
  18.110 +        movw    $EDDPARMSIZE, %ds:(%si)         # put size
  18.111 +        movw    $0x0, %ds:2(%si)                # work around buggy BIOSes
  18.112 +        movb    $0x48, %ah                      # 0x48 Get Device Parameters
  18.113 +        int     $0x13                           # make the call
  18.114 +                                                # Don't check for fail return
  18.115 +                                                # it doesn't matter.
  18.116 +edd_get_legacy_chs:
  18.117 +        xorw    %ax, %ax
  18.118 +        movw    %ax, %ds:-4(%si)
  18.119 +        movw    %ax, %ds:-2(%si)
  18.120 +        # Ralf Brown's Interrupt List says to set ES:DI to
  18.121 +        # 0000h:0000h "to guard against BIOS bugs"
  18.122 +        pushw   %es
  18.123 +        movw    %ax, %es
  18.124 +        movw    %ax, %di
  18.125 +        pushw   %dx                             # legacy call clobbers %dl
  18.126 +        movb    $0x08, %ah                      # 0x08 Legacy Get Device Params
  18.127 +        int     $0x13                           # make the call
  18.128 +        jc      edd_legacy_done                 # failed
  18.129 +        movb    %cl, %al                        # Low 6 bits are max
  18.130 +        andb    $0x3F, %al                      #   sector number
  18.131 +        movb    %al, %ds:-1(%si)                # Record max sect
  18.132 +        movb    %dh, %ds:-2(%si)                # Record max head number
  18.133 +        movb    %ch, %al                        # Low 8 bits of max cyl
  18.134 +        shr     $6, %cl
  18.135 +        movb    %cl, %ah                        # High 2 bits of max cyl
  18.136 +        movw    %ax, %ds:-4(%si)
  18.137 +
  18.138 +edd_legacy_done:
  18.139 +        popw    %dx
  18.140 +        popw    %es
  18.141 +        movw    %si, %ax                        # increment si
  18.142 +        addw    $EDDPARMSIZE+EDDEXTSIZE, %ax
  18.143 +        movw    %ax, %si
  18.144 +
  18.145 +edd_next:
  18.146 +        incb    %dl                             # increment to next device
  18.147 +        cmpb    $EDD_INFO_MAX,bootsym(boot_edd_info_nr)
  18.148 +        jb      edd_check_ext
  18.149 +
  18.150 +edd_done:
  18.151 +        ret
  18.152 +
  18.153 +opt_edd:
  18.154 +        .byte   0                               # edd=on/off/skipmbr
  18.155 +
  18.156 +.globl  boot_edd_info_nr, boot_edd_signature_nr
  18.157 +boot_edd_info_nr:
  18.158 +        .byte   0
  18.159 +boot_edd_signature_nr:
  18.160 +        .byte   0
  18.161 +boot_edd_signature:
  18.162 +        .fill   EDD_MBR_SIG_MAX*4,1,0
  18.163 +boot_edd_info:
  18.164 +        .fill   512,1,0                         # big enough for a disc sector
    19.1 --- a/xen/arch/x86/boot/trampoline.S	Tue Jun 12 16:54:19 2007 -0600
    19.2 +++ b/xen/arch/x86/boot/trampoline.S	Tue Jun 12 20:41:08 2007 -0600
    19.3 @@ -6,11 +6,13 @@
    19.4  
    19.5          .globl trampoline_realmode_entry
    19.6  trampoline_realmode_entry:
    19.7 +        mov     %cs,%ax
    19.8 +        mov     %ax,%ds
    19.9          movb    $0xA5,bootsym(trampoline_cpu_started)
   19.10          cld
   19.11          cli
   19.12 -        lidt    %cs:bootsym(idt_48)
   19.13 -        lgdt    %cs:bootsym(gdt_48)
   19.14 +        lidt    bootsym(idt_48)
   19.15 +        lgdt    bootsym(gdt_48)
   19.16          xor     %ax, %ax
   19.17          inc     %ax
   19.18          lmsw    %ax                       # CR0.PE = 1 (enter protected mode)
   19.19 @@ -142,17 +144,19 @@ 1:      mov     $(BOOT_TRAMPOLINE>>4),%a
   19.20          mov     %ax,%es
   19.21          mov     %ax,%ss
   19.22  
   19.23 -        /* Stack grows down from 0x9200. Initialise IDT and enable irqs. */
   19.24 -        mov     $0x2000,%sp
   19.25 +        /* Stack grows down from 0x93000. Initialise IDT and enable irqs. */
   19.26 +        mov     $0x3000,%sp
   19.27          lidt    bootsym(rm_idt)
   19.28          sti
   19.29  
   19.30          /*
   19.31           * Do real-mode work:
   19.32           *  1. Get memory map.
   19.33 -         *  2. Set video mode.
   19.34 +         *  2. Get Enhanced Disk Drive (EDD) information.
   19.35 +         *  3. Set video mode.
   19.36           */
   19.37          call    get_memory_map
   19.38 +        call    get_edd
   19.39          call    video
   19.40  
   19.41          /* Disable irqs before returning to protected mode. */
   19.42 @@ -187,4 +191,5 @@ skip_realmode:
   19.43  rm_idt: .word   256*4-1, 0, 0
   19.44  
   19.45  #include "mem.S"
   19.46 +#include "edd.S"
   19.47  #include "video.S"
    20.1 --- a/xen/arch/x86/boot/video.S	Tue Jun 12 16:54:19 2007 -0600
    20.2 +++ b/xen/arch/x86/boot/video.S	Tue Jun 12 20:41:08 2007 -0600
    20.3 @@ -15,7 +15,7 @@
    20.4  
    20.5  #include "video.h"
    20.6  
    20.7 -#define modelist (0x2000)
    20.8 +#define modelist (0x3000)
    20.9  
   20.10  /* Retrieve Extended Display Identification Data. */
   20.11  #define CONFIG_FIRMWARE_EDID
   20.12 @@ -882,27 +882,18 @@ gettime:
   20.13  
   20.14  store_edid:
   20.15  #ifdef CONFIG_FIRMWARE_EDID
   20.16 -        pushw   %es                     # just save all registers
   20.17          pushw   %ax
   20.18          pushw   %bx
   20.19          pushw   %cx
   20.20          pushw   %dx
   20.21          pushw   %di
   20.22  
   20.23 -        pushw   %fs
   20.24 -        popw    %es
   20.25 -
   20.26 -        movl    $0x13131313, %eax       # memset block with 0x13
   20.27 -        movw    $32, %cx
   20.28 -        movw    $0x140, %di
   20.29 -        cld
   20.30 -        rep
   20.31 -        stosl
   20.32 +        cmpb    $1, bootsym(opt_edid)   # EDID disabled on cmdline (edid=no)?
   20.33 +        je      .Lno_edid
   20.34  
   20.35          cmpw    $0x0200, bootsym(vbe_version)  # only do EDID on >= VBE2.0
   20.36 -        jl      no_edid
   20.37 +        jl      .Lno_edid
   20.38  
   20.39 -        pushw   %es                     # save ES
   20.40          xorw    %di, %di                # Report Capability
   20.41          pushw   %di
   20.42          popw    %es                     # ES:DI must be 0:0
   20.43 @@ -910,31 +901,40 @@ store_edid:
   20.44          xorw    %bx, %bx
   20.45          xorw    %cx, %cx
   20.46          int     $0x10
   20.47 -        popw    %es                     # restore ES
   20.48 +        cmpw    $0x004f, %ax            # Call failed?
   20.49 +        jne     .Lno_edid
   20.50 +
   20.51 +        movw    %bx, bootsym(boot_edid_caps)
   20.52 +
   20.53 +        cmpb    $2, bootsym(opt_edid)   # EDID forced on cmdline (edid=force)?
   20.54 +        je      .Lforce_edid
   20.55  
   20.56 -        cmpb    $0x00, %ah              # call successful
   20.57 -        jne     no_edid
   20.58 +        /* EDID not forced on cmdline, so perform further sanity checks. */
   20.59 +        testb   $3,%bl                  # No DDC capabilities?
   20.60 +        jz      .Lno_edid
   20.61 +        cmpb    $5,%bh                  # Longer than 5s to read EDID?
   20.62 +        ja      .Lno_edid
   20.63  
   20.64 -        cmpb    $0x4f, %al              # function supported
   20.65 -        jne     no_edid
   20.66 -
   20.67 +.Lforce_edid:
   20.68          movw    $0x4f15, %ax            # do VBE/DDC
   20.69          movw    $0x01, %bx
   20.70          movw    $0x00, %cx
   20.71          movw    $0x00, %dx
   20.72 -        movw    $0x140, %di
   20.73 +        pushw   %ds
   20.74 +        popw    %es
   20.75 +        movw    $bootsym(boot_edid_info), %di
   20.76          int     $0x10
   20.77  
   20.78 -no_edid:
   20.79 +.Lno_edid:
   20.80          popw    %di                     # restore all registers
   20.81          popw    %dx
   20.82          popw    %cx
   20.83          popw    %bx
   20.84          popw    %ax
   20.85 -        popw    %es
   20.86  #endif
   20.87          ret
   20.88  
   20.89 +opt_edid:       .byte   0       # EDID parsing option (force/no/default)
   20.90  mt_end:         .word   0       # End of video mode table if built
   20.91  edit_buf:       .space  6       # Line editor buffer
   20.92  card_name:      .word   0       # Pointer to adapter name
   20.93 @@ -983,7 +983,7 @@ force_size:     .word   0       # Use th
   20.94  
   20.95  vesa_size:      .word   0,0,0   # width x depth x height
   20.96  
   20.97 -                .globl  boot_vid_info
   20.98 +                .globl  boot_vid_info, boot_edid_info, boot_edid_caps
   20.99  /* If we don't run at all, assume basic video mode 3 at 80x25. */
  20.100  boot_vid_mode:  .word   VIDEO_80x25
  20.101  boot_vid_info:  .byte   0, 0    /* orig_x, orig_y */
  20.102 @@ -992,3 +992,5 @@ boot_vid_info:  .byte   0, 0    /* orig_
  20.103                  .byte   1       /* isVGA          */
  20.104                  .word   16      /* 8x16 font      */
  20.105                  .fill   0x28,1,0
  20.106 +boot_edid_info: .fill   128,1,0x13
  20.107 +boot_edid_caps: .word   0x1313
    21.1 --- a/xen/arch/x86/setup.c	Tue Jun 12 16:54:19 2007 -0600
    21.2 +++ b/xen/arch/x86/setup.c	Tue Jun 12 20:41:08 2007 -0600
    21.3 @@ -34,6 +34,7 @@
    21.4  #include <asm/e820.h>
    21.5  #include <acm/acm_hooks.h>
    21.6  #include <xen/kexec.h>
    21.7 +#include <asm/edd.h>
    21.8  
    21.9  #if defined(CONFIG_X86_64)
   21.10  #define BOOTSTRAP_DIRECTMAP_END (1UL << 32)
   21.11 @@ -47,6 +48,10 @@ extern void dmi_scan_machine(void);
   21.12  extern void generic_apic_probe(void);
   21.13  extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn);
   21.14  
   21.15 +extern u16 boot_edid_caps;
   21.16 +extern u8 boot_edid_info[128];
   21.17 +extern struct boot_video_info boot_vid_info;
   21.18 +
   21.19  /*
   21.20   * opt_xenheap_megabytes: Size of Xen heap in megabytes, excluding the
   21.21   * page_info table and allocation bitmap.
   21.22 @@ -348,7 +353,6 @@ struct boot_video_info {
   21.23  
   21.24  static void __init parse_video_info(void)
   21.25  {
   21.26 -    extern struct boot_video_info boot_vid_info;
   21.27      struct boot_video_info *bvi = &bootsym(boot_vid_info);
   21.28  
   21.29      if ( (bvi->orig_video_isVGA == 1) && (bvi->orig_video_mode == 3) )
   21.30 @@ -444,22 +448,55 @@ void __init __start_xen(multiboot_info_t
   21.31  
   21.32      printk("Command line: %s\n", cmdline);
   21.33  
   21.34 +    printk("Video information:\n");
   21.35 +
   21.36 +    /* Print VGA display mode information. */
   21.37      switch ( vga_console_info.video_type )
   21.38      {
   21.39      case XEN_VGATYPE_TEXT_MODE_3:
   21.40 -        printk("VGA is text mode %dx%d, font 8x%d\n",
   21.41 +        printk(" VGA is text mode %dx%d, font 8x%d\n",
   21.42                 vga_console_info.u.text_mode_3.columns,
   21.43                 vga_console_info.u.text_mode_3.rows,
   21.44                 vga_console_info.u.text_mode_3.font_height);
   21.45          break;
   21.46      case XEN_VGATYPE_VESA_LFB:
   21.47 -        printk("VGA is graphics mode %dx%d, %d bpp\n",
   21.48 +        printk(" VGA is graphics mode %dx%d, %d bpp\n",
   21.49                 vga_console_info.u.vesa_lfb.width,
   21.50                 vga_console_info.u.vesa_lfb.height,
   21.51                 vga_console_info.u.vesa_lfb.bits_per_pixel);
   21.52          break;
   21.53 +    default:
   21.54 +        printk(" No VGA detected\n");
   21.55 +        break;
   21.56      }
   21.57  
   21.58 +    /* Print VBE/DDC EDID information. */
   21.59 +    if ( bootsym(boot_edid_caps) != 0x1313 )
   21.60 +    {
   21.61 +        u16 caps = bootsym(boot_edid_caps);
   21.62 +        printk(" VBE/DDC methods:%s%s%s; ",
   21.63 +               (caps & 1) ? " V1" : "",
   21.64 +               (caps & 2) ? " V2" : "",
   21.65 +               !(caps & 3) ? " none" : "");
   21.66 +        printk("EDID transfer time: %d seconds\n", caps >> 8);
   21.67 +        if ( *(u32 *)bootsym(boot_edid_info) == 0x13131313 )
   21.68 +        {
   21.69 +            printk(" EDID info not retrieved because ");
   21.70 +            if ( !(caps & 3) )
   21.71 +                printk("no DDC retrieval method detected\n");
   21.72 +            else if ( (caps >> 8) > 5 )
   21.73 +                printk("takes longer than 5 seconds\n");
   21.74 +            else
   21.75 +                printk("of reasons unknown\n");
   21.76 +        }
   21.77 +    }
   21.78 +
   21.79 +    printk("Disc information:\n");
   21.80 +    printk(" Found %d MBR signatures\n",
   21.81 +           bootsym(boot_edd_signature_nr));
   21.82 +    printk(" Found %d EDD information structures\n",
   21.83 +           bootsym(boot_edd_info_nr));
   21.84 +
   21.85      /* Check that we have at least one Multiboot module. */
   21.86      if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
   21.87          EARLY_FAIL("dom0 kernel not specified. "
    22.1 --- a/xen/arch/x86/time.c	Tue Jun 12 16:54:19 2007 -0600
    22.2 +++ b/xen/arch/x86/time.c	Tue Jun 12 20:41:08 2007 -0600
    22.3 @@ -957,14 +957,12 @@ int time_suspend(void)
    22.4  
    22.5  int time_resume(void)
    22.6  {
    22.7 -    u64 now_sec, tmp = init_pit_and_calibrate_tsc();
    22.8 +    u64 tmp = init_pit_and_calibrate_tsc();
    22.9  
   22.10      set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
   22.11  
   22.12      resume_platform_timer();
   22.13 -    now_sec = read_platform_stime();
   22.14 -    do_div(now_sec, SECONDS(1));
   22.15 -    wc_sec = get_cmos_time() - now_sec;
   22.16 +    do_settime(get_cmos_time(), 0, read_platform_stime());
   22.17  
   22.18      init_percpu_time();
   22.19  
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/xen/include/asm-x86/edd.h	Tue Jun 12 20:41:08 2007 -0600
    23.3 @@ -0,0 +1,44 @@
    23.4 +/******************************************************************************
    23.5 + * edd.h
    23.6 + * 
    23.7 + * Copyright (C) 2002, 2003, 2004 Dell Inc.
    23.8 + * by Matt Domsch <Matt_Domsch@dell.com>
    23.9 + *
   23.10 + * structures and definitions for the int 13h, ax={41,48}h
   23.11 + * BIOS Enhanced Disk Drive Services
   23.12 + * This is based on the T13 group document D1572 Revision 0 (August 14 2002)
   23.13 + * available at http://www.t13.org/docs2002/d1572r0.pdf.  It is
   23.14 + * very similar to D1484 Revision 3 http://www.t13.org/docs2002/d1484r3.pdf
   23.15 + *
   23.16 + * This program is free software; you can redistribute it and/or modify
   23.17 + * it under the terms of the GNU General Public License v2.0 as published by
   23.18 + * the Free Software Foundation
   23.19 + *
   23.20 + * This program is distributed in the hope that it will be useful,
   23.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   23.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   23.23 + * GNU General Public License for more details.
   23.24 + */
   23.25 +
   23.26 +#ifndef __XEN_EDD_H__
   23.27 +#define __XEN_EDD_H__
   23.28 +
   23.29 +struct edd_info {
   23.30 +    /* Int13, Fn48: Check Extensions Present. */
   23.31 +    u8 device;                   /* %dl: device */
   23.32 +    u8 version;                  /* %ah: major version */
   23.33 +    u16 interface_support;       /* %cx: interface support bitmap */
   23.34 +    /* Int13, Fn08: Legacy Get Device Parameters. */
   23.35 +    u16 legacy_max_cylinder;     /* %cl[7:6]:%ch: maximum cylinder number */
   23.36 +    u8 legacy_max_head;          /* %dh: maximum head number */
   23.37 +    u8 legacy_sectors_per_track; /* %cl[5:0]: maximum sector number */
   23.38 +    /* Int13, Fn41: Get Device Parameters */
   23.39 +    u8 edd_device_params[74];    /* as filled into %ds:%si */
   23.40 +} __attribute__ ((packed));
   23.41 +
   23.42 +extern u32 boot_edd_signature[];
   23.43 +extern u8 boot_edd_signature_nr;
   23.44 +extern struct edd_info boot_edd_info[];
   23.45 +extern u8 boot_edd_info_nr;
   23.46 +
   23.47 +#endif /* __XEN_EDD_H__ */