[Xen-devel] [v3][PATCH 03/16] xen/vtd: create RMRR mapping

2015-06-10 Thread Tiejun Chen
identity mapping in p2m layer, regardless of whether EPT is shared or not. And we still keep creating VT-d table. Signed-off-by: Tiejun Chen --- xen/arch/x86/mm/p2m.c | 10 -- xen/drivers/passthrough/vtd/iommu.c | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff

[Xen-devel] [v3][PATCH 04/16] xen/passthrough: extend hypercall to support rdm reservation policy

2015-06-10 Thread Tiejun Chen
domain, and remove a device from user domain, 'relaxed' is fine enough since this is always safe to hwdomain. Signed-off-by: Tiejun Chen --- xen/arch/x86/mm/p2m.c | 8 +++- xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 ++- xen/drivers/passthrough/ar

[Xen-devel] [v3][PATCH 05/16] xen: enable XENMEM_memory_map in hvm

2015-06-10 Thread Tiejun Chen
This patch enables XENMEM_memory_map in hvm. So we can use it to setup the e820 mappings. Signed-off-by: Tiejun Chen Reviewed-by: Tim Deegan --- xen/arch/x86/hvm/hvm.c | 2 -- xen/arch/x86/mm.c | 6 -- 2 files changed, 8 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86

[Xen-devel] [v3][PATCH 01/16] xen: introduce XENMEM_reserved_device_memory_map

2015-06-10 Thread Tiejun Chen
From: Jan Beulich This is a prerequisite for punching holes into HVM and PVH guests' P2M to allow passing through devices that are associated with (on VT-d) RMRRs. Signed-off-by: Jan Beulich Signed-off-by: Tiejun Chen --- xen/common/compat/memory.c

[Xen-devel] [v3][PATCH 02/16] xen/x86/p2m: introduce set_identity_p2m_entry

2015-06-10 Thread Tiejun Chen
We will create this sort of identity mapping as follows: If the gfn space is unoccupied, we just set the mapping. If the space is already occupied by 1:1 mappings, do nothing. Failed for any other cases. Signed-off-by: Tiejun Chen --- xen/arch/x86/mm/p2m.c | 35

[Xen-devel] [v3][PATCH 06/16] hvmloader: get guest memory map into memory_map[]

2015-06-10 Thread Tiejun Chen
[RESERVED_MEMORY_DYNAMIC_START - 1, RESERVED_MEMORY_DYNAMIC_END]. This range is used to allocate memory in hvmloder level, and we would lead hvmloader failed in case of conflict since its another rare possibility in real world. Signed-off-by: Tiejun Chen --- tools/firmware/hvmloader/e820.h | 7

[Xen-devel] [v3][PATCH 00/16] Fix RMRR

2015-06-10 Thread Tiejun Chen
hink we'd better collect some good or correct ideas to step next in RFC. So here I made this as RFC to collect your any comments. -------- Jan Beulich (1): xen: introduce XENMEM_reserved_device_memory_map Tiejun Chen (15):

[Xen-devel] [v3][PATCH 16/16] xen/vtd: prevent from assign the device with shared rmrr

2015-06-10 Thread Tiejun Chen
omain. Signed-off-by: Tiejun Chen --- xen/drivers/passthrough/vtd/iommu.c | 30 +++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index d3233b8..f220081 100644 --- a/xen/drivers/passth

[Xen-devel] [v3][PATCH 09/16] tools/libxc: Expose new hypercall xc_reserved_device_memory_map

2015-06-10 Thread Tiejun Chen
We will introduce the hypercall xc_reserved_device_memory_map approach to libxc. This helps us get rdm entry info according to different parameters. If flag == PCI_DEV_RDM_ALL, all entries should be exposed. Or we just expose that rdm entry specific to a SBDF. Signed-off-by: Tiejun Chen

[Xen-devel] [v3][PATCH 11/16] tools: introduce some new parameters to set rdm policy

2015-06-10 Thread Tiejun Chen
7;. When both policies are specified on a given region, 'strict' is always preferred. Signed-off-by: Tiejun Chen --- docs/man/xl.cfg.pod.5| 50 docs/misc/vtd.txt| 24 tools/libxl/libxl_create.c | 13 +++ tools/libxl/libxl_int

[Xen-devel] [v3][PATCH 10/16] tools: extend xc_assign_device() to support rdm reservation policy

2015-06-10 Thread Tiejun Chen
This patch passes rdm reservation policy to xc_assign_device() so the policy is checked when assigning devices to a VM. Signed-off-by: Tiejun Chen --- tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_domain.c | 6 +- tools/libxl/libxl_pci.c | 3

[Xen-devel] [v3][PATCH 07/16] hvmloader/pci: skip reserved ranges

2015-06-10 Thread Tiejun Chen
When allocating mmio address for PCI bars, we need to make sure they don't overlap with reserved regions. Signed-off-by: Tiejun Chen --- tools/firmware/hvmloader/pci.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/tools/fir

[Xen-devel] [v3][PATCH 08/16] hvmloader/e820: construct guest e820 table

2015-06-10 Thread Tiejun Chen
Now we can use that memory map to build our final e820 table but it may need to reorder all e820 entries. Signed-off-by: Tiejun Chen --- tools/firmware/hvmloader/e820.c | 62 +++-- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/tools/firmware

[Xen-devel] [v3][PATCH 13/16] tools/libxl: detect and avoid conflicts with RDM

2015-06-10 Thread Tiejun Chen
rict' is always preferred. "relaxed" policy issue a warning message and also mask this entry INVALID to indicate we shouldn't expose this entry to hvmloader. Note this predefined boundary can be changes with the parameter "rdm_mem_boundary" in .cfg file.

[Xen-devel] [v3][PATCH 12/16] tools/libxl: passes rdm reservation policy

2015-06-10 Thread Tiejun Chen
This patch passes our rdm reservation policy inside libxl when we assign a device or attach a device. Signed-off-by: Tiejun Chen --- docs/man/xl.pod.1 | 7 ++- tools/libxl/libxl_pci.c | 10 +- tools/libxl/xl_cmdimpl.c | 23 +++ tools/libxl

[Xen-devel] [v3][PATCH 14/16] tools/libxl: extend XENMEM_set_memory_map

2015-06-10 Thread Tiejun Chen
Here we'll construct a basic guest e820 table via XENMEM_set_memory_map. This table includes lowmem, highmem and RDMs if they exist. And hvmloader would need this info later. Signed-off-by: Tiejun Chen --- tools/libxl/libxl_dom.c | 5 +++ tools/libxl/libxl_internal.h

[Xen-devel] [v3][PATCH 15/16] xen/vtd: enable USB device assignment

2015-06-10 Thread Tiejun Chen
Before we refine RMRR mechanism, USB RMRR may conflict with guest bios region so we always ignore USB RMRR. Now this can be gone when we enable pci_force to check/reserve RMRR. Signed-off-by: Tiejun Chen --- xen/drivers/passthrough/vtd/dmar.h | 1 - xen/drivers/passthrough/vtd/iommu.c | 11

[Xen-devel] [v4][PATCH 03/19] xen/vtd: create RMRR mapping

2015-06-23 Thread Tiejun Chen
identity mapping in p2m layer, regardless of whether EPT is shared or not. And we still keep creating VT-d table. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen --- v4: * Instead of intel_iommu_unmap_page(), we should use guest_physmap_remove_page() to unmap rmrr mapping correctly

[Xen-devel] [v4][PATCH 00/19] Fix RMRR

2015-06-23 Thread Tiejun Chen
figure that memory boundary flexibly - In the case of hotplug we also need to figure out a way to fix that policy conflict between the per-pci policy and the global policy but firstly we think we'd better collect some good or correct ideas to step next in RFC. So here I made this as RF

[Xen-devel] [v4][PATCH 01/19] xen: introduce XENMEM_reserved_device_memory_map

2015-06-23 Thread Tiejun Chen
From: Jan Beulich This is a prerequisite for punching holes into HVM and PVH guests' P2M to allow passing through devices that are associated with (on VT-d) RMRRs. CC: Jan Beulich CC: Yang Zhang CC: Kevin Tian Signed-off-by: Jan Beulich Signed-off-by: Tiejun Chen Acked-by: Kevin

[Xen-devel] [v4][PATCH 07/19] hvmloader/pci: skip reserved ranges

2015-06-23 Thread Tiejun Chen
When allocating mmio address for PCI bars, we need to make sure they don't overlap with reserved regions. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v4: * We have to re-design

[Xen-devel] [v4][PATCH 09/19] tools/libxc: Expose new hypercall xc_reserved_device_memory_map

2015-06-23 Thread Tiejun Chen
Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v4: * Nothing is changed. tools/libxc/include/xenctrl.h | 8 tools/libxc/xc_domain.c | 36 2 files changed, 44 insertions(+) diff --git a/tools/libxc

[Xen-devel] [v4][PATCH 19/19] tools: parse to enable new rdm policy parameters

2015-06-23 Thread Tiejun Chen
DM policy is 'strict', while default global RDM policy is 'relaxed'. When both policies are specified on a given region, 'strict' is always preferred. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v4: * Separa

[Xen-devel] [v4][PATCH 08/19] hvmloader/e820: construct guest e820 table

2015-06-23 Thread Tiejun Chen
Now we can use that memory map to build our final e820 table but it may need to reorder all e820 entries. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v4: * Rename local variable

[Xen-devel] [v4][PATCH 11/19] tools: introduce some new parameters to set rdm policy

2015-06-23 Thread Tiejun Chen
en both policies are specified on a given region, 'strict' is always preferred. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v4: * No need to define init_val for libxl_rdm_reserve_type

[Xen-devel] [v4][PATCH 16/19] tools/libxl: extend XENMEM_set_memory_map

2015-06-23 Thread Tiejun Chen
Here we'll construct a basic guest e820 table via XENMEM_set_memory_map. This table includes lowmem, highmem and RDMs if they exist. And hvmloader would need this info later. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v4: * Use

[Xen-devel] [v4][PATCH 18/19] xen/vtd: prevent from assign the device with shared rmrr

2015-06-23 Thread Tiejun Chen
. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen Acked-by: Kevin Tian --- v4: * Refine one code comment. xen/drivers/passthrough/vtd/iommu.c | 32 +--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c

[Xen-devel] [v4][PATCH 05/19] xen: enable XENMEM_memory_map in hvm

2015-06-23 Thread Tiejun Chen
This patch enables XENMEM_memory_map in hvm. So hvmloader can use it to setup the e820 mappings. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-off-by: Tiejun Chen Reviewed-by: Tim Deegan Reviewed-by: Kevin Tian Acked-by: Jan Beulich --- v4: * Just refine the patch head

[Xen-devel] [v4][PATCH 13/19] tools/libxc: check to set args.mmio_size before call xc_hvm_build

2015-06-23 Thread Tiejun Chen
Signed-off-by: Tiejun Chen --- v4: * Separate this from currenpt patch #14 since this is specific to xc. tools/libxc/xc_hvm_build_x86.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c index 003ea06..7343e87 100644 --

[Xen-devel] [v4][PATCH 02/19] xen/x86/p2m: introduce set_identity_p2m_entry

2015-06-23 Thread Tiejun Chen
as a better helper to clear such a p2m entry. CC: Tim Deegan CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v4: * Change that orginal condition, if ( p2mt == p2m_invalid || p2mt == p2m_mmio_dm ) to make sure we catch those

[Xen-devel] [v4][PATCH 17/19] xen/vtd: enable USB device assignment

2015-06-23 Thread Tiejun Chen
USB RMRR may conflict with guest BIOS region. In such case, identity mapping setup is simply skipped in previous implementation. Now we can handle this scenario cleanly with new policy mechanism so previous hack code can be removed now. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen

[Xen-devel] [v4][PATCH 14/19] tools/libxl: detect and avoid conflicts with RDM

2015-06-23 Thread Tiejun Chen
CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v4: * Consistent to use term "RDM". * Unconditionally set *nr_entries to 0 * Grab to all sutffs to provide a parameter to set our predefined boundary dynamically to as a separated patch later tools/

[Xen-devel] [v4][PATCH 15/19] tools: introduce a new parameter to set a predefined rdm boundary

2015-06-23 Thread Tiejun Chen
Previously we always fix that predefined boundary as 2G to handle conflict between memory and rdm, but now this predefined boundar can be changes with the parameter "rdm_mem_boundary" in .cfg file. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: T

[Xen-devel] [v4][PATCH 10/19] tools: extend xc_assign_device() to support rdm reservation policy

2015-06-23 Thread Tiejun Chen
: Tiejun Chen --- v4: * In the patch head description, I add to explain why we need to sync the xc.c file tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_domain.c | 6 +- tools/libxl/libxl_pci.c | 3 ++- tools/ocaml/libs/xc/xenctrl_stubs.c | 18

[Xen-devel] [v4][PATCH 06/19] hvmloader: get guest memory map into memory_map[]

2015-06-23 Thread Tiejun Chen
: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v4: * Move some codes related to e820 to that specific file, e820.c. * Consolidate "printf()+BUG()" and "BUG_ON()" * Avoid another fixed width type

[Xen-devel] [v4][PATCH 04/19] xen/passthrough: extend hypercall to support rdm reservation policy

2015-06-23 Thread Tiejun Chen
ng CC: Kevin Tian Signed-off-by: Tiejun Chen --- v4: * Add code comments to describer why we fix to set a policy flag in some cases like adding a device to hwdomain, and removing a device from user domain. * Avoid using fixed width types for the parameter of set_identity_p2m_entry() * Fix

[Xen-devel] [v4][PATCH 12/19] tools/libxl: passes rdm reservation policy

2015-06-23 Thread Tiejun Chen
This patch passes our rdm reservation policy inside libxl when we assign a device or attach a device. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v4: * Fix one typo, s/unkwon/unknown * In command description, we should use "[

[Xen-devel] [RESEND][PATCH] tools/libxc: check to set args.mmio_size before call xc_hvm_build

2015-06-28 Thread Tiejun Chen
ked-by: Wei Liu Signed-off-by: Tiejun Chen --- As we discussed previously, we'd like to sent this separately. For more detail please see, http://osdir.com/ml/general/2015-06/msg38370.html tools/libxc/xc_hvm_build_x86.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxc/xc_hvm

[Xen-devel] [v5][PATCH 06/16] hvmloader/pci: skip reserved ranges

2015-07-06 Thread Tiejun Chen
When allocating mmio address for PCI bars, we need to make sure they don't overlap with reserved regions. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v5: * Rename that field, is_

[Xen-devel] [v5][PATCH 05/16] hvmloader: get guest memory map into memory_map[]

2015-07-06 Thread Tiejun Chen
: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v5: * Nothing is changed. v4: * Move some codes related to e820 to that specific file, e820.c. * Consolidate "printf()+BUG()" and "BUG_ON()" * Avoid another fixe

[Xen-devel] [v5][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM

2015-07-06 Thread Tiejun Chen
CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v5: * A little change to make sure the per-device policy always override the global policy and correct its associated code comments. * Fix one typo in the patch head description * Rename xc_device_get_rdm() with

[Xen-devel] [v5][PATCH 03/16] xen/passthrough: extend hypercall to support rdm reservation policy

2015-07-06 Thread Tiejun Chen
ng CC: Kevin Tian Signed-off-by: Tiejun Chen --- v5: * Just leave one bit XEN_DOMCTL_DEV_RDM_RELAXED as our flag, so "0" means "strict" and "1" means "relaxed". * So make DT device ignore the flag field * Improve the code comments v4: * Add code comm

[Xen-devel] [v5][PATCH 12/16] tools: introduce a new parameter to set a predefined rdm boundary

2015-07-06 Thread Tiejun Chen
Previously we always fix that predefined boundary as 2G to handle conflict between memory and rdm, but now this predefined boundar can be changes with the parameter "rdm_mem_boundary" in .cfg file. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: T

[Xen-devel] [v5][PATCH 01/16] xen: introduce XENMEM_reserved_device_memory_map

2015-07-06 Thread Tiejun Chen
From: Jan Beulich This is a prerequisite for punching holes into HVM and PVH guests' P2M to allow passing through devices that are associated with (on VT-d) RMRRs. CC: Jan Beulich CC: Yang Zhang CC: Kevin Tian Signed-off-by: Jan Beulich Signed-off-by: Tiejun Chen Acked-by: Kevin

[Xen-devel] [v5][PATCH 13/16] libxl: construct e820 map with RDM information for HVM guest

2015-07-06 Thread Tiejun Chen
: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v5: * Rephrase patch's short log * Make libxl__domain_construct_e820() hidden v4: * Use goto style error handling. * Instead of NOGC, we shoud use libxl__malloc(gc,XXX) to allocate local e82

[Xen-devel] [v5][PATCH 02/16] xen/vtd: create RMRR mapping

2015-07-06 Thread Tiejun Chen
CC: Yang Zhang CC: Kevin Tian Reviewed-by: Kevin Tian Reviewed-by: Tim Deegan Acked-by: George Dunlap Signed-off-by: Tiejun Chen --- v5: * Fold our original patch #2 and #3 as this new * Introduce a new, clear_identity_p2m_entry, which can wrapper guest_physmap_remove_page(). And we use

[Xen-devel] [v5][PATCH 04/16] xen: enable XENMEM_memory_map in hvm

2015-07-06 Thread Tiejun Chen
This patch enables XENMEM_memory_map in hvm. So hvmloader can use it to setup the e820 mappings. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-off-by: Tiejun Chen Reviewed-by: Tim Deegan Reviewed-by: Kevin Tian Acked-by: Jan Beulich Acked-by: George Dunlap --- v5: * Nothing is

[Xen-devel] [v5][PATCH 16/16] tools: parse to enable new rdm policy parameters

2015-07-06 Thread Tiejun Chen
DM policy is 'strict', while default global RDM policy is 'relaxed'. When both policies are specified on a given region, 'strict' is always preferred. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Signed-off-by: Tiejun Ch

[Xen-devel] [v5][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-06 Thread Tiejun Chen
Now we can use that memory map to build our final e820 table but it may need to reorder all e820 entries. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v5: * Nothing is changed. v4

[Xen-devel] [v5][PATCH 10/16] tools: introduce some new parameters to set rdm policy

2015-07-06 Thread Tiejun Chen
laxed'. And the per-device policy would override the global policy like others. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v5: * Just make sure the per-device plicy always override the global policy, and so cleanup some associated

[Xen-devel] [v5][PATCH 15/16] xen/vtd: prevent from assign the device with shared rmrr

2015-07-06 Thread Tiejun Chen
. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen Acked-by: Kevin Tian --- v5: * Nothing is changed. v4: * Refine one code comment. xen/drivers/passthrough/vtd/iommu.c | 32 +--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/xen/dr

[Xen-devel] [v5][PATCH 00/16] Fix RMRR

2015-07-06 Thread Tiejun Chen
d fail assigning device which has a shared RMRR with another device - add a config parameter to configure that memory boundary flexibly - In the case of hotplug we also need to figure out a way to fix that policy conflict between the per-pci policy and the global policy but firstly we think we&

[Xen-devel] [v5][PATCH 14/16] xen/vtd: enable USB device assignment

2015-07-06 Thread Tiejun Chen
USB RMRR may conflict with guest BIOS region. In such case, identity mapping setup is simply skipped in previous implementation. Now we can handle this scenario cleanly with new policy mechanism so previous hack code can be removed now. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen

[Xen-devel] [v5][PATCH 08/16] tools/libxc: Expose new hypercall xc_reserved_device_memory_map

2015-07-06 Thread Tiejun Chen
Stabellini CC: Ian Campbell CC: Wei Liu Reviewed-by: Kevin Tian Acked-by: Wei Liu Signed-off-by: Tiejun Chen --- v5: * Nothing is changed. v4: * Nothing is changed. tools/libxc/include/xenctrl.h | 8 tools/libxc/xc_domain.c | 36 2 files

[Xen-devel] [v5][PATCH 09/16] tools: extend xc_assign_device() to support rdm reservation policy

2015-07-06 Thread Tiejun Chen
Liu Signed-off-by: Tiejun Chen --- v5: * Fix the flag field as "0" to DT device v4: * In the patch head description, I add to explain why we need to sync the xc.c file tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_domain.c | 9 - tools/libxl/l

[Xen-devel] [v6][PATCH 08/16] tools/libxc: Expose new hypercall xc_reserved_device_memory_map

2015-07-08 Thread Tiejun Chen
Stabellini CC: Ian Campbell CC: Wei Liu Reviewed-by: Kevin Tian Acked-by: Wei Liu Signed-off-by: Tiejun Chen --- v6: * Nothing is changed. v5: * Nothing is changed. v4: * Nothing is changed. tools/libxc/include/xenctrl.h | 8 tools/libxc/xc_domain.c | 36

[Xen-devel] [v6][PATCH 00/16] Fix RMRR

2015-07-08 Thread Tiejun Chen
- remove existing USB hack - detect and fail assigning device which has a shared RMRR with another device - add a config parameter to configure that memory boundary flexibly - In the case of hotplug we also need to figure out a way to fix that policy conflict between the per-pci policy and the glo

[Xen-devel] [v6][PATCH 01/16] xen: introduce XENMEM_reserved_device_memory_map

2015-07-08 Thread Tiejun Chen
From: Jan Beulich This is a prerequisite for punching holes into HVM and PVH guests' P2M to allow passing through devices that are associated with (on VT-d) RMRRs. CC: Jan Beulich CC: Yang Zhang CC: Kevin Tian Signed-off-by: Jan Beulich Signed-off-by: Tiejun Chen Acked-by: Kevin

[Xen-devel] [v6][PATCH 03/16] xen/passthrough: extend hypercall to support rdm reservation policy

2015-07-08 Thread Tiejun Chen
ng CC: Kevin Tian Signed-off-by: Tiejun Chen --- v6: * Nothing is changed. v5: * Just leave one bit XEN_DOMCTL_DEV_RDM_RELAXED as our flag, so "0" means "strict" and "1" means "relaxed". * So make DT device ignore the flag field * Improve the co

[Xen-devel] [v6][PATCH 16/16] tools: parse to enable new rdm policy parameters

2015-07-08 Thread Tiejun Chen
DM policy is 'strict', while default global RDM policy is 'relaxed'. When both policies are specified on a given region, 'strict' is always preferred. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Signed-off-by: Tiejun Chen ---

[Xen-devel] [v6][PATCH 12/16] tools: introduce a new parameter to set a predefined rdm boundary

2015-07-08 Thread Tiejun Chen
iu Signed-off-by: Tiejun Chen --- v6: * Nothing is changed. v5: * Make this variable "rdm_mem_boundary_memkb" specific to .hvm v4: * Separated from the previous patch to provide a parameter to set that predefined boundary dynamically. docs/man/xl.cfg.pod.5 | 22 +

[Xen-devel] [v6][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM

2015-07-08 Thread Tiejun Chen
CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v6: * fix some code stypes * Refine libxl__xc_device_get_rdm() v5: * A little change to make sure the per-device policy always override the global policy and correct its associated co

[Xen-devel] [v6][PATCH 15/16] xen/vtd: prevent from assign the device with shared rmrr

2015-07-08 Thread Tiejun Chen
. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen Acked-by: Kevin Tian --- v6: * Nothing is changed. v5: * Nothing is changed. v4: * Refine one code comment. xen/drivers/passthrough/vtd/iommu.c | 32 +--- 1 file changed, 29 insertions(+), 3 dele

[Xen-devel] [v6][PATCH 06/16] hvmloader/pci: skip reserved ranges

2015-07-08 Thread Tiejun Chen
When allocating mmio address for PCI bars, we need to make sure they don't overlap with reserved regions. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v6: * Nothing is changed

[Xen-devel] [v6][PATCH 14/16] xen/vtd: enable USB device assignment

2015-07-08 Thread Tiejun Chen
USB RMRR may conflict with guest BIOS region. In such case, identity mapping setup is simply skipped in previous implementation. Now we can handle this scenario cleanly with new policy mechanism so previous hack code can be removed now. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen

[Xen-devel] [v6][PATCH 10/16] tools: introduce some new parameters to set rdm policy

2015-07-08 Thread Tiejun Chen
ith a warning message thrown out. Default per-device RDM policy is same as default global RDM policy as being 'relaxed'. And the per-device policy would override the global policy like others. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun C

[Xen-devel] [v6][PATCH 13/16] libxl: construct e820 map with RDM information for HVM guest

2015-07-08 Thread Tiejun Chen
: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Signed-off-by: Tiejun Chen --- v6: * Nothing is changed. v5: * Rephrase patch's short log * Make libxl__domain_construct_e820() hidden v4: * Use goto style error handling. * Instead of NOGC, we

[Xen-devel] [v6][PATCH 02/16] xen/vtd: create RMRR mapping

2015-07-08 Thread Tiejun Chen
CC: Yang Zhang CC: Kevin Tian Reviewed-by: Kevin Tian Reviewed-by: Tim Deegan Acked-by: George Dunlap Signed-off-by: Tiejun Chen --- v6: * Nothing is changed. v5: * Fold our original patch #2 and #3 as this new * Introduce a new, clear_identity_p2m_entry, which can wrapper

[Xen-devel] [v6][PATCH 04/16] xen: enable XENMEM_memory_map in hvm

2015-07-08 Thread Tiejun Chen
This patch enables XENMEM_memory_map in hvm. So hvmloader can use it to setup the e820 mappings. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-off-by: Tiejun Chen Reviewed-by: Tim Deegan Reviewed-by: Kevin Tian Acked-by: Jan Beulich Acked-by: George Dunlap --- v6: * Nothing is

[Xen-devel] [v6][PATCH 09/16] tools: extend xc_assign_device() to support rdm reservation policy

2015-07-08 Thread Tiejun Chen
Liu Signed-off-by: Tiejun Chen --- v6: * Nothing is changed. v5: * Fix the flag field as "0" to DT device v4: * In the patch head description, I add to explain why we need to sync the xc.c file tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_domain.c

[Xen-devel] [v6][PATCH 05/16] hvmloader: get guest memory map into memory_map[]

2015-07-08 Thread Tiejun Chen
: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v6: * Nothing is changed. v5: * Nothing is changed. v4: * Move some codes related to e820 to that specific file, e820.c. * Consolidate "printf()+BUG()" and "BUG_ON()&qu

[Xen-devel] [v6][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-08 Thread Tiejun Chen
Now we can use that memory map to build our final e820 table but it may need to reorder all e820 entries. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v6: * Nothing is changed. v5

[Xen-devel] [v7][PATCH 00/16] Fix RMRR

2015-07-08 Thread Tiejun Chen
m in final version after RFC is agreed: - remove existing USB hack - detect and fail assigning device which has a shared RMRR with another device - add a config parameter to configure that memory boundary flexibly - In the case of hotplug we also need to figure out a way to fix that policy

[Xen-devel] [v7][PATCH 13/16] libxl: construct e820 map with RDM information for HVM guest

2015-07-08 Thread Tiejun Chen
: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Signed-off-by: Tiejun Chen --- v7: * Just sync with the fallout of renaming parameters from patch #10. v6: * Nothing is changed. v5: * Rephrase patch's short log * Make libxl__domain_construct_e820()

[Xen-devel] [v7][PATCH 16/16] tools: parse to enable new rdm policy parameters

2015-07-08 Thread Tiejun Chen
DM policy is same as default global RDM policy as being 'relaxed'. And the per-device policy would override the global policy like others. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Signed-off-by: Tiejun Chen --- v7: * Just sync with the fallo

[Xen-devel] [v7][PATCH 14/16] xen/vtd: enable USB device assignment

2015-07-08 Thread Tiejun Chen
USB RMRR may conflict with guest BIOS region. In such case, identity mapping setup is simply skipped in previous implementation. Now we can handle this scenario cleanly with new policy mechanism so previous hack code can be removed now. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen

[Xen-devel] [v7][PATCH 04/16] xen: enable XENMEM_memory_map in hvm

2015-07-08 Thread Tiejun Chen
This patch enables XENMEM_memory_map in hvm. So hvmloader can use it to setup the e820 mappings. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper Signed-off-by: Tiejun Chen Reviewed-by: Tim Deegan Reviewed-by: Kevin Tian Acked-by: Jan Beulich Acked-by: George Dunlap --- v5 ~ v7

[Xen-devel] [v7][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM

2015-07-08 Thread Tiejun Chen
CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v7: * Just sync with the fallout of renaming parameters from patch #10. v6: * fix some code stypes * Refine libxl__xc_device_get_rdm() v5: * A little change to make sure the per-device p

[Xen-devel] [v7][PATCH 02/16] xen/vtd: create RMRR mapping

2015-07-08 Thread Tiejun Chen
CC: Yang Zhang CC: Kevin Tian Reviewed-by: Kevin Tian Reviewed-by: Tim Deegan Acked-by: George Dunlap Signed-off-by: Tiejun Chen --- v6 ~ v7: * Nothing is changed. v5: * Fold our original patch #2 and #3 as this new * Introduce a new, clear_identity_p2m_entry, which can wrapper

[Xen-devel] [v7][PATCH 06/16] hvmloader/pci: skip reserved ranges

2015-07-08 Thread Tiejun Chen
When allocating mmio address for PCI bars, we need to make sure they don't overlap with reserved regions. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v6 ~ v7: * Nothing is ch

[Xen-devel] [v7][PATCH 07/16] hvmloader/e820: construct guest e820 table

2015-07-08 Thread Tiejun Chen
Now we can use that memory map to build our final e820 table but it may need to reorder all e820 entries. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen --- v5 ~ v7: * Nothing is changed

[Xen-devel] [v7][PATCH 01/16] xen: introduce XENMEM_reserved_device_memory_map

2015-07-08 Thread Tiejun Chen
From: Jan Beulich This is a prerequisite for punching holes into HVM and PVH guests' P2M to allow passing through devices that are associated with (on VT-d) RMRRs. CC: Jan Beulich CC: Yang Zhang CC: Kevin Tian Signed-off-by: Jan Beulich Signed-off-by: Tiejun Chen Acked-by: Kevin

[Xen-devel] [v7][PATCH 03/16] xen/passthrough: extend hypercall to support rdm reservation policy

2015-07-08 Thread Tiejun Chen
ng CC: Kevin Tian Signed-off-by: Tiejun Chen --- v6 ~ v7: * Nothing is changed. v5: * Just leave one bit XEN_DOMCTL_DEV_RDM_RELAXED as our flag, so "0" means "strict" and "1" means "relaxed". * So make DT device ignore the flag field * Improve the co

[Xen-devel] [v7][PATCH 10/16] tools: introduce some new parameters to set rdm policy

2015-07-08 Thread Tiejun Chen
a warning message thrown out. Default per-device RDM policy is same as default global RDM policy as being 'relaxed'. And the per-device policy would override the global policy like others. CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Acked-by: Wei Liu Acked

[Xen-devel] [v7][PATCH 08/16] tools/libxc: Expose new hypercall xc_reserved_device_memory_map

2015-07-08 Thread Tiejun Chen
Stabellini CC: Ian Campbell CC: Wei Liu Reviewed-by: Kevin Tian Acked-by: Wei Liu Signed-off-by: Tiejun Chen --- v4 ~ v7: * Nothing is changed. tools/libxc/include/xenctrl.h | 8 tools/libxc/xc_domain.c | 36 2 files changed, 44 insertions

[Xen-devel] [v7][PATCH 12/16] tools: introduce a new parameter to set a predefined rdm boundary

2015-07-08 Thread Tiejun Chen
iu Signed-off-by: Tiejun Chen --- v7: * Just sync with the fallout of renaming parameters from patch #10. v6: * Nothing is changed. v5: * Make this variable "rdm_mem_boundary_memkb" specific to .hvm v4: * Separated from the previous patch to provide a parameter to set that

[Xen-devel] [v7][PATCH 15/16] xen/vtd: prevent from assign the device with shared rmrr

2015-07-08 Thread Tiejun Chen
. CC: Yang Zhang CC: Kevin Tian Signed-off-by: Tiejun Chen Acked-by: Kevin Tian --- v5 ~ v7: * Nothing is changed. v4: * Refine one code comment. xen/drivers/passthrough/vtd/iommu.c | 32 +--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/xen/dr

[Xen-devel] [v7][PATCH 05/16] hvmloader: get guest memory map into memory_map[]

2015-07-08 Thread Tiejun Chen
: Stefano Stabellini CC: Ian Campbell CC: Wei Liu Signed-off-by: Tiejun Chen Reviewed-by: Kevin Tian --- v5 ~ v7: * Nothing is changed. v4: * Move some codes related to e820 to that specific file, e820.c. * Consolidate "printf()+BUG()" and "BUG_ON()" * Avoid another fixe

[Xen-devel] [v7][PATCH 09/16] tools: extend xc_assign_device() to support rdm reservation policy

2015-07-08 Thread Tiejun Chen
Liu Signed-off-by: Tiejun Chen --- v6 ~ v7: * Nothing is changed. v5: * Fix the flag field as "0" to DT device v4: * In the patch head description, I add to explain why we need to sync the xc.c file tools/libxc/include/xenctrl.h | 3 ++- tools/libxc/xc_domain.c

[Xen-devel] [PATCH] xen/pci: correct comment of pci_device_detect()

2015-05-19 Thread Tiejun Chen
Actually we always return 1 if pci device exists. Signed-off-by: Tiejun Chen --- xen/drivers/passthrough/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 862e20f..6cb6e00 100644 --- a/xen/drivers

[Xen-devel] [v2][PATCH] xen/pci: make pci_device_detect() return as bool_t

2015-05-20 Thread Tiejun Chen
This function should better return as bool_t and remove that pointless comment. Signed-off-by: Tiejun Chen --- v2: * Instead of correcting that comment directly, we make this function return as bool_t. xen/drivers/passthrough/pci.c | 7 ++- xen/drivers/passthrough/vtd/dmar.c | 4

[Xen-devel] [RFC][v2][PATCH 05/14] xen/x86/p2m: introduce set_identity_p2m_entry

2015-05-22 Thread Tiejun Chen
We will create this sort of identity mapping as follows: If the gfn space is unoccupied, we just set the mapping. If the space is already occupied by 1:1 mappings, do nothing. Failed for any other cases. Signed-off-by: Tiejun Chen --- xen/arch/x86/mm/p2m.c | 30

[Xen-devel] [RFC][v2][PATCH 00/14] Fix RMRR

2015-05-22 Thread Tiejun Chen
in RFC. So here I made this as RFC to collect your any comments. Jan Beulich (1): introduce XENMEM_reserved_device_memory_map Tiejun Chen (13): tools: introduce some new parameters to set rdm policy tools/libxc: Expose new hyp

[Xen-devel] [RFC][v2][PATCH 01/14] tools: introduce some new parameters to set rdm policy

2015-05-22 Thread Tiejun Chen
7;. When both policies are specified on a given region, 'strict' is always preferred. Signed-off-by: Tiejun Chen --- docs/man/xl.cfg.pod.5| 57 +++ docs/misc/vtd.txt| 24 tools/libxl/libxl_create.c | 13 +++ tools/libxl/li

[Xen-devel] [RFC][v2][PATCH 03/14] tools/libxc: Expose new hypercall xc_reserved_device_memory_map

2015-05-22 Thread Tiejun Chen
We will introduce the hypercall xc_reserved_device_memory_map approach to libxc. This helps us get rdm entry info according to different parameters. If flag == PCI_DEV_RDM_ALL, all entries should be exposed. Or we just expose that rdm entry specific to a SBDF. Signed-off-by: Tiejun Chen

[Xen-devel] [RFC][v2][PATCH 02/14] introduce XENMEM_reserved_device_memory_map

2015-05-22 Thread Tiejun Chen
From: Jan Beulich This is a prerequisite for punching holes into HVM and PVH guests' P2M to allow passing through devices that are associated with (on VT-d) RMRRs. Signed-off-by: Jan Beulich Signed-off-by: Tiejun Chen --- xen/common/compat/memory.c

[Xen-devel] [RFC][v2][PATCH 06/14] xen:vtd: create RMRR mapping

2015-05-22 Thread Tiejun Chen
identity mapping in p2m layer, regardless of whether EPT is shared or not. And we still keep creating VT-d table. Signed-off-by: Tiejun Chen --- xen/arch/x86/mm/p2m.c | 5 + xen/drivers/passthrough/vtd/iommu.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a

[Xen-devel] [RFC][v2][PATCH 07/14] xen/passthrough: extend hypercall to support rdm reservation policy

2015-05-22 Thread Tiejun Chen
try' is fine enough since this is always safe to hwdomain. Signed-off-by: Tiejun Chen --- xen/arch/x86/mm/p2m.c | 8 +++- xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 ++- xen/drivers/passthrough/arm/smmu.c | 2 +- xen/drivers/passthrough/device_tree

[Xen-devel] [RFC][v2][PATCH 04/14] tools/libxl: detect and avoid conflicts with RDM

2015-05-22 Thread Tiejun Chen
rict' is always preferred. "relaxed" policy issue a warning message and also mask this entry INVALID to indicate we shouldn't expose this entry to hvmloader. Note this predefined boundary can be changes with the parameter "rdm_mem_boundary" in .cfg file.

[Xen-devel] [RFC][v2][PATCH 12/14] hvmloader/pci: skip reserved ranges

2015-05-22 Thread Tiejun Chen
When allocating mmio address for PCI bars, we need to make sure they don't overlap with reserved regions. Signed-off-by: Tiejun Chen --- tools/firmware/hvmloader/pci.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/tools/fir

  1   2   3   >