Hi Joerg,
Ping!
Could you help review this version? Not sure this could catch up to
v4.10 merging.
Thanks
Baoqaun
On 11/25/16 at 01:13pm, Baoquan He wrote:
> This is v7 post.
>
> The principle of the fix is similar to intel iommu. Just defer the assignment
> of device to doma
Move per iommu enabling code into a wrapper function early_enable_iommu().
This can make later kdump change easier.
And also add iommu_disable_command_buffer and iommu_disable_event_buffer
for later usage.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 42
Add functions to check whether translation is already enabled in IOMMU.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 25 +
drivers/iommu/amd_iommu_proto.h | 1 +
drivers/iommu/amd_iommu_types.h | 4
3 files changed, 30 insertions(+)
diff --git
, and detect and enable guest vapic.
- Flush all caches
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 51 --
1 file changed, 44 insertions(+), 7 deletions(-)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index
.
And define MACRO DEV_DOMID_MASK to replace magic number 0xULL because
it need be reused in copy_dev_tables.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 2 +-
drivers/iommu/amd_iommu_init.c | 55 +
drivers/iommu/amd_iommu_types.h
. device-table pointer update is split up into
two 32bit writes in the IOMMU hardware. So updating it while the IOMMU
is enabled could have some nasty side effects.
Baoquan He (12):
iommu/amd: Detect pre enabled translation
iommu/amd: add several helper function
iommu/amd: Define bi
In amd-vi spec several bits of IO PTE fields and DTE fields are similar
so that both of them can share the same MACRO definition. However
defining their respecitve bit fields can make code more read-able. So
do it in this patch.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 8
This new call-back will be used to check if the domain attach need be
deferred for now. If yes, the domain attach/detach will return directly.
Suggested-by: Joerg Roedel
Signed-off-by: Baoquan He
---
drivers/iommu/iommu.c | 8
include/linux/iommu.h | 1 +
2 files changed, 9 insertions
Implement call-back is_attach_deferred and use it to defer the
domain attach from iommu driver init to device driver init when
iommu is pre-enabled in kdump kernel.
Suggested-by: Joerg Roedel
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 23 ++-
1 file changed
is is to allocate the device-table below
4GB if translation is pre-enabled in kdump kernel. If allocation failed,
still use the old one.
Suggested-by: Joerg Roedel
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 12
1 file changed, 12 insertions(+)
diff --git a/dr
When handle deferred domain attach, we need check if the domain is
v2. If not, should try to clear out the GV flag which could be
copied from the old device table entry.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion
In iommu_request_dm_for_dev(), devices of group have all been attached
to newly created direct mapped domain. We should store the domain into
group->domain so that it works for iommu_get_domain_for_dev() and
get_domain().
Signed-off-by: Baoquan He
---
drivers/iommu/iommu.c | 1 +
1 file chan
s are recoverable for the device and we should not allow the
device to change old-kernels data when we don't have to.
Suggested-by: Joerg Roedel
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 26 +++---
drivers/iommu/amd_iommu_init.c | 11 +++
dri
Firstly split the dev table entry copy into address translation part and
irq remapping part. Because these two parts could be configured to
be available indepentently.
Secondly check if IntCtl and IntTabLen are 10b and 1000b if they are
set.
Signed-off-by: Baoquan He
---
drivers/iommu
Hi Joerg,
Do you plan to merge this one as urgent?
There's bug created about this issue on rhel, it would be great if it
can be put in next or merged so that we can back port it.
Thanks
Baoquan
On 03/29/17 at 05:00pm, Joerg Roedel wrote:
> From: Joerg Roedel
>
> When booting into a kexec kern
On 04/12/17 at 11:54pm, Joerg Roedel wrote:
> Hi Baoquan,
>
> On Wed, Apr 12, 2017 at 09:40:56AM +0800, Baoquan He wrote:
> > Do you plan to merge this one as urgent?
> >
> > There's bug created about this issue on rhel, it would be great if it
> > can b
Hi dear Joerg,
On 06/16/17 at 10:15am, Joerg Roedel wrote:
> From: Joerg Roedel
>
> When booting into a kdump kernel, suppress IO_PAGE_FAULTs by
> default for all devices. But allow the faults again when a
> domain is assigned to a device.
I have two bugs at hand reported by customer, saying th
Hi Joerg,
On 06/23/17 at 04:57pm, Baoquan He wrote:
> Hi dear Joerg,
>
> On 06/16/17 at 10:15am, Joerg Roedel wrote:
> > From: Joerg Roedel
> >
> > When booting into a kdump kernel, suppress IO_PAGE_FAULTs by
> > default for all devices. But allow the faults ag
On 06/26/17 at 12:07pm, Joerg Roedel wrote:
> Hi Baoquan,
>
> On Fri, Jun 23, 2017 at 07:43:10PM +0800, Baoquan He wrote:
> > Do you think whether it's necessary to continue my kdump fix of amd iommu
> > patchset? Seems my last post was in Jan this year. I know you a
Hi Joerg,
On 06/26/17 at 12:07pm, Joerg Roedel wrote:
> Hi Baoquan,
>
> On Fri, Jun 23, 2017 at 07:43:10PM +0800, Baoquan He wrote:
> > Do you think whether it's necessary to continue my kdump fix of amd iommu
> > patchset? Seems my last post was in Jan this year. I kno
Add functions to check whether translation is already enabled in IOMMU.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 24
drivers/iommu/amd_iommu_proto.h | 1 +
drivers/iommu/amd_iommu_types.h | 4
3 files changed, 29 insertions(+)
diff --git a
AGE_FAULT can't be seen anymore.
Below is link of v5 post.
https://lists.linuxfoundation.org/pipermail/iommu/2016-September/018527.html
Baoquan He (12):
iommu/amd: Detect pre enabled translation
iommu/amd: add several helper functions
Revert "iommu/amd: Suppress IO_PAGE_FA
This reverts commit 54bd63570484167cb13edf81e31fff107b879981.
We still need the IO_PAGE_FAULT message to warn error after the
issue of on-flight dma in kdump kernel is fixed.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 3 +--
drivers/iommu/amd_iommu_init.c | 9
Move single iommu enabling codes into a wrapper function early_enable_iommu().
This can make later kdump change easier.
And also add iommu_disable_command_buffer and iommu_disable_event_buffer
for later usage.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 42
In AMD-Vi spec several bits of IO PTE fields and DTE fields are similar
so that both of them can share the same MACRO definition. However
defining them respectively can make code more read-able. Do it now.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 8
drivers
, it can
be
reused in copy_dev_tables().
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 2 +-
drivers/iommu/amd_iommu_init.c | 55 +
drivers/iommu/amd_iommu_types.h | 1 +
3 files changed, 57 insertions(+), 1 deletion(-)
diff --git a
, and detect and enable guest vapic.
- Flush all caches
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 51 --
1 file changed, 44 insertions(+), 7 deletions(-)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index
s are recoverable for the device and we should not allow the
device to change old-kernels data when we don't have to.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 28 +++-
drivers/iommu/amd_iommu_init.c | 11 +++
drivers/iommu/amd_iommu_pr
When handle deferred domain attach, we need check if the domain is
v2. If not, should try to clear out the GV flag which could be
copied from the old device table entry.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion
From: root
It's ok to disable iommu in normal kernel. While there's no need
to disable it in kdump kernel after the on-flight dma issue has
heen fixed.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
Implement call-back is_attach_deferred and use it to defer the
domain attach from iommu driver init to device driver init when
iommu is pre-enabled in kdump kernel.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 23 ++-
1 file changed, 22 insertions(+), 1 deletion
Firstly split the dev table entry copy into address translation part and
irq remapping part. Because these two parts could be enabled
independently.
Secondly check if IntCtl and IntTabLen are 10b and 1000b if they are
set.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 5
This new call-back will be used to check if the domain attach need be
deferred for now. If yes, the domain attach/detach will return directly.
Signed-off-by: Baoquan He
---
drivers/iommu/iommu.c | 8
include/linux/iommu.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/drivers
is is to allocate the device-table below
4GB if translation is pre-enabled in kdump kernel. If allocation failed,
still use the old one.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 12
1 file changed, 12 insertions(+)
diff --git a/drivers/iommu/amd_iommu_init.c b/dr
the system]
>
> url:
> https://github.com/0day-ci/linux/commits/Baoquan-He/Fix-the-on-flight-DMA-issue-on-system-with-amd-iommu/20170724-060048
> base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
> config: x86_64-randconfig-x005-201730 (attached as .confi
mu_init(void)
> {
> int ret = 0;
> @@ -3687,8 +3738,11 @@ int __init intel_iommu_init(void)
> continue;
>
> iommu = drhd->iommu;
> - if (iommu->gcmd & DMA_GCMD_TE)
> + if (iommu->gcmd & DMA_GCMD_TE) {
> + if
Hi,
Patch is great and works on my HP-z420.
There are several small concerns, please see inline comments.
On 08/21/13 at 04:15pm, Takao Indoh wrote:
> This patch quiesces devices before disabling IOMMU on boot to stop
> ongoing DMA. In intel_iommu_init(), check context entries and if there
> is en
Hi Bill,
I have tested this prototype patch on hp z420, it works very well.
Looking forward to your formal patch set. I can help test and review.
Baoquan
Thanks
On 11/18/13 at 11:30pm, Sumner, William wrote:
> Thank you for testing this RFC patch. It is great to have confirmation that
> the co
I have reviewed and tested this patchset. Without it the DMAR error
always occured as below. With this patchset, no error is reported and
kdump can work successfully.
This patchset is awesome, it get to the root of the problem when enable
intel-iommu in kdump and fix it. And from code no harm wou
On 12/19/13 at 07:49pm, Bill Sumner wrote:
> +static int copy_page_addr(u64 page_addr, u32 shift, u32 bus, u32 devfn,
> + u64 pte, struct dmar_domain *domain,
> + void *parms)
> +{
> + struct copy_page_addr_parms *ppap = parms;
> +
> +
On 12/20/13 at 02:04pm, Baoquan He wrote:
> On 12/19/13 at 07:49pm, Bill Sumner wrote:
>
> > +static int copy_page_addr(u64 page_addr, u32 shift, u32 bus, u32 devfn,
> > + u64 pte, struct dmar_domain *domain,
> > +
all patches in the
> set.
> 3. Fixed: one-line added to Copy-Translations" patch to initialize the iovad
> struct as recommended by Baoquan He [b...@redhat.com]
> init_iova_domain(&domain->iovad, DMA_32BIT_PFN);
>
> v1->v2:
> The following se
014-04-09 at 16:10 -0700, James Bottomley wrote:
> >>>>> On Wed, 2014-04-09 at 16:08 -0700, James Bottomley wrote:
> >>>>>> [+linux-scsi]
> >>>>>> On Wed, 2014-04-09 at 15:49 -0700, Davidlohr Bueso wrote:
> >>>>>>> On Wed, 20
This patch works for me.
Tested-by: Baoquan He
Thanks
Baoquan
On 04/10/14 at 05:17pm, scame...@beardog.cce.hp.com wrote:
>
> Without this, you'll see a null pointer dereference in
> hpsa_enter_performant_mode().
>
> Signed-off-by: Stephen M. Cameron
> ---
>
Wed, 2014-04-09 at 16:08 -0700, James Bottomley wrote:
> >>>>>> [+linux-scsi]
> >>>>>> On Wed, 2014-04-09 at 15:49 -0700, Davidlohr Bueso wrote:
> >>>>>>> On Wed, 2014-04-09 at 10:39 +0800, Baoquan He wrote:
> >>>>>&g
Hi Bill,
Could you rebase on latest linus's kernel tree, since there are several
changes in intel-iommu.c. This patch can't be applied because of below
commits. I think patch need be reabsed on latest linus's tree before
post, people will apply your patch without conflict.
commit b94e4117f8c4ffb5
On 03/30/20 at 10:42pm, Alexander Graf wrote:
>
>
> On 30.03.20 15:40, Konrad Rzeszutek Wilk wrote:
> >
> >
> >
> > On Mon, Mar 30, 2020 at 02:06:01PM +0800, Kairui Song wrote:
> > > On Sat, Mar 28, 2020 at 7:57 PM Dave Young wrote:
> > > >
> > > > On 03/26/20 at 05:29pm, Alexander Graf wrot
Hi Zhenhua,
I tested your latest patch on 3.18.0-rc1+, there are still some dmar
errors. I remember it worked well with Bill's original patchset.
0console [earlya[0.00] allocate tes of page_cg 'a ong[
0.00] tsc: Fast TSC calibration using PIT
0031] Calibrating delay loop (skipped),
On 10/22/14 at 10:22am, Li, Zhen-Hua wrote:
>
> Hi Baoquan,
> I tested it on 3.17, it does not have these faults. There are little
> differences between this version and Bill's last version.
>
> I will test it on 3.18.0-rc1+ on my system and let you know the result.
>
> And could you send me th
On 10/27/14 at 03:29pm, Li, ZhenHua wrote:
> Hi Baoquan,
> I failed in testing this patchset for 3.18.0-rc1, this upstream
> 3.18.0-rc1 kernel cannot boot on my system, have not found out the
> reason.
>
> Could you please test this patchset on 3.17.0 to see whether it has
> these faults?
>
> Tha
On 11/13/14 at 05:06pm, Li, ZhenHua wrote:
> Minfei,
> Thanks for your testing.
> On my system, I got error messages:
>
> [8.019096] usb usb2: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> [8.019617] dmar: DRHD: handling fault status reg 102
> [8.019621] dmar: DMAR:[DMA
Hi Joerg, ZhenHua,
This issue happens on AMD iommu too, do you have any plans or
thoughts on that?
Thanks
Baoquan
On 11/17/14 at 02:38pm, Joerg Roedel wrote:
> On Fri, Nov 14, 2014 at 02:27:44PM +0800, Li, ZhenHua wrote:
> > I am working following your directions:
> >
> > 1. If the VT-d drive
On 12/12/14 at 05:11pm, Joerg Roedel wrote:
> On Fri, Dec 12, 2014 at 10:25:31AM +0800, Li, ZhenHua wrote:
> > Sorry I have no plan yet.
> > Could you send me your logs on your AMD system?
>
> > On 12/10/2014 04:46 PM, Baoquan He wrote:
> > >This issue happens
On 12/12/14 at 10:25am, Li, ZhenHua wrote:
> Sorry I have no plan yet.
> Could you send me your logs on your AMD system?
Sure, please check the attachment. AMD iommu seems a little different on
action. On the machine I reserved for testing, it always hang the system
bootup. As Joerg said, we can j
Hi Zhenhua,
I just tested your patchset based on 3.19.0-rc2+, and found several dmar
fault and intr-remap fault, it seems not the same as Takao's, please
check the attachment.
Thanks
Baoquan
[root@dhcp-16-105 ~]# kdumpctl restart
kexec: failed to unloaded kdump kernel
Stopping kdump: [FAILED]
+
On 01/07/15 at 12:11pm, Li, ZhenHua wrote:
> Many thanks to Takao Indoh and Baoquan He, for your testing on more
> different systems.
>
> The calling of flush functions are added to this version.
>
> The usage of __iommu_flush_cache function :
> 1. Fixes a dump on Takao
ntr-remap fault
seen any more, good job!
Thanks
Baoquan
>
> Regards
> Zhenhua
>
> On 01/07/2015 01:02 PM, Baoquan He wrote:
> >On 01/07/15 at 12:11pm, Li, ZhenHua wrote:
> >>Many thanks to Takao Indoh and Baoquan He, for your testing on more
> >>differen
t; mem.
> > 5. New functions to save updated root entry table and irte table.
> > 6. Use intel_unmap to unmap the old dma;
> > 7. Allocate new pages while driver is being loaded.
> >
> >Changelog[v4]:
> > 1. Cut off the patches that move some define
On 01/12/15 at 10:29am, Vivek Goyal wrote:
> On Mon, Jan 12, 2015 at 04:22:08PM +0100, Joerg Roedel wrote:
> > It looks like you are still copying the io-page-tables from the old
> > kernel into the kdump kernel, is that right? With the approach that was
> > proposed you only need to copy over the
On 01/12/15 at 03:06pm, Li, Zhen-Hua wrote:
> +/*
> + * Interface to the "copy translation tables" set of functions
> + * from mainline code.
> + */
> +static int intel_iommu_load_translation_tables(struct dmar_drhd_unit *drhd,
> + int g_num_of_iommus)
The argument g_num_of_iommus is t
in next version;
Oh, yes. So please ignore this comment.
>
> See my comments.
>
> On 01/15/2015 11:28 AM, Baoquan He wrote:
> >On 01/12/15 at 03:06pm, Li, Zhen-Hua wrote:
> >>+/*
> >>+ * Interface to the "copy translation tables" set of f
On 04/03/15 at 05:21pm, Dave Young wrote:
> On 04/03/15 at 05:01pm, Li, ZhenHua wrote:
> > Hi Dave,
> >
> > There may be some possibilities that the old iommu data is corrupted by
> > some other modules. Currently we do not have a better solution for the
> > dmar faults.
> >
> > But I think when
On 04/15/15 at 02:48pm, Dave Young wrote:
> On 04/15/15 at 01:47pm, Li, ZhenHua wrote:
> > On 04/15/2015 08:57 AM, Dave Young wrote:
> > >Again, I think it is bad to use old page table, below issues need consider:
> > >1) make sure old page table are reliable across crash
> > >2) do not allow writi
On 04/24/15 at 04:25pm, Dave Young wrote:
> Hi, Baoquan
>
> > I support this patchset.
> >
> > We should not fear oldmem since reserved crashkernel region is similar.
> > No one can guarantee that any crazy code won't step into crashkernel
> > region just because 1st kernel says it's reversed for
On 04/24/15 at 04:49pm, Dave Young wrote:
> On 04/24/15 at 04:35pm, Baoquan He wrote:
> > On 04/24/15 at 04:25pm, Dave Young wrote:
> > > Hi, Baoquan
> > >
> > > > I support this patchset.
> > > >
> > > > We should not fear oldmem s
Change it as it's designed for and keep it consistent with other
places.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 5efadad..9ec7cad 100644
2)Learned the implementation of vt-d fix done by Joerg and did the AMD
IOMMU change similiarly.
Baoquan HE (4):
iommu/amd: add early_enable_iommu() helper function
iommu/amd: copy old trans table from old kernel
iommu/amd: Do not initialize dev tables again in kdump
iommu/amd: Check the vali
Add functions to check whether translation is already enabled in IOMMU.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 25 +
drivers/iommu/amd_iommu_types.h | 4
2 files changed, 29 insertions(+)
diff --git a/drivers/iommu/amd_iommu_init.c b
It will be more readable then the old setting.
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 9ec7cad
In amd-vi spec several bits of IO PTE fields and DTE fields are similar
so that both of them can share the same MACRO definition. However
defining their respecitve bit fields can make code more read-able. So
do it in this patch.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 10
reserved in order to avoid touch
the old translation tables.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 2 +-
drivers/iommu/amd_iommu_init.c | 38 ++
drivers/iommu/amd_iommu_types.h | 1 +
3 files changed, 40 insertions(+), 1 deletion
From: Baoquan HE
The init should have been done in normal kernel, skip it in kdump
kernel. And clean up the function comments.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu
From: Baoquan HE
This can make later kdump change easier.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 24 ++--
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 9e1dfcb
From: Baoquan HE
Here several things need be done:
1) Initialize amd_iommu_dev_table because it was set several times
since kdump kernel reboot. We don't need the set because we will
copy the content from old kernel.
2) Re-enable event/cmd buffer
3) Install the DTE table to reg
4)
From: Baoquan HE
If not valid just skip reserving the old domain id.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 4
drivers/iommu/amd_iommu_init.c | 5 +++--
drivers/iommu/amd_iommu_types.h | 5 +
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a
Hi Joerg,
Attachments are console log of normal kernel and kdump kernel on a test
machine at my hand, and the related information of lspci -vt and lspci
-vvv. Before I tried to defer the calling of set_dte_entry() until the
device driver try to call __map_single() to really allocate coherent
memor
Sorry, log of 'lspci -vvv' is not attatched correclty. Re-attach it here.
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models
30h-3fh) Processor Root Complex
Subsystem: Advanced Micro Devices, Inc. [AMD] Family 15h (Models
30h-3fh) Processor Root Complex
Co
On 05/28/16 at 08:49pm, Wan Zongshun wrote:
>
>
> Original Message
> >@@ -1101,6 +1121,11 @@ static int __init init_iommu_one(struct amd_iommu
> >*iommu, struct ivhd_header *h)
> >
> > iommu->int_enabled = false;
> >
> >+init_translation_status(iommu);
> >+
> >+if (
On 05/30/16 at 11:24am, Baoquan He wrote:
> On 05/28/16 at 08:49pm, Wan Zongshun wrote:
> In fact I am still debugging and trying to figure out what need be done
> further to stop the IO_PAGE_FAULT happened on ethernet network card. I
> kept changing code and adjust the patches. Up to
On 05/28/16 at 09:08pm, Wan Zongshun wrote:
> >+static int copy_dev_tables(void)
> >+{
> >+u64 entry;
> >+u32 lo, hi, devid;
> >+phys_addr_t old_devtb_phys;
> >+struct dev_table_entry *old_devtb;
> >+u16 dom_id, dte_v;
> >+struct amd_iommu *iommu;
> >+static int copied;
On 05/28/16 at 09:30pm, Wan Zongshun wrote:
>
>
> Original Message
> >From: Baoquan HE
> >diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> >index f3bd7fd..40c4a05 100644
> >--- a/drivers/iommu/amd_iommu.c
> >+++ b/d
It will be more readable and safer than the old setting.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 59741ea..3e810c6 100644
--- a/drivers
Change it as it's designed for and keep it consistent with other
places.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 96de97a..160fc6a 100644
The current code missed freeing domain id when free a domain of
struct dma_ops_domain.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 160fc6a..a9f78c2 100644
--- a/drivers
These were found out when I tried to fix the kdump failure on system
with AMD iommu. Pack them into this patchset since they are not related
to the kdump issue and each other.
Baoquan He (4):
iommu/amd: clean up the cmpxchg64 invocation
iommu/amd: Use standard bitmap operation to set bitmap
This is a clean up. In get_irq_table() only if DTE entry is changed
iommu_completion_wait() need be called. Otherwise no need to do it.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c b
Add functions to check whether translation is already enabled in IOMMU.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 25 +
drivers/iommu/amd_iommu_proto.h | 1 +
drivers/iommu/amd_iommu_types.h | 4
3 files changed, 30 insertions(+)
diff --git
Move per iommu enabling code into a wrapper function early_enable_iommu().
This can make later kdump change easier.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 24 ++--
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu
caches
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 44 +++---
1 file changed, 41 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index ce49641..47a8fc9 100644
--- a/drivers/iommu
In amd-vi spec several bits of IO PTE fields and DTE fields are similar
so that both of them can share the same MACRO definition. However
defining their respecitve bit fields can make code more read-able. So
do it in this patch.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 8
This enabling should have been done in normal kernel. It's unnecessary
to enable it again in kdump kernel.
And clean up the function comments of init_device_table_dma.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu_init.c | 10 +++---
1 file changed, 7 insertions(+), 3 dele
occupied in 1st kernel
need be reserved to avoid touching the old io-page tables so that on-flight DMA
can continue looking up.
And define MACRO DEV_DOMID_MASK to replace magic number 0xULL because
it need be reused in copy_dev_tables.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c
;t be updated to dte entry. We should wait until device driver init
stage.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index fcb69ff..6c37300 100644
--- a/drivers/
es to.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 21 +
1 file changed, 21 insertions(+)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 6c37300..00b64ee 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2310,6 +23
the pte_root to dev table entry to device driver
init stage.
Baoquan He (8):
iommu/amd: Detect pre enabled translation
iommu/amd: add early_enable_iommu() wrapper function
iommu/amd: Define bit fields for DTE particularly
iommu/amd: Add function copy_dev_tables
iommu/amd: copy old trans
This is a clean up. In get_irq_table() only if DTE entry is changed
iommu_completion_wait() need be called. Otherwise no need to do it.
Signed-off-by: Baoquan He
---
drivers/iommu/amd_iommu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c b
On 09/19/16 at 04:20pm, Joerg Roedel wrote:
> Hi Baoquan,
>
> On Thu, Sep 15, 2016 at 04:50:49PM +0800, Baoquan He wrote:
> > These were found out when I tried to fix the kdump failure on system
> > with AMD iommu. Pack them into this patchset since they are not related
>
On 09/20/16 at 11:56am, Joerg Roedel wrote:
> On Tue, Sep 20, 2016 at 09:05:34AM +0800, Baoquan He wrote:
> > This is a clean up. In get_irq_table() only if DTE entry is changed
> > iommu_completion_wait() need be called. Otherwise no need to do it.
> >
> >
Hi Joerg,
Thanks for your reviewing and great suggestion!
On 09/20/16 at 01:58pm, Joerg Roedel wrote:
> Hi Baoquan,
>
> On Thu, Sep 15, 2016 at 11:03:22PM +0800, Baoquan He wrote:
> > +static int copy_dev_tables(void)
> > +{
> > + u64 entry;
> > + u32 l
On 09/20/16 at 02:40pm, Joerg Roedel wrote:
> On Thu, Sep 15, 2016 at 11:03:23PM +0800, Baoquan He wrote:
> > Here several things need be done:
> > 1) If iommu is pre-enabled in a normal kernel, just disable it and print
> >warning.
> > 2) If failed to copy dev table
1 - 100 of 308 matches
Mail list logo