| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xen.org>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xen.org>
|
|
|
|
|
|
|
|
|
|
|
| |
It retains IA64-specific bits in code imported from elsewhere (e.g.
ACPI, EFI) as well as in the public headers.
It also doesn't touch the tools, mini-os, and unmodified_drivers
sub-trees.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ATS device driver that support PASID [1] and PRI [2] capabilites needs
to work with iommu driver in guest OS. We have to expose iommu
functionality to HVM guest, if we want assign ATS device to it. A new
hypervisor mmio handler is added to intercept iommu mmio accesses from
guest.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
[1] http://www.pcisig.com/specifications/pciexpress/specifications/ECN-PASID-ATS-2011-03-31.pdf
[2] http://www.pcisig.com/members/downloads/specifications/iov/ats_r1.1_26Jan09.pdf
Committed-by: Jan Beulich <jbeulich@suse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this it is questionable whether retaining struct domain's
nr_pirqs is actually necessary - the value now only serves for bounds
checking, and this boundary could easily be nr_irqs.
Note that ia64, the build of which is broken currently anyway, is only
being partially fixed up.
v2: adjustments for split setup/teardown of translation data
v3: re-sync with radix tree implementation changes
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xen.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The original vmsi_deliver is renamed to vmsi_deliver_pirq. New
vmsi_deliver is dedicated to the actually delivering.
Original HVMOP number is unchanged. New operation is numbered 16
and enclosed by (__XEN__) and (__XEN_TOOLS__).
Signed-off-by: Wei Liu <liuw@liuw.name>
Signed-off-by: Keir Fraser <keir@xen.org>
|
|
|
|
| |
Signed-off-by: Wei Liu <liuw@liuw.name>
|
|
|
|
| |
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
|
|
|
|
|
|
| |
Fails current lock checking mechanism in spinlock.c in debug=y builds.
Signed-off-by: Keir Fraser <keir@xen.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this it is questionable whether retaining struct domain's
nr_pirqs is actually necessary - the value now only serves for bounds
checking, and this boundary could easily be nr_irqs.
Another thing to consider is whether it's worth storing the pirq
number in struct pirq, to avoid passing the number and a pointer to
quite a number of functions.
Note that ia64, the build of which is broken currently anyway, is only
partially fixed up.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The hvm_save code is used to save and restore hypervisor-related
hvm state, either for classic save/restore, or for migration
(including remus). This is meant to be backwards-compatible across
some hypervisor versions; but if it does change, there is no way to
handle the old format as well as the new.
This patch introduces the infrastructure to allow a single older
version ("compat") of any given "save type" to be defined, along with
a function to turn the "old" version into the "new" version. If the
size check fails for the "normal" version, it will check the "compat"
version, and if it matches, will read the old entry and call the
conversion function.
This patch involves some preprocessor hackery, but I'm only extending the
hackery that's already there.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
|
|
|
|
|
|
|
|
|
|
| |
In certain cases this will allow us to load old HVM save images where
an HVM saved chunk has subsequently been extended with new
fields. Rather than fail to load the chunk, we can pad the extended
structure with zeroes, if the caller knows how to handle that.
Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xen.org>
|
|
|
|
|
|
|
|
| |
This is preparation for implementing tasklets in vcpu context rather
than softirq context. There is no change to the implementation of
tasklets in this patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
| |
Recording old MSI info doesn't solve all the corner cases
when guest's irq migration occurs.
Signed-off-by : Xiantao Zhang <xiantao.zhang@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch improves RMRR regions handling as follows:
1) Get rid of duplicated RMRR mapping: different devices may share the
same RMRR regions, when they are assigned to the same guest, it only
need to map the same RMRR region once because RMRR region must be
identity mapped. Add an array of mapped RMRRs to achieve this.
2) Needn't call domain_context_mapping to map the device again in
iommu_prepare_rmrr_dev, and change iommu_prepare_rmrr_dev to
rmrr_identity_mapping which is more suitable.
3) A device may have more than one RMRR regions, remove "break" in
intel_iommu_add_device to let it map all RMRR regions of the device.
Signed-off-by: Weidong Han <Weidong.han@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, xen uses shared iommu domain-id across all the VT-d units
in the platform. The number of iommu domain-ids (NR_DID, e.g. 256)
supported by each VT-d unit is reported in Capability register. The
limitation of current implementation is it only can support at most
NR_DID domains with VT-d in the entire platform, even though the
platform can support N * NR_DID (where N is the number of VT-d
units). Imagine a platform with several SR_IOV NICs, and each NIC
supports 128 VFs. It possibly beyond the NR_DID.
This patch implements iommu domain-id management per iommu (VT-d
unit), hence solves above limitation. It removes the global domain-id
bitmap, instead use domain-id bitmap in struct iommu, and also involve
an array to map guest domain-id and iommu domain-id, which is used to
iommu domain-id when flush context cache or IOTLB. When a device is
assigned to a guest, choose an available iommu domain-id from the
device's iommu, and map guest domain id to the domain-id mapping
array. When a device is deassigned from a guest, clear the domain-id
bit in domain-id bitmap and clear the corresponding entry in domain-id
map array if there is no other devices under the same iommu owned by
the guest.
Signed-off-by: Weidong Han <weidong.han@intel.com>
|
|
|
|
|
|
|
| |
Make various data items const or __read_mostly where
possible/reasonable.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
|
|
|
|
|
|
|
| |
There is a race between guest setting new vector and doing EOI on old
vector. Once guest sets new vector before its doing EOI on vector,
when guest does eoi, hypervisor may fail to find the related pirq, and
hypervisor may miss to EOI real vector and leads to system hang. We
may need to add a timer for each pirq interrupt source to avoid host
hang, but this is another topic, and will be addressed later.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
|
|
|
|
|
|
|
| |
Define the related dummy functions and move the macros
as public to fix the build issue.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch targets for reducing IPIs when delivery VT-d's devices'
intrs to target vcpus. According to the experiments leveraging 10G
Oplin NIC card, CPU utilization can reduce 5%-6% and NIC's bandwidth
keeps unchanged through testings. And this patch can always benefit
UP guests with MSI-capable devices assigned and SMP guests whose
lapic's destination mode is physical mode. And also it can benefit
SMP guests whose lapic's dest_mode is logical mode but only one
destination is specified. So it should cover major cases in real
environment. Currenlty, this patch intercepts the programming for MSI
intr status, and caculate the destination id for the pirq when do the
programming in advance. When vcpu migratio n occurs or guest
re-programe MSI status, it checks that whether needs to set the
corresponding pirq's affinity of assigned devices and make vcpu's
affinity and pirq's consistent to reduce the IPIs eventually.
Signed-off-by : Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Latest Linux and Windows may adopt per-cpu vector instead of global
vector, so same vector in different vcpu may correspond to different
interrupt sources. That is to say, vector and pirq should be 1:n
mapping, and the array msi_gvec_pirq can't meet the mapping
requirement, so need to improve the related logic, otherwise it may
introduce strange issues.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
|
|
|
|
|
|
| |
passthru devices.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
from vector-based to IRQ-based.
In per-cpu vector environment, vector space changes to
multi-demension resource, so vector number is not appropriate
to index irq_desc which stands for unique interrupt source. As
Linux does, irq number is chosen to index irq_desc. This patch
changes vector-based interrupt infrastructure to irq-based one.
Mostly, it follows upstream linux's changes, and some parts are
adapted for Xen.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
|
|
|
|
|
|
|
|
|
| |
This patch enables delivery of interrupts even if the VCPU#0 is
halted.
Note: the changes to softirq.{ch} are needed for ia64 build.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... splitting it into global nr_irqs (determined at boot time) and
per- domain nr_pirqs (derived from nr_irqs and a possibly command line
specified value, which probably should later become a per-domain
config setting).
This has the (desirable imo) side effect of reducing the size of
struct hvm_irq_dpci from requiring an order-3 page to order-2 (on
x86-64), which nevertheless still is too large.
However, there is now a variable size bit array on the stack in
pt_irq_time_out() - while for the moment this probably is okay, it
certainly doesn't look nice. However, replacing this with a static
(pre-)allocation also seems less than ideal, because that would
require at least min(d->nr_pirqs, NR_VECTORS) bit arrays of
d->nr_pirqs bits, since this bit array is used outside of the
serialized code region in that function, and keeping the domain's
event lock acquired across pirq_guest_eoi() doesn't look like a good
idea either.
The IRQ- and vector-indexed arrays hanging off struct hvm_irq_dpci
could in fact be changed further to dynamically use the smaller of the
two ranges for indexing, since there are other assumptions about a
one-to-one relationship between IRQs and vectors here and elsewhere.
Additionally, it seems to me that struct hvm_mirq_dpci_mapping's
digl_list and gmsi fields could really be overlayed, which would yield
significant savings since this structure gets always instanciated in
form of d->nr_pirqs (as per the above could also be the smaller of
this and NR_VECTORS) dimensioned arrays.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow multiple pass-through devices to use the same guest_gsi.
The motivation for this is:
* Allow multi-function devices to be passed through as multi-function
devices
* Allow more than two pass-through devices.
- This will place more contention on the GSI-space, and allocation
becomes a lot simpler if GSI sharing is allowed.
Signed-off-by: Simon Horman <horms@verge.net.au>
|
|
|
|
| |
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
|
|
|
|
| |
Signed-off-by: Wei Wang <wei.wang2@amd.com>
|
|
|
|
|
|
|
|
| |
The patch adds a new type of pt_irq: PT_IRQ_TYPE_MSI_TRANSLATE.
With it, guest dpci irq can now use msi as the underlying pirq
while injected as INTx irq.
Signed-off-by: Qing He <qing.he@intel.com>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
| |
Do not compile some IA64 MSI-related parts.
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
|
|
|
|
|
| |
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
|
|
|
|
|
| |
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Move pci_dev lists from hvm to arch_domain
Move the pci_dev list from hvm to arch_domain since PCI devs are no
longer hvm specific. Also removed locking for pci_dev lists. Will
reintroduce them later.
Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
|
|
|
|
|
|
|
| |
When a domain's VT-d table is changed, only the iommus under which the
domain has assigned devices need to be flushed.
Signed-off-by: Yang, Xiaowei <xiaowei.yang@intel.com>
|
|
|
|
|
|
|
|
|
| |
Introduce 'iommu_pv' boot parameter (default off). Added a need_iommu
flag which is set if guest has PCI devices assigned. IOMMU page
tables are populated with current guest memory when IOMMU is first
enabled for the guest.
Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
|
|
|
|
|
|
|
| |
domheap rather than xenheap, and get rid of structure page_info in
iommu.c.
Signed-off-by: Weidong Han <weidong.han@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
During HVM domain creation, I/O page tables are filled by coping p2m
entries from p2m table, which is a useless step for non-passthru
domain. This patch defers I/O page table construction until the moment
of device assignment. In case that pci devices are never assigned or
hot plugged, the unnecessary duplication will be avoided.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
|
|
|
|
|
|
|
|
|
|
|
| |
that our headers are not built with __GNUC__ and __STRICT_ANSI__.
__extension__ had some weird (and buggy) behaviours when nested which
make it a risky proposition for general usage in our header
files. Better to disallow -ansi, -std=c99, and similar gcc options
when building against Xen headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
| |
Signed-off-by: Weidong Han <weidong.han@intel.com>
|
|
|
|
|
|
| |
Also, disable stdvga caching on hvm save/restore, as the shadow vga
state is not preserved.
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
| |
struct hvm_save_header is arch specific so that arch specific part of
hvm_save()/hvm_load() are moved into arch_hvm_save()/acrh_hvm_load()
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|
|
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
|