From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> To: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Cc: joro@8bytes.org, sean.m.osborne@oracle.com, james.puthukattukaran@oracle.com, joao.m.martins@oracle.com, boris.ostrovsky@oracle.com, jon.grimm@amd.com, Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Subject: [PATCH 1/2 v2] iommu: amd: Restore IRTE.RemapEn bit after programming IRTE Date: Thu, 3 Sep 2020 09:38:21 +0000 [thread overview] Message-ID: <20200903093822.52012-2-suravee.suthikulpanit@amd.com> (raw) In-Reply-To: <20200903093822.52012-1-suravee.suthikulpanit@amd.com> Currently, the RemapEn (valid) bit is accidentally cleared when programming IRTE w/ guestMode=0. It should be restored to the prior state. Reviewed-by: Joao Martins <joao.m.martins@oracle.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Fixes: b9fc6b56f478 ("iommu/amd: Implements irq_set_vcpu_affinity() hook to setup vapic mode for pass-through devices") --- 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 ba9f3dbc5b94..967f4e96d1eb 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -3850,6 +3850,7 @@ int amd_iommu_deactivate_guest_mode(void *data) struct amd_ir_data *ir_data = (struct amd_ir_data *)data; struct irte_ga *entry = (struct irte_ga *) ir_data->entry; struct irq_cfg *cfg = ir_data->cfg; + u64 valid = entry->lo.fields_remap.valid; if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) || !entry || !entry->lo.fields_vapic.guest_mode) @@ -3858,6 +3859,7 @@ int amd_iommu_deactivate_guest_mode(void *data) entry->lo.val = 0; entry->hi.val = 0; + entry->lo.fields_remap.valid = valid; entry->lo.fields_remap.dm = apic->irq_dest_mode; entry->lo.fields_remap.int_type = apic->irq_delivery_mode; entry->hi.fields.vector = cfg->vector; -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> To: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Cc: jon.grimm@amd.com, james.puthukattukaran@oracle.com, boris.ostrovsky@oracle.com, joao.m.martins@oracle.com, sean.m.osborne@oracle.com Subject: [PATCH 1/2 v2] iommu: amd: Restore IRTE.RemapEn bit after programming IRTE Date: Thu, 3 Sep 2020 09:38:21 +0000 [thread overview] Message-ID: <20200903093822.52012-2-suravee.suthikulpanit@amd.com> (raw) In-Reply-To: <20200903093822.52012-1-suravee.suthikulpanit@amd.com> Currently, the RemapEn (valid) bit is accidentally cleared when programming IRTE w/ guestMode=0. It should be restored to the prior state. Reviewed-by: Joao Martins <joao.m.martins@oracle.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Fixes: b9fc6b56f478 ("iommu/amd: Implements irq_set_vcpu_affinity() hook to setup vapic mode for pass-through devices") --- 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 ba9f3dbc5b94..967f4e96d1eb 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -3850,6 +3850,7 @@ int amd_iommu_deactivate_guest_mode(void *data) struct amd_ir_data *ir_data = (struct amd_ir_data *)data; struct irte_ga *entry = (struct irte_ga *) ir_data->entry; struct irq_cfg *cfg = ir_data->cfg; + u64 valid = entry->lo.fields_remap.valid; if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) || !entry || !entry->lo.fields_vapic.guest_mode) @@ -3858,6 +3859,7 @@ int amd_iommu_deactivate_guest_mode(void *data) entry->lo.val = 0; entry->hi.val = 0; + entry->lo.fields_remap.valid = valid; entry->lo.fields_remap.dm = apic->irq_dest_mode; entry->lo.fields_remap.int_type = apic->irq_delivery_mode; entry->hi.fields.vector = cfg->vector; -- 2.17.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-09-03 9:36 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-03 9:38 [PATCH 0/2 v2] iommu: amd: Fix intremap IO_PAGE_FAULT for VMs Suravee Suthikulpanit 2020-09-03 9:38 ` Suravee Suthikulpanit 2020-09-03 9:38 ` Suravee Suthikulpanit [this message] 2020-09-03 9:38 ` [PATCH 1/2 v2] iommu: amd: Restore IRTE.RemapEn bit after programming IRTE Suravee Suthikulpanit 2020-09-03 9:38 ` [PATCH 2/2 v2] iommu: amd: Use cmpxchg_double() when updating 128-bit IRTE Suravee Suthikulpanit 2020-09-03 9:38 ` Suravee Suthikulpanit 2020-09-04 9:53 ` [PATCH 0/2 v2] iommu: amd: Fix intremap IO_PAGE_FAULT for VMs Joerg Roedel 2020-09-04 9:53 ` Joerg Roedel
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200903093822.52012-2-suravee.suthikulpanit@amd.com \ --to=suravee.suthikulpanit@amd.com \ --cc=boris.ostrovsky@oracle.com \ --cc=iommu@lists.linux-foundation.org \ --cc=james.puthukattukaran@oracle.com \ --cc=joao.m.martins@oracle.com \ --cc=jon.grimm@amd.com \ --cc=joro@8bytes.org \ --cc=linux-kernel@vger.kernel.org \ --cc=sean.m.osborne@oracle.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.