Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1440815

Re: [PART2 PATCH v3 06/11] iommu/amd: Adding GALOG interrupt handler

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject Re: [PART2 PATCH v3 06/11] iommu/amd: Adding GALOG interrupt handler
Date Mon, 11 Jul 2016 20:50:01 +0200
Message-ID <rTOrf-2mb-1@gated-at.bofh.it> (permalink)
References <rTOrf-2mb-3@gated-at.bofh.it> <rTOrf-2mb-5@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
X-Scanned-By MIMEDefang 2.68 on 10.5.11.26
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 11 Jul 2016 18:47:17 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 47
Organization linux.* mail to news gateway
X-Original-Cc joro@8bytes.org, pbonzini@redhat.com, alex.williamson@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, sherry.hurwitz@amd.com
X-Original-Date Mon, 11 Jul 2016 20:47:12 +0200
X-Original-Message-ID <20160711184712.GA1334@potion>
X-Original-References <1468231899-6987-1-git-send-email-suravee.suthikulpanit@amd.com> <1468231899-6987-7-git-send-email-suravee.suthikulpanit@amd.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1440815

Show key headers only | View raw


2016-07-11 05:11-0500, Suravee Suthikulpanit:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> This patch adds AMD IOMMU guest virtual APIC log (GALOG) handler.
> When IOMMU hardware receives an interrupt targeting a blocking vcpu,
> it creates an entry in the GALOG, and generates an interrupt to notify
> the AMD IOMMU driver.
> 
> At this point, the driver processes the log entry, and notify the SVM
> driver via the registered iommu_ga_log_notifier function.
> 
> Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> ---
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> @@ -741,14 +741,101 @@ static void iommu_poll_ppr_log(struct amd_iommu *iommu)
> +static void iommu_handle_ga_guest_nr_entry(struct amd_iommu *iommu,
> +					   u16 devid, u32 ga_tag)
> +{
> +	struct amd_ir_data *ir_data;
> +	unsigned long flags;
> +	int vec = 0;
> +
> +	if (!iommu_ga_log_notifier)
> +		return;
> +
> +	spin_lock_irqsave(&iommu->ga_hash_lock, flags);
> +	hash_for_each_possible(iommu->ga_hash, ir_data, hnode, ga_tag) {
> +		struct irte_ga *entry = (struct irte_ga *)ir_data->entry;

  if (ga_tag != entry->fields_vapic.ga_tag)
  	continue;

Multiple different ga_tags can map to the same bucket, so we need to
explicitly select the correct entry.

> +
> +		vec = entry->hi.fields.vector;
> +		break;
> +	}
> +	spin_unlock_irqrestore(&iommu->ga_hash_lock, flags);
> +
> +	if (vec) {
> +		pr_debug("AMD-Vi: %s: devid=%#x, ga_tag=%#x\n",
> +			 __func__, devid, ga_tag);
> +
> +		if (iommu_ga_log_notifier(GATAG_TO_AVICTAG(ga_tag),
> +					  GATAG_TO_VCPUID(ga_tag), vec) != 0)

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PART2 PATCH v3 06/11] iommu/amd: Adding GALOG interrupt handler Radim Krčmář <rkrcmar@redhat.com> - 2016-07-11 20:50 +0200

csiph-web