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


Groups > linux.kernel > #1440824 > unrolled thread

Re: [PART2 PATCH v3 10/11] svm: Introduce AMD IOMMU avic_ga_log_notifier

Started byRadim Krčmář <rkrcmar@redhat.com>
First post2016-07-11 21:10 +0200
Last post2016-07-11 21:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PART2 PATCH v3 10/11] svm: Introduce AMD IOMMU  avic_ga_log_notifier Radim Krčmář <rkrcmar@redhat.com> - 2016-07-11 21:10 +0200

#1440824 — Re: [PART2 PATCH v3 10/11] svm: Introduce AMD IOMMU avic_ga_log_notifier

FromRadim Krčmář <rkrcmar@redhat.com>
Date2016-07-11 21:10 +0200
SubjectRe: [PART2 PATCH v3 10/11] svm: Introduce AMD IOMMU avic_ga_log_notifier
Message-ID<rTOKB-2Ii-1@gated-at.bofh.it>
2016-07-11 05:11-0500, Suravee Suthikulpanit:
> From: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
> 
> This patch introduces avic_ga_log_notifier, which will be called
> by IOMMU driver whenever it handles the Guest vAPIC (GA) log entry.
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> @@ -928,6 +930,45 @@ static void svm_disable_lbrv(struct vcpu_svm *svm)
> +static int avic_ga_log_notifier(int avic_tag, int vcpu_id, int vec)
> +{
> +	unsigned long flags;
> +	struct kvm_arch *ka = NULL;
> +	struct kvm_vcpu *vcpu = NULL;
> +	struct vcpu_svm *svm = NULL;
> +
> +	pr_debug("SVM: %s: avic_tag=%#x, vcpu_id=%#x, vec=%#x\n",
> +		 __func__, avic_tag, vcpu_id, vec);
> +
> +	spin_lock_irqsave(&svm_vm_data_hash_lock, flags);
> +	hash_for_each_possible(svm_vm_data_hash, ka, hnode, avic_tag) {
> +		struct kvm *kvm = container_of(ka, struct kvm, arch);

iommu_handle_ga_guest_nr_entry(), the caller, already performed a hash
lookup to get ir_data.  Cannot we store the vcpu pointer in ir_data, to
avoid a second hash lookup and a vcpu lookup?

Thanks.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web