From: Jason Wang <jasowang@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: yi.l.liu@intel.com, yi.y.sun@linux.intel.com,
qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [PATCH 2/3] intel-iommu: drop VTDBus
Date: Fri, 14 Jan 2022 17:15:35 +0800 [thread overview]
Message-ID: <54f9372b-7a04-28db-5f27-0eafaf87d632@redhat.com> (raw)
In-Reply-To: <b542cb8d-d1f4-6583-a89e-49dedafc77d4@redhat.com>
在 2022/1/14 上午10:32, Jason Wang 写道:
>>> dressSpace *as)
>>> /* GHashTable functions */
>>> static gboolean vtd_uint64_equal(gconstpointer v1, gconstpointer v2)
>>> {
>>> - return *((const uint64_t *)v1) == *((const uint64_t *)v2);
>>> + const struct vtd_as_key *key1 = v1;
>>> + const struct vtd_as_key *key2 = v2;
>>> +
>>> + return (key1->bus == key2->bus) && (key1->devfn == key2->devfn);
>>> }
>>> static guint vtd_uint64_hash(gconstpointer v)
>>> {
>>> - return (guint)*(const uint64_t *)v;
>>> + const struct vtd_as_key *key = v;
>>> + guint value = (guint)(uintptr_t)key->bus;
>>> +
>>> + return (guint)(value << 8 | key->devfn);
>> Note that value is a pointer to PCIBus*. Just want to check with you
>> that it's
>> intended to use this hash value (or maybe you wanted to use Source ID
>> so it is
>> bus number to use not the bus pointer)?
>
>
> Right, SID should be used here.
Sorry for taking too long for the context switching ...
The hash and shift based the bus pointer is intended since we use bus
pointer as part of the key. The reason is still, during
vtd_find_add_as(), SID is not correct since guest might not finish the
initialization of the device and PCI bridge.
Thanks
next prev parent reply other threads:[~2022-01-14 9:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 4:19 [PATCH 0/3] PASID support for Intel IOMMU Jason Wang
2022-01-05 4:19 ` [PATCH] intel-iommu: correctly check passthrough during translation Jason Wang
2022-01-05 4:19 ` [PATCH 1/3] intel-iommu: don't warn guest errors when getting rid2pasid entry Jason Wang
2022-01-13 3:35 ` Peter Xu
2022-01-13 6:16 ` Jason Wang
2022-01-13 6:32 ` Peter Xu
2022-01-13 7:05 ` Michael S. Tsirkin
2022-01-14 3:02 ` Jason Wang
2022-01-13 7:06 ` Michael S. Tsirkin
2022-01-14 2:56 ` Jason Wang
2022-01-05 4:19 ` [PATCH 2/3] intel-iommu: drop VTDBus Jason Wang
2022-01-13 4:12 ` Peter Xu
2022-01-14 2:32 ` Jason Wang
2022-01-14 9:15 ` Jason Wang [this message]
2022-01-17 1:27 ` Peter Xu
2022-01-17 1:42 ` Peter Xu
2022-01-05 4:19 ` [PATCH 3/3] intel-iommu: PASID support Jason Wang
2022-01-13 5:06 ` Peter Xu
2022-01-13 7:16 ` Michael S. Tsirkin
2022-01-14 2:47 ` Jason Wang
2022-01-14 3:31 ` Peter Xu
2022-01-14 5:58 ` Jason Wang
2022-01-14 7:13 ` Peter Xu
2022-01-14 7:22 ` Jason Wang
2022-01-14 7:45 ` Peter Xu
2022-01-14 9:12 ` Jason Wang
2022-01-14 12:58 ` Liu Yi L
2022-01-17 6:01 ` Jason Wang
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=54f9372b-7a04-28db-5f27-0eafaf87d632@redhat.com \
--to=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yi.l.liu@intel.com \
--cc=yi.y.sun@linux.intel.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: link
Be 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.