ia64/xen-unstable
changeset 16342:11dcbf74edf2
HVM device passthru: Correct PCI_EXP_DEVCTL_FLR
This patch corrects PCI_EXP_DEVCTL_FLR so that function level reset
will be really executed, and also replaces some magic numbers with
macros.
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
This patch corrects PCI_EXP_DEVCTL_FLR so that function level reset
will be really executed, and also replaces some magic numbers with
macros.
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
author | Keir Fraser <keir@xensource.com> |
---|---|
date | Wed Nov 07 09:21:16 2007 +0000 (2007-11-07) |
parents | b544448502a4 |
children | fbe7ed173314 |
files | tools/ioemu/hw/pass-through.c tools/ioemu/hw/pass-through.h |
line diff
1.1 --- a/tools/ioemu/hw/pass-through.c Wed Nov 07 09:13:48 2007 +0000 1.2 +++ b/tools/ioemu/hw/pass-through.c Wed Nov 07 09:21:16 2007 +0000 1.3 @@ -127,9 +127,10 @@ void pt_iomem_map(PCIDevice *d, int i, u 1.4 if ( !first_map ) 1.5 { 1.6 /* Remove old mapping */ 1.7 - ret = xc_domain_memory_mapping(xc_handle, domid, old_ebase >> 12, 1.8 - assigned_device->bases[i].access.maddr >> 12, 1.9 - (e_size+0xFFF) >> 12, 1.10 + ret = xc_domain_memory_mapping(xc_handle, domid, 1.11 + old_ebase >> PAGE_SHIFT, 1.12 + assigned_device->bases[i].access.maddr >> PAGE_SHIFT, 1.13 + (e_size+PAGE_MASK) >> PAGE_SHIFT, 1.14 DPCI_REMOVE_MAPPING); 1.15 if ( ret != 0 ) 1.16 { 1.17 @@ -140,9 +141,9 @@ void pt_iomem_map(PCIDevice *d, int i, u 1.18 1.19 /* Create new mapping */ 1.20 ret = xc_domain_memory_mapping(xc_handle, domid, 1.21 - assigned_device->bases[i].e_physbase >> 12, 1.22 - assigned_device->bases[i].access.maddr >> 12, 1.23 - (e_size+0xFFF) >> 12, 1.24 + assigned_device->bases[i].e_physbase >> PAGE_SHIFT, 1.25 + assigned_device->bases[i].access.maddr >> PAGE_SHIFT, 1.26 + (e_size+PAGE_MASK) >> PAGE_SHIFT, 1.27 DPCI_ADD_MAPPING); 1.28 if ( ret != 0 ) 1.29 PT_LOG("Error: create new mapping failed!\n");
2.1 --- a/tools/ioemu/hw/pass-through.h Wed Nov 07 09:13:48 2007 +0000 2.2 +++ b/tools/ioemu/hw/pass-through.h Wed Nov 07 09:21:16 2007 +0000 2.3 @@ -40,7 +40,7 @@ 2.4 /* Misc PCI constants that should be moved to a separate library :) */ 2.5 #define PCI_CONFIG_SIZE (256) 2.6 #define PCI_EXP_DEVCAP_FLR (1 << 28) 2.7 -#define PCI_EXP_DEVCTL_FLR (0x1b) 2.8 +#define PCI_EXP_DEVCTL_FLR (1 << 15) 2.9 #define PCI_BAR_ENTRIES (6) 2.10 2.11 struct pt_region {