We cannot get correct records of VDI by VDI.get_record.
The correct records of VDI are gotten by this patch.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
I met the following panic message in mcheck_mca_logout().
MSR_IA32_MCi_ADDR might take the values other than the machine
address. FATAL PAGE FAULT occured when the non-existent address is
passed to maddr_get_owner().
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
This patch cleans up queued invalidation, including round wrap
check, multiple polling status and other minor changes. This version
uses local variable as the polling address, which is clean.
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
This is the patch to correct pygrub return value for checkPassword()
function. It didn't return False at the end of the function. It
returned None so it was working fine and it's most likely just a
cosmetic issue.
Also, the missing () were added to checkPassword() function when
calling hasPassword and the unnecessary comment was removed.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
The following error message was shown by xm migrate command.
In fact, I caused the command error by intention. I prepared a
destination server where free memory was insufficient, and then
I tried to migrate a VM to the destination server. As I had
expected, the command error occurred. However the error message
was different from my expectation. I would like to show an error
message from the destination server if an error occurred on the
destination server.
# xm migrate --live vm3 bx339
Error: (107, 'Transport endpoint is not connected')
Usage: xm migrate <Domain> <Host>
Migrate a domain to another machine.
Options:
-h, --help Print this help.
-l, --live Use live migration.
-p=3Dportnum, --port=3Dportnum
Use specified port for migration.
-n=3Dnodenum, --node=3Dnodenum
Use specified NUMA node on target.
-s, --ssl Use ssl connection for migration.
If a destination server sends an error message, this patch shows=20
the error message. For example, the following error message is=20
shown if free memory of the destination server is insufficient.
# xm migrate --live vm3 bx339
Error: I need 262144 KiB, but dom0_min_mem is 716800 and shrinking
to=20
716800 KiB would leave only 50368 KiB free. (from bx339)
Usage: xm migrate <Domain> <Host>
Migrate a domain to another machine.
Options:
-h, --help Print this help.
-l, --live Use live migration.
-p=3Dportnum, --port=3Dportnum
Use specified port for migration.
-n=3Dnodenum, --node=3Dnodenum
Use specified NUMA node on target.
-s, --ssl Use ssl connection for migration.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
p2m_pod_demand_populate is too non-EPT-p2m-centric. Reorganize code
to have a p2m-specific call that wraps a generic PoD call.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Clean up and reorganize some code in preparation for adding
populate-on-demand functionality.
Should be no functional difference.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
The PoD code assumes that if:
* A page is in a domain's p2m table
* And it's owned by the domain
* And it's not a xenheap page
then:
* It's on the domain's page list.
This patch adds a check for this assumption when debug=y.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Don't reclaim xenheap-allocated pages in the zero-sweep. This avoids
grabbing things like grant tables mapped in the p2m.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Neither memory from the allocator nor memory from
the balloon driver is guaranteed to be zero. Scrub it
before adding to the cache.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
map_domain_page() cannot return NULL. And if it could, both instances
changed here would leak memory in such a case.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
While get_page_and_type_from_pagenr() (through get_page_from_pagenr())
does the needed mfn_valid() check, get_data_page() doesn't and, it
being passed a struct page_info pointer, really expects it's caller(s)
to do.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
When I started a VM by using xm create command, cpus parameter in VM
configuration files was ignored. The problem occurred only when I
used XenAPI. This patch makes the parameter available.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
pvops dom0 kernels have a separate xenfs which has to be mounted on
/proc/xen. Systems with older configurations don't have xenfs listed
in fstab, and it can sometimes make sense to keep it that way (for
example, if the dom0 wants to boot a native-only kernel too).
The attached patch to the script which ends up in /etc/init.t/xend
mounts /proc/xen if it appears to be necessary.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
pv-ops dom0 contains Linux upstream VT-d driver, and will go to enable
it when VT-d is set in kernel config file. It should not enable VT-d
in dom0.
Currently it already zaps ACPI DMAR signature to prevents dom0 using
VT-d HW when VT-d is enabled for Xen. But when VT-d is not enabled for
Xen, and VT-d is set in pv-ops kernel config file, pv-ops dom0 will go
to enable it. This will results in pv-ops dom0 booting failure. This
patch prevents dom0 to use VT-d HW whether VT-d is enabled or disabled
for Xen.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Currently when assigning device to HVM guest, we use the strict check
for HVM guest by default.(For PV guest we use loose check
automatically if necessary.)
When we assign device to HVM guest, if we meet with the co-assignment
issues or the ACS issue (see changeset 20081: 4a517458406f), we could
try changing the option to 'no' -- however, we have to realize this
may incur security issue and we can't make sure the device assignment
could really work properly even after we do this.
The option is located in /etc/xen/xend-config.sxp:
(pci-passthrough-strict-check yes)
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
We also need to create IRTE for it since we enable EIM and clear CFI,
or else, the IOAPIC RTE's interrupt message would be blocked by IR unit.
In io_apic_read_remap_rte(), we now use
"apic_pin_2_ir_idx[apic][ioapic_pin]"
rather than "(remap_rte->index_15 << 15) | remap_rte->index_0_14" to
avoid the "interrupt remapping table out of bound error".
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
1) apic_pin_2_ir_idx should be int** rahter than unsigned int**,
because we use the int -1 to indicate that the related IRTE index is
not allocated.
2) shouldn't re-init apic_pin_2_ir_idx when resuming from S3.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Fix the issue when importing 'crypt' module or crypt.crypt fails in
pygrub. The exception is written on the same line like "Failed!"
message but only if there is an exception. If there is no exception,
we don't bother users with details (probably the password they entered
was wrong) so we just display "Failed!" message. Also, the code for
hasPassword() was rewritten not to have try/except block here.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
dma_msi_set_affinity()
If set_desc_affinity() fails, the current code doesn't release the
spinlock. We should obtain the lock at a later place.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
The attached patch enables to set the environment variables for xend
in /etc/sysconfig/xend.
There are four variables.
XENCONSOLED_TRACE=3D[none|guest|hv|all]
XENSTORED_ROOTDIR=3D/var/lib/xenstored
XENSTORED_TRACE=3D[yes|on|1]
XENBACKENDD_DEBUG=3D[yes|on|1]
The XENCONSOLED_TRACE and XENSTORED_ROOTDIR take strings for each
command's options. And if thease variables have non-zero strings, then
export them.
If the XENSTORED_TRACE and XENBACKENDD_DEBUG take either "yes", "on"
or "1" then export them.
From: Kazuhiro SUZUKI <kaz@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Add a xen boolean parameter 'x2apic'.
Add a xen boolean parameter 'x2apic_phys'(by default, we use logical
cluster mode).
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
enabled
When x2APIC and Interrupt Remapping(IR) with EIM are enabled, we
should use 32-bit Destination ID for IOAPIC and MSI.
We implemented the IR support in xen by hooking the functions like
io_apic_write(),io_apic_modify(), write_msi_message(), and as a
result, in the hook functions in intremap.c, we can only see the 8-bit
dest id rather the 32-bit id, so we can't set IR table Entry that
requires a 32-bit dest id.
To solve the issue throughly, we need find every place in io_apic.c
and msi.c that could write ioapic RTE and and device's msi message and
explicitly handle the 32-bit dest id carefully (namely, when genapic
is x2apic, cpu_mask_to_apic could return a 32-bit value); and we have
to change the iommu_ops->{.update_ire_from_apic, .update_ire_from_msi}
interfaces. We may have to write an over-1000-LOC patch for this.
Instead, we could use a workround:
1) for ioapic, in the struct IO_APIC_route_entry, we could use a new
"dest32" to refer to the dest field;
2) for msi, in the struct msi_msg, we could add a new "u32 dest".
And in intremap.c, if x2apic_enabled, we use the new names to refer to
the dest fields.
We can improve this in future.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
1) Clear Interrupt Remapping(IR) unit's CFI (Compatibility Format
Interrupt) to enhance security;
2) Move the iommu_setup() ahead and put it before we begin to use
IOAPIC so we can make sure after we enable Interrupt Remapping, the
later IOAPIC (and MSI) initialization would setup IOAPIC RTEs (and
MSI) with remappable format;
3) Enable x2APIC only when all VT-d engines support IR with EIM
(Extended Interrupt Mode). EIM enables external devices to deliver
interrupts to logical processor with >8-bit APIC ID.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
- fix the mapping range (end_bus_number is inclusive)
- fix the mapping base address (shifting segment by 22 was set for
overlapping mappings; assuming the goal was to reduce the virtual
space used when less than 256 busses are present on all segments,
adding logic to determine the smallest possible shift value)
- fix PCI_MCFG_VIRT_END, and actually use it to avoid creating
- mappings
outside the designated range
- fix address calculations (segment numbers must be converted to long
to avoid truncation)
- add a way (command line option) to suppress the use of mmconfig as
well as to actually use the AMD Fam10 special code
- correct __init annotations
- use xmalloc()/xmalloc_array() in favor of xmalloc_bytes()
- eliminate dead code and data
Signed-off-by: Jan Beulich <jbeulich@novell.com>
For those devices not having INTx (like VFs), avoid calling map_pirq,
otherwise the guest cannot be started successfully.
Also avoid calling this hypercall for hvm guest, this is done in the
device model.
Signed-off-by: Qing He <qing.he@intel.com>
* Add necessary logging dirty in qemu to avoid guest error with
intensive disk access when live migration
* Take place of shared memory between qemu and migration tools by new
added hypercall, which is clean and simple
Signed-Off-By: Zhai, Edwin <edwin.zhai@intel.com>
Certain paths through p2m_pod_decrease_reservation() fail to reduce
the size of the PoD cache if the number of outstanding entries is less
than the size of the cache. Rearrange so this doesn't happen.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
To be able to use "bootloader" on drbd devices the following changes
need to be made:
*) Translation of devicename
_parse_uname which is used by blkdev_uname_to_file which is again used
by _configureBootloader in XendDomainInfo needs to be able to resolve
drbd resources to the corresponding blockdevice to feed to the
configured bootloader.
*) Activation of drbd device
If the drbd device isn't in Primary mode when the bootloader tries to
fetch the kernel and initrd, the start of the DomU will fail. To
prevent this the given drbd device will be made Primary before the
bootloader gets executed.
A note on the naming of drbd resouces: drbd uses mostly resource names
in it's userland tools. Because of that drbd VBDs, if configured with
the "drbd:" type, should always use the drbd resource name as
suggested by the drbd documentation at
http://www.drbd.org/users-guide-emb/s-xen-configure-domu.html. My
patches assume that the VBDs are named accordingly.
Signed-off-by: Michael Renner <michael.renner@geizhals.at>
When the guest(pv-on-hvm guest that cannot suspend) reboot in
LiveMigration, the disconnecting of src-side is not transmitted to
dist-side. As a result, the error processing on the dist side is not
executed.
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
When resuming from Dom0 S3, here 'irq' is -1, so we can't use it at
all. We should always use iommu->irq.
With the patch applied on the current tip 20153 and using the 2.6.18
Dom0, Dom0 S3 works fine (at least on my DQ35).
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>