[PATCH 05/10] iommu/amd: Add function copy_dev_tables

2015-09-23 Thread Baoquan He
Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu_init.c | 26 ++ drivers/iommu/amd_iommu_types.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 1fc369e..913a718 100644 --- a/drivers/iommu

[PATCH 01/10] iommu/amd: Use standard bitmap operation to set bitmap

2015-09-23 Thread Baoquan He
Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu.c | 2 +- drivers/iommu/amd_iommu_init.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index f82060e7..0d59f79 100644 --- a/drivers/iommu/amd_iommu.c +++ b/d

[PATCH 07/10] iommu/amd: copy old dev tables and do not touch dev tables

2015-09-23 Thread Baoquan He
Before old dev tables coping do not touch dev tables if translation is previously enabled. And copy the dev tables/command buffer/event buffer from the old kernel to newly allocated data structure. Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu_init.c | 65 ---

[PATCH 10/10] iommu/amd: Copy the old ir table

2015-09-23 Thread Baoquan He
Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 1e86f4c..f4f3e63 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.

[PATCH 08/10] iommu/amd: Do not update the information of domain to devtables before device driver init

2015-09-23 Thread Baoquan He
update_domain() is the only place where domain->pt_root will be got and set into dev entry. So before the device driver initialization we do nothing if it's in previously enabled translation status. Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 09/10] iommu/amd: Clear the iommu pre enabled setting

2015-09-23 Thread Baoquan He
In the first Now any change of domain can be updated to dev tables and io page table Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index aee1ae4..1e86f4c 100644 --- a/drivers/io

[PATCH 03/10] iommu/amd: Get the first/last device of iommu earlier

2015-09-23 Thread Baoquan He
iommu->first_device/last_device are needed by function init_iommu_from_acpi() and init_iommu_devices(). So putting the assignment of them in iommu_init_pci() could be late. In this patch put them earlier. Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu_init.c | 10 +++--- 1 file change

[PATCH 06/10] iommu/amd: Add functions copy_command_buffer/copy_event_buffer

2015-09-23 Thread Baoquan He
Copy command buffer and event buffer from the old to kdump kernel. Still there are 2 problems: 1) Not very sure if this is necessary. If do not copy the old command buffer, and only set the newly allocated command buffer, is there anything wrong? 2) If copy is needed, do we need to take care

[PATCH 04/10] iommu/amd: Detect pre enabled translation

2015-09-23 Thread Baoquan He
Add functions to check whether translation is already enabled in IOMMU. Maybe it need be checked per IOMMU. Currently for debugging I didn't do like that. Signed-off-by: Baoquan He --- drivers/iommu/amd_iommu_init.c | 26 ++ drivers/iommu/amd_iommu_proto.h | 4 2 f

[PATCH 00/10] Fix AMD IOMMU faults in kdump kernel

2015-09-23 Thread Baoquan He
This is a draft patchset trying to fix the issue that AMD IOMMU doesn't work well in kdump kernel. The patch arrangement is not foraml, just presenting what I have done and what's the problem being encountered currently. It contains 3 parts. 1) Clean up patch Patch 1/10, 2/10, 3/10 are code cl

[PATCH 02/10] iommu/amd: Adjust functons which get first/last devid by reading pci config

2015-09-23 Thread Baoquan He
The old functon find_last_devid_on_pci not only gets the last devid, but calls update_last_devid(). Now adjust the function definition to make it be consistent with its name. Meanwhile add a new function find_first_devid_on_pci for later use. Signed-off-by: Baoquan He --- drivers/iommu/amd_iomm

Re: [PATCH 2/2] iommu/omap: Add support for configuring dsp iommus on DRA7xx

2015-09-23 Thread Tony Lindgren
* Suman Anna [150903 16:01]: > On 07/23/2015 02:24 AM, Tony Lindgren wrote: > > OK maybe check the syss/sysc registers involved here for each hardware > > module here and which driver tinkers with which registers? This will > > make things a lot easier in the long run for sure. > > The OMAP

Re: How to ensure that different peripherals getting different IOVA address in kernel?

2015-09-23 Thread Robin Murphy
On 23/09/15 02:55, chenfeng wrote: Hi all, In IOMMU architecture , how to make two different peripherals share the same page table ? In other words , is there a mechanism or structure to make two peripherals get completely different address. eg: peri-A、peri-B and peri-C share the same iova