Commit Graph
117 Commits
Author SHA1 Message Date
Tim Deegan ba0f039582 [HVM] Add expansion-ROM boot support again.
Boot info now stored at 0x9ff00; registers saved in HDD load code.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2007-01-08 14:24:30 +00:00
Tim Deegan a20cd2c5ce [HVM] Revert cset 13103 for now, as it is causing boot errors.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2006-12-22 22:57:47 +00:00
Tim Deegan 95dae30a62 [QEMU] Align VGA ram allocation
This makes the SSE-optimized vram_dirty() safe again.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2006-12-21 13:43:19 +00:00
Tim Deegan 15fbe9ca52 [HVM] Add expansion-ROM boot support to the ROMBIOS
This is rudimentary support for parts of the BIOS Boot Specification,
just enough to use Etherboot ROM images.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
2006-12-20 11:57:53 +00:00
kfraser@localhost.localdomain 0bbc8c5421 [HVM] qemu mouse: Adds support for USB mouse/tablet status check and
restricts Universal Host Controller interrupt generating when received
NAK in interrupt transfer.

According to usb spec, USB mouse/tablet device returns NAK to host
controller if its status does not alter in interrupt transfer.
And UHC should leave a TD active when receiving NAK and execute this
incompleted TD in a subseqent frame. UHC only generates an interrupt
on complete after the TD with ICO bit is completed.

This patch make UHC & USB mouse/tablet behave consistently with spec.

Signed-off-by: Xinmei Huang <xinmei.huang@intel.com>
2006-12-07 11:52:26 +00:00
kfraser@localhost.localdomain 03b88d5789 [VTPM][HVM] Transmit the locality in which the command was sent in the
highest 3 bits of the 4 bytes prepended to each packet.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-12-07 11:17:28 +00:00
kfraser@localhost.localdomain a52cacaef9 [QEMU] Error reporting in IDE device model.
Following on from my patch to make blktap report I/O errors back to
guest OS, a similar problem exists in the QEMU codebase. The IDE
driver never reports I/O errors during read/write operations back to
the guest OS. Instead all I/O operations are reported as
succesfull. If, for example, the host FS holding the disk image fills
up, then writes may fail due to lack of space. Since the guest OS
never sees these failures, it assumes all is well & will continue
writing. Eventually this can lead to severe & unrecoverable filesystem
corruption.

The attached patch fixes QEMU ide driver such that any failure of a
read or write operation sets the appropriate IDE status/error
registers. Having read the ATA-6 spec I think the most compliant
behaviour is to set the status register to 'READY_STAT | ERR_STAT',
and the error register to ABRT_ERR. There is already a convenience
function ide_abort_command() in the QEMU codebase which does just
this, so the attached patch simply calls that function.

With this patch the guest OS sees the I/O failure & the kernel logs
IDE errors and then retries the operation. This at least ensures that
the guest can be shutdown the out of space issue in the host corrected
and the guest restarted, without any serious filesystem damage having
occurred.

From: Daniel Berrange <berrange@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-12-04 09:29:26 +00:00
kfraser@localhost.localdomain 671ac0de22 [QEMU] usb-uhci: Data buffer is too small
The data buffer is only 1280 bytes long but the user-supplied length
can be as large as 0x7ff.  This patch extends the buffer to 2048
bytes.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-11-30 17:33:11 +00:00
kfraser@localhost.localdomain c669da88e2 [QEMU] Simpler workaround for guest writes to PCI config
space that extend past byte 0xff.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-30 17:32:16 +00:00
kfraser@localhost.localdomain 2b87d5adbb [QEMU] pci: Unaligned config read/write overflow
The default config read/write handlers allows a 4-byte read/write at
address 255.  This can clobber the field after the config area.  This
happens to be the PCIBus pointer in the PCIDevice structure.

This patch stops this from reducing the read/write to the (largest
multiple of 2) number of bytes within the config area.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-11-28 13:46:10 +00:00
kfraser@localhost.localdomain d81e62bebd [QEMU] fdc: Limit sector size to 16K
In fdctrl_start_transfer the sector size field (fifo[5]) is not
checked for overflows.  This allows an arbitrarily large sector size
to be used, which can in turn result in a negative data_len field that
is then used for DMA transfers.

This can lead to the corrpuption of qemu state because some subsequent
checks on the transfer length is conducted using signed integers.

This patch limits the value fifo[5] to 7 which is the standard limit
on floppy sector size.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-11-27 10:09:19 +00:00
kfraser@localhost.localdomain 329f3fcc6e [QEMU] rtl8139: Disallow chaining above 64K
As it stands the 8139C+ TX chaining is only bounded by realloc failure.
This is contrary to how the real hardware operates.  It also has DoS
potential when ioemu runs in dom0.

This patch makes any attempt to chain a frame beyond 64K fail
immediately.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-11-17 10:34:08 +00:00
kfraser@localhost.localdomain 1ec2a5bbca [IOEMU] Simply fake-bios init of the piix4acpi device.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-13 14:25:48 +00:00
kfraser@localhost.localdomain f923f3a5f1 [HVM][IA64] Due to IPF Guest Firmware will enumerate PCI, shutdown in
IPF doesn't work This patch makes shutdown work for IPF.

Signed-off-by, Anthony Xu <anthony.xu@intel.com>
2006-11-13 14:20:26 +00:00
kfraser@localhost.localdomain 10967e5464 [IOEMU] Fix Linux smp guest hangs with complaint "BUG: soft lock detected on CPU#0"
When console=ttyS0 in guest grub configuration and serial='pty' in vmx
configure file. The root cause to this bug is the characteristic of
PTY emulator in Qemu. PTY has write/read end with some buffer. Write
to a buffer will be failed after the buffer is full until read end
reads the data from buffer.

Previous to changeset 12026, write to serial port would fail quietly
when buffer for pty is full. With changeset 12026, write to serial
port would retry 3 times in 300ms if failed, even without notifying
guest using serial irq. Smp guest will hang, waiting for an
interrupt. For SMP guest, a watchdog thread should be executed
periodically, otherwise soft lockup is detected. With this patch, an
upper threshold of total consecutive retries is added and serial
interrupt would be sent after retry 3 times for each write request,
even if failed.

Signed-off-by: Xinmei Huang <xinmei.huang@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-13 09:46:05 +00:00
kfraser@localhost.localdomain a75394cc81 [HVM] Fix Qemu-dm serial issues:
1. Retry transmit via a polling timer if a byte cannot be written
    immediately to its destination.
 2. Turn off output processing of raw serial lines.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-30 09:45:17 +00:00
kaf24@localhost.localdomain 9bbcb18fab [QEMU] Add a TIS device model compliant to the 1.2 TPM specification.
It implements all registers necessary to make the Linux TIS driver
work (tpm_tis.c). All of the basic registers supported by this type of
device are implemented. Also the locality selection has been
implemented, but has not been tested. The legacy registers as
described in the specification are not supported.

Current caveat: The device has so far not yet been integrated with the
virtual TPM available in the repository. It will require changes to
the virtual TPM spawned by the vTPM manager to offer an additional message
interface. The TIS interface itself then needs to have an additional
transport implemented. (see vTPMTransmit array).

The relevant specification for the device model can be found here:
https://www.trustedcomputinggroup.org/groups/pc_client/TCG_PCClientTPMSpecification_1-20_1-00_FINAL.pdf

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-10-27 19:15:48 +01:00
kaf24@localhost.localdomain 94c50cc02b [QEMU] ne2000: Stop memory access beyond buffer
As a program that runs in dom0 which serves users from guests,
the qemu drivers need to be vigilant to the input that comes
from the guests since they may be malicious.

As it is there are multiple ways to get ne2000 to read/write
memory beyond the 48K buffer that it has allocated for each
adapter.

This patch checks the addresses and prevents this from occuring.

The boundary is checked each time since it's changed for every
packet received while the other parameters are only changed
(by the guest) during setup.

Signed-off: Herbert Xu <herbert@gondor.apana.org.au>
2006-10-27 17:50:40 +01:00
kfraser@localhost.localdomain 3084f41064 [HVM] Windows HCT requires non-zero subvendor details in platform PCI device.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2006-10-19 16:32:11 +01:00
kfraser@localhost.localdomain 923fbdf607 [HVM] Enable DMA mode for CD-ROM IDE ATAPI interface.
Signed-off-by: Winston Wang <winston.l.wang@intel.com
2006-10-18 18:41:47 +01:00
Steven Smith 832f7ab187 [HVM] Rate limit guest accesses to the qemu virtual serial port. This stops
grub's boot menu from hammering dom0.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-09-25 17:27:18 +01:00
Steven Smith 15c05dca32 [HVM] Reduce VNC overhead, by (a) only scanning framebuffer when a client
is connected, and (b) fixing an overflow bug in the scanning code which
prevented the dirty bit from ever getting cleared.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-09-21 17:56:14 +01:00
Steven Smith 5759c4fb6b [HVM] Use the right, PCI SIG assigned, vendor ID for xensource rather than
just making one up.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-09-21 11:15:13 +01:00
Christian Limpach c9325b7833 [qemu] Fix PCI config header space writes and set Subsystem-Vendor ID fields.
Fix failure in Windows HCT's PCI-Compliance-Test by invalidating the
writing to read-only/reserved fields in PCI configuration space header
and giving Subsystem-Vendor-ID field a valid value via copying Vendor-ID
field into it.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2006-08-28 22:43:09 +01:00
Christian Limpach 113654b9fe [qemu] hdparm tunable IDE write cache for HVM
qemu 0.8.2 has a flush callback to the storage backends, so now it is
possible to implement hdparm tunable IDE write cache enable/disable for
guest domains, allowing people to pick speed or data consistency on a
case by case basis.

As an added benefit, really large LBA48 IOs will now no longer be broken
up into smaller IOs on the host side.

From: Rik van Riel <riel@redhat.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-20 23:59:34 +01:00
Christian Limpach 03a84fa9bd [qemu] Allow booting from more than one device.
The rombios supports trying to boot from more than one device and then
falling back.  Set 'boot=dc' in your config file to try booting first
from the CD and then the hard drive.

Based on a patch from: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-20 23:33:28 +01:00
Christian Limpach aad7f0d072 [qemu] Support HVM guests with more than 3.75G memory.
Changes are:
1) M2P table and e820 table are changed to skip address space from
HVM_RAM_LIMIT_BELOW_4G to 4G.
2) shared io page location, when less than HVM_RAM_LIMIT_BELOW_4G
memory, it's the last page of RAM as today, or it's the last page of
HVM_RAM_LIMIT_BELOW_4G RAM.
3) in qemu-dm address space from HVM_RAM_LIMIT_BELOW_4G to 4G are
stuffed with mfns starting from 4G, so the 1:1 mapping can still works.
This is ugly, but another limit check patch as changeset 10757 will
prevent qemu-dm to access this range.  This ugly stuffing will be
removed when the patch to remove 1:1 mapping from qemu-dm gets accepted
in the future.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-17 20:31:13 +01:00
chris@kneesaa.uk.xensource.com 30841bdf6d [qemu] Add the xen platform device to the qemu PCI bus.
Useful functionality will come later.

Signed-off-by: Steven Smith <ssmith@xensource.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-17 12:01:23 +01:00
chris@kneesaa.uk.xensource.com c6d786bfd0 [qemu] Move acpi to devfn 2, so that it matches the fadt.
Based on feedback from: Wang, Winston L <winston.l.wang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-09 21:33:59 +01:00
chris@kneesaa.uk.xensource.com 54ec6e3d26 [qemu] HVM acpi port init update.
Removed the acpi port depency on USB exist.

Based on a patch from: Winston Wang <winston.l.wang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-09 20:07:01 +01:00
chris@kneesaa.uk.xensource.com 559b3dff6d [qemu] Disable qemu's acpi support.
Based on a patch from: Wang, Winston L <winston.l.wang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-09 19:57:03 +01:00
chris@kneesaa.uk.xensource.com 21d94d9388 [qemu] Update ioemu to qemu 0.8.2. (.CVS files)
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-07 18:26:20 +01:00
chris@kneesaa.uk.xensource.com b5d8830efe [qemu] Update ioemu to qemu 0.8.2.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-07 18:25:30 +01:00
chris@kneesaa.uk.xensource.com 1f401924d5 [qemu] Add missing semicolon.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-04 11:35:51 +01:00
chris@kneesaa.uk.xensource.com c4a18a0435 [qemu] Update acpi timer to not use a qemu timer.
Compute the acpi timer's value when it is accessed instead of using
a qemu timer to keep it uptodate.

From: Wang, Winston L <winston.l.wang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-04 11:33:41 +01:00
chris@kneesaa.uk.xensource.com 621578a369 [qemu] Add switch to control whether acpi bridge is enabled.
Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-08-04 10:41:27 +01:00
chris@kneesaa.uk.xensource.com ae97d42025 [qemu] Use xenstore to configure ioemu block devices.
- read ioemu block device config from xenstore
- don't require the ioemu: prefix on block devices any longer
- allow change of media associated with cdrom drives
- replace cdrom= option by :cdrom suffix on regular block device config:
  'file:/root/mytest.iso,hdc:cdrom,r'
- don't create default cdrom drive anymore - to create default empty
  cdrom drive use: ',hdc:cdrom,r'

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-08-03 18:28:29 +01:00
emellor@leeni.uk.xensource.com 9212caa7a4 Rename all the CVS directories to .CVS. We want to keep the references to
upstream QEMU, but they can be confusing when they are called CVS.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-08-01 14:34:18 +01:00
chris@kneesaa.uk.xensource.com b26303fc1e [qemu] Add missing vga_bios_init call.
From: Zhang, Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-07-27 11:12:04 +01:00
chris@kneesaa.uk.xensource.com f450023e01 [qemu] Initialize vga from within qemu for when the bios doesn't do so.
On xen/x86, vga bios is copied to 0xC0000 by guest firmware.
However on ia64 platform, native firmware depends on some
initialization vga state at power on and so does guest firmware.
That's why that vga bios initialization stub is required for vti
domain, to match platform requirement.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-07-26 15:20:30 +01:00
chris@kneesaa.uk.xensource.com 5ac14a2322 IA64-specific code for new Qemu
Due to some ia64 patches aren't checked into xen-unstable.hg.
I reversed related logic. 

Signed-off-by: Zhang xiantao <xiantao.zhang@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-07-26 13:41:10 +01:00
chris@kneesaa.uk.xensource.com f2cdd93694 [qemu] Fix HVM guests with more than 2G RAM on x86_64,
where "startx" will cause qemu dm to die.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-07-26 13:23:05 +01:00
chris@kneesaa.uk.xensource.com 8f4b90220c Add qemu 0.8.1 based ioemu.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-07-12 19:16:10 +01:00
chris@kneesaa.uk.xensource.com ef52abce73 Remove qemu 0.6.1 based ioemu.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2006-07-12 19:16:07 +01:00
kfraser@dhcp93.uk.xensource.com 6f8425d69d [HVM] Disable pmtimer in qemu acpi device model. Needs fixing
to not burn ~25% of a 3GHz CPU.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-07-03 16:07:20 +01:00
kaf24@firebug.cl.cam.ac.uk 9402c1936d [HVM] Clean up formatting of new piix acpi file.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-06-17 09:19:16 +01:00
kaf24@firebug.cl.cam.ac.uk 9c15ad745c [HVM] ACPI support patch 4 of 4: shutdown.
The patch is incorporated  from Ben's Virtual Iron's ACPI shutdown patch
in changeset 9989:f8d20c3e4225
The patch support guest ACPI Windows shutdown, as well as ACPI guest
Linux "halt -p" and "shutdown -h now".

Signed-off-by: Ben Thomas <ben@virtualiron.com>
Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-06-17 09:08:14 +01:00
kaf24@firebug.cl.cam.ac.uk c45e9f7a4f [HVM] ACPI support patch 2 of 4: ACPI timer.
ACPI timer is required during guest windows installation and boot.

Signed-off-by: Tang Liang <tangliang@lenovo.com>
Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-06-17 09:05:34 +01:00
kaf24@firebug.cl.cam.ac.uk f4cdf1dbe8 [HVM] ACPI support patch 1 of 4: main components.
The patch support ACPI UP Guest Windows 2000,  XP and 2003, based on
this we are going to add more support on SMP and 64bit Windows( which
are only working in ACPI mode) later. We tested: in ia32 guest:

  a. Installation and boot of  Windows XP sp2 and 2003 server in ACPI
mode
  b  when boot to both window, no yellow mark in device manger and  USB,
network card and IDE DMA are working.
  c. clean boot (without ACPI related errors) on UP and  4 vcpu rhel4u1
SMP guest and got ioapic Interrupt assigned according to ACPI DSDT
table's _PRT table's GSI.
  
To minimize the implementation efforts to satisfy the ACPI OS
installation and boot, we implemented  ACPI only event logical model by
emulating ACPI hardware based on PIIX4 (Intel 82371ab) by:  Populating
the PIIX4  ACPI bridge PCI configuration space; Adding ACPI timer
(required during windows installation/boot), PM1 event register block
and PM1 control register block (both are required during
installation/boot, shutdown, entering and leaving PM S state if adding
those features later), we provided full ACPI hardware registers above
using byte/word/dword access per ACPI spec requirement.

The patch also fixed many existing hvm ACPI related bugs, such as
warnings when boot to ACPI  UP and SMP guest Linux OS; adding new ACPI
_PRT table reporting PCI IRQ routing table in PIC mode,  adding new _PRT
table in APIC mode, that fixed no IRQ GSI cause it is forced to shutdown
when OS find new device to assign IRQ without ACPI event service; The
patch also fixed the ACPI DSDT table's  PCI resource conflict with guest
e820 table when booting and installing ACPI Windows; we also added ACPI
shutdown service by incorporating the code in ACPI "hardware enable
register writer" from  Ben's Virtual Iron's team's patch in changeset
9989:f8d20c3e4225.

We only provide minimum power management requirement support per spec-c1
and S5 for shutdown, may be S4 (hibernating which is meaningful for user
to save their working section)  in the future.

Please note, current patch needs to  have following switches in guest
configuration to enable proper ACPI support
  a. need to add ACPI=1 (apic=1 if boot SMP Linux guest plus vcpu=
number want to test) in xmexample.hvm
  b. need to add USB support: USB=1 and usbdevice='device' (or
='tablet') as the pm register base is static..., I will adding dynamic
ACPI FADT table for pm register base pointer later.

When installing guest OS in ACPI mode, need to manually tell Windows
setup program to install single core ACPI HAL:
   After passing the 1st screen of windows setup of install Windows,
   the first thing you'll see at the bottom of the screen is the
   option to press F6 if you need to install a SCSI or RAID
   controller. Don't press F6. Press F5 instead. This will take
   you to a separate menu of Hardware Abstraction Layer's where
   you can choose an appropriate HAL .The choices will be:
  
   ACPI Multiprocessor PC
   ACPI Uniprocessor PC
   Advanced Configuration and Power Interface (ACPI) PC
   ...
   Standard PC
   Standard PC with C-Step i486
  
Please select "Advanced Configuration and Power Interface (ACPI) PC"
using current patch.

Signed-off-by: Winston Wang <winston.l.wang@intel.com>
2006-06-17 09:00:16 +01:00
kaf24@firebug.cl.cam.ac.uk cd9d70925c [HVM][DM] Backport the USB support from QEMU 0.8.1 to the current Xen
device model. To support USB there are two new optional config lines
that can be added to the guest config file:

    usb=1
        This will enable USB without defining a specific USB device.
        This option is assumed and not needed if the `usbdevice' option
        is given.

    usbdevice='device'
        This will enable USB and also enable support for the given device.
        Currently, the only two devices are `mouse' (a PS/2 mouse) and
        `tablet' (an absolute pointing device).  The advantage of `tablet'
        is that Windows guests will automatically recognize and support this
        device so specifying the config line:

                usbdevice='tablet'

        will create a mouse that works transparently with Windows guests
        under VNC.  (Linux doesn't recognize the USB tablet yet so Linux
        guests under VNC will still need the Summagraphics emulation.)

Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
2006-06-12 09:06:55 +01:00