| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This small patch fixes an issue leading to a crash (segfault, although
with earlier changesets I was seeing sigbus - not sure what changed)
in qemu-dm when the following conditions occur:
1. A valid mapping for a bucket on a low address exists
2. Immediately after accessing memory mapped in this bucket, an access
occurs to a high (beyond assigned ram) address beyond the 1GB limit
for 32bit map cache wrapping around to the previous bucket's entry
number.
3. The next call to map cache again accesses the low address.
In this scenario, the guest mem for the low bucket has been unmapped
by the remap_bucket caused by 2., but because the valid_mapping
bit-test fails, map_cache returns before last_address_index has been
updated. The subsequent call to map_cache therefore never remaps the
low, valid bucket and instead returns a vaddr pointing to memory that
has failed to get mapped.
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- fix ioemu segv with old firmware
Without notifying ioemu of address, ioemu will segv.
- fix qemu-dm segv with malicous firmware
If notifying ioemu more than once, ioemu will segv.
Usually such cases don't happen, but malicious guest can
do it intentionally.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
|
|
|
|
|
|
|
| |
Current code does not set dev->msix->table_off variable.
The offset of MSI-X memory mapped table is treated as 0.
The wrong region is unmapped from guest physical memory space.
As a result, guest device driver can't access memory mapped resource.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
| |
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
| |
For HVM guest, we can't do pci-attach/pci-detach for >64 times due to
the meaningless checking in pci_register_device(). I made a test of
300 times of attach/detach and everything now works well.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
|
|
|
|
| |
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
| |
since our seek times are virtually 0. Although this flag is
deprecated by newer ATA standards, Linux at least checks it for CD
drives, and would timeout in some cases if we do not set it.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When creating an HVM domain, if e.g. another domain is created before
qemu allocates video memory, the extra 8MB memory ballooning is not
available any more, because it got consumed by the other domain.
This fixes it by taking video memory from the main memory:
- make hvmloader use e820_malloc to reserve some of the main memory
and notify ioemu of its address through the Xen platform PCI card.
- add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow
ioemu to move the MFNs between the original position and the PCI
mapping, when LFB acceleration is disabled/enabled
- add a remove_from_physmap memory op, to allow ioemu to unmap it
completely for the case of old guests with acceleration disabled.
- add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to
get the MFNs of the video memory.
- have xend save the PCI memory space instead of ioemu: if a memory
page is there, the guest can access it like usual memory, so xend
can safely be responsible to save it. The extra benefit is that
live migration will apply the logdirty optimization there too.
- handle old saved images, populating the video memory from ioemu if
really needed.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
| |
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
| |
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
|
|
|
|
|
|
| |
That permits to reduce the amount of difference with upstream.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
|
|
| |
There is a small bug on the serial emulation code that prevents kgdb
from working correctly over the serial.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
|
|
|
|
|
|
| |
That is actually a no-op since it just sets it to NULL again, but
makes sense.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
|
|
| |
Check BAR type indicator to avoid I/O BAR being mistaken as 64-bit =
memory BAR.
Signed-off-by: Yu Zhao <yu.zhao@intel.com>
|
|
|
|
|
|
|
| |
Currently we are trying to read the same value twice in the
serial_load function, this patch fixes that.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
|
|
|
|
|
|
|
|
| |
memory sizes greater than 2GB when built as a 32-bit binary.
Instead, direct HVM Linux loading approximates end of low memory via a
different method.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
| |
There is no need for a flush on read-only disks. It would actually
even error out and disturb the guest.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pt_bar_reg_parse() is called for expansion rom base address register.
Currently it returns PT_BAR_FLAG_MEM if bit 0 is 0. It returns
PT_BAR_FLAG_IO if bit 0 is 1.
But bit 0 in expansion rom base address register is enable bit. If bit
0 is 1 for some reason, it returns PT_BAR_FLAG_IO. Expansion rom is
mapped to memory space. It should return PT_BAR_FLAG_MEM.
After applying this patch, it returns PT_BAR_FLAG_MEM regardless
of bit 0, when it is called for expansion rom base address register.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
|
| |
I forgot to shift value read from real device. If the emulated
register offset is not aligned with 4 byte, the write emulation will
not be handled well because of corrupting register value read from
real device. The patch fixes this issue.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
| |
libpci returns ALL F when error occurs. Currently, if libpci returns
ALL F, emulation stops. But it is possible that the field of real register
which is read by guest software is ALL F.
After applying this patch, if libpci returns ALL F, ioemu will log
warning message and continue the emulation.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes writing handlers for base address registers (include
expansion rom base address register) as follows.
It can be applied to both ioemu-remote and ioemu.
- Current implementation can not work fine when base address registers
are accessed via 1 byte write access and 2 byte write access. This
patch enables them.
- Currently guest software can set address which is not aligned
with resource size and page size. The patch does not allow guest
software to set unaligned address.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- fix log messages to make analysis easier when issue occurs.
- remove verbose message.
- add comments in the source code.
- fix wrong comments in the source code.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch backports following changes of ioemu-remote to ioemu.
It fixs warning in tools/ioemu/hw/pass-through.h and
tools/ioemu/hw/pass-through.c.
commit 30f00a0284a5ee356de6f6095e52173f2234145b
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Fri Jul 18 16:02:23 2008 +0100
hw/pass-through.c: pt_unregister_regions returns void
It only ever falls off the end, and its return value is not used
by its one caller.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
commit 439836900dad41f66234d2a14981aa2a90d4d346
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Tue Jul 22 11:55:18 2008 +0100
Add missing cast for printf of maddr
commit cf5b00e6b714eb5f900d55471d85956b09cb8fd9
Author: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Thu Jul 24 13:57:10 2008 +0100
pass-through.h: Sprinkle some #ifdefs to cope with pciutils-dev
versions
Some versions of pciutils-dev contain #defines which others are
lacking.
To avoid spurious compiler warnings we add some #ifdefs. *sigh*
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
| |
... as it's implied by the function name.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
| |
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
| |
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
|
|
|
|
|
|
| |
When we don't have an LFB (standard VGA), we can not and do not need
vram tracking at all since we always get explicit dirtying.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
| |
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
|
|
|
|
| |
When passthrough device is hot removed from HVM domain by "xm
pci-detach" command, following issues occur. The patch fixes them.
- Allocated memory is not deallocated.
- Unbind interrupt with invalid interrupt pin.
- MSI-X memory mapped register area is not unmapped.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
|
|
| |
We may well want it in future anyway, and changing it makes
save/restore compatibility difficult.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
| |
Signed-off-by: Frederic Guihery <sygus@cat-lan.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
|
|
|
|
|
|
| |
We can now actually drop the shadow vram entirely thanks to dirty page
tracking.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
|
|
| |
Since we only emulate the cirrus VGA video card which is only able to
expose 4MB video memory, we don't need more than that.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
| |
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
| |
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
|
|
|
|
|
|
|
|
|
|
|
| |
In pt_bar_mapping function, r->addr should not be changed by invalid
value(-1). This value(-1) causes failure of mapping BAR when I/O Space
or Memory Space enable bit is updated repeatedly by native windows
driver.
This situation occurs in Windows Vista guest.
Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
|
|
|
|
|
|
| |
>> is less prioritized than -
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
| |
Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
|
|
|
|
|
|
|
|
| |
Previously, all data descriptors used TSE context descriptor. It's not
correct, per spec, data descriptor uses TSE bit to indicate whether
use TSE. Legacy data descripter never use TSE.
Signed-off-by; Anthony Xu <anthony.xu@intel.com>
|
|
|
|
|
|
|
|
|
| |
The address_bits field will be limited to 8 bits and is now embedded
in the mem_flags member, which additionally contains the node number
(limited to 8 bit).
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and Device Specific Registers for pt device.
I implemented following Capability Structures and Device Specific
Registers.
* Configuration Header Type 0
-> emulation.
"emulation" does not mean no accessing real I/O device.
Access real I/O device, but guest value and real value
might be different.
* MSI Capability Structure
-> emulation.
Behavior is not changed from existed implementation in
pt-msi.c, although code is changed.
* MSI-X Capability Structure
-> emulation.
Behavior is not changed from existed implementation in
pt-msi.c, although code is changed.
* PCI Express Capability Structure
-> emulation.
* PCI Power Management Capability Structure
-> emulation.
* Vital Product Data Capability Structure
-> emulation.
Emulated register is only Next Capability Pointer
Register.
All other registers are passthrough.
* Vendor Specific Capability Structure
-> emulation
Emulated register is only Next Capability Pointer
Register.
All other registers are passthrough.
* Device Specific Register (exclude capability structures)
-> passthrough.
The device drivers in guest domain are allowed to access
Device Specific Register. So various I/O device will work.
I assigned following device to guest domain, and they worked fine.
- PCIe NIC (MSI)
- PCI NIC (MSI)
- UHCI (INTx interrupt)
- IDE Controller (INTx interrupt)
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
|
|
|
|
|
| |
From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
| |
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
| |
From: Haitao Shan <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
| |
Set dom->buffer.max_capacity to xend configured limit.
Signed-off-by: Pat Campbell <plc@novell.com>
|
|
|
|
|
|
|
|
|
|
| |
hypervisor about memory changes.
The impact on disk performance is typically making it from 71.5MBps
down to 70.5Mbps during the live migration. The impact on network
performance is actually even hard to measure.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
|
|
|
|
|
|
| |
Remove redundant code.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
|
|
|
|
|
|
| |
usbdevice = "disk:<filename>"
expect a raw device (as this probably is the most usual case) and
usbdevice = "disk-qcow:<filename>"
expect a COW image (autodetected, probably qcow2).
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is an extension for qemu-dm to enable emulation of generic
PCI devices. The information for the PCI devices can be passed by
command line parameter.
The command line parameter is "-pciemulation" followed by the
information which contains a label and hex value of the configuration
registers separated by ":".
The configuration registers for each PCI device are below.
vendorid
deviceid
command
status
revision
classcode
headertype
subvendorid
subsystemid
interruputline
interruptpin
This is an example of command line parameter.
-pciemulation hba1:1240:0780:0002:0:0:010000:0:10b5:0777:05:1
Signed-off-by: Shinji Matsumoto <smatsumoto@marathontechnologies.com>
|