<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hv/connection.c, branch v5.15.208</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.208'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-04-13T14:48:17+00:00</updated>
<entry>
<title>Drivers: vmbus: Check for channel allocation before looking up relids</title>
<updated>2023-04-13T14:48:17+00:00</updated>
<author>
<name>Mohammed Gamal</name>
<email>mgamal@redhat.com</email>
</author>
<published>2023-02-17T20:44:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c373e49fbb87aa177819866ed9194ebc5414dfd6'/>
<id>urn:sha1:c373e49fbb87aa177819866ed9194ebc5414dfd6</id>
<content type='text'>
[ Upstream commit 1eb65c8687316c65140b48fad27133d583178e15 ]

relid2channel() assumes vmbus channel array to be allocated when called.
However, in cases such as kdump/kexec, not all relids will be reset by the host.
When the second kernel boots and if the guest receives a vmbus interrupt during
vmbus driver initialization before vmbus_connect() is called, before it finishes,
or if it fails, the vmbus interrupt service routine is called which in turn calls
relid2channel() and can cause a null pointer dereference.

Print a warning and error out in relid2channel() for a channel id that's invalid
in the second kernel.

Fixes: 8b6a877c060e ("Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels")

Signed-off-by: Mohammed Gamal &lt;mgamal@redhat.com&gt;
Reviewed-by: Dexuan Cui &lt;decui@microsoft.com&gt;
Link: https://lore.kernel.org/r/20230217204411.212709-1-mgamal@redhat.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers: hv: Fix missing error code in vmbus_connect()</title>
<updated>2021-06-02T15:16:36+00:00</updated>
<author>
<name>Jiapeng Chong</name>
<email>jiapeng.chong@linux.alibaba.com</email>
</author>
<published>2021-05-25T10:58:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9de6655cc5a6a1febc514465c87c24a0e96d8dba'/>
<id>urn:sha1:9de6655cc5a6a1febc514465c87c24a0e96d8dba</id>
<content type='text'>
Eliminate the follow smatch warning:

drivers/hv/connection.c:236 vmbus_connect() warn: missing error code
'ret'.

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Jiapeng Chong &lt;jiapeng.chong@linux.alibaba.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/1621940321-72353-1-git-send-email-jiapeng.chong@linux.alibaba.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Initialize unload_event statically</title>
<updated>2021-04-20T19:40:17+00:00</updated>
<author>
<name>Andrea Parri (Microsoft)</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2021-04-20T01:43:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8c2d5e0640e53c14b6240e9bf1e32a2226e6e6ca'/>
<id>urn:sha1:8c2d5e0640e53c14b6240e9bf1e32a2226e6e6ca</id>
<content type='text'>
If a malicious or compromised Hyper-V sends a spurious message of type
CHANNELMSG_UNLOAD_RESPONSE, the function vmbus_unload_response() will
call complete() on an uninitialized event, and cause an oops.

Reported-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Andrea Parri (Microsoft) &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/20210420014350.2002-1-parri.andrea@gmail.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Introduce and negotiate VMBus protocol version 5.3</title>
<updated>2021-04-18T13:03:11+00:00</updated>
<author>
<name>Andrea Parri (Microsoft)</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2021-04-16T14:34:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1df53d212c803c0e11a2b10d47ec830d3576b972'/>
<id>urn:sha1:1df53d212c803c0e11a2b10d47ec830d3576b972</id>
<content type='text'>
Hyper-V has added VMBus protocol version 5.3.  Allow Linux guests to
negotiate the new version on version of Hyper-V that support it.

Signed-off-by: Andrea Parri (Microsoft) &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/20210416143449.16185-2-parri.andrea@gmail.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers: hv: Fix whitespace errors</title>
<updated>2021-03-08T17:32:58+00:00</updated>
<author>
<name>Vasanth</name>
<email>vasanth3g@gmail.com</email>
</author>
<published>2021-02-19T17:13:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f850a4cad27c3cfeb89fd28c768d5e6821bf178f'/>
<id>urn:sha1:f850a4cad27c3cfeb89fd28c768d5e6821bf178f</id>
<content type='text'>
Fixed checkpatch warning and errors on hv driver.

Signed-off-by: Vasanth Mathivanan &lt;vasanth3g@gmail.com&gt;
Link: https://lore.kernel.org/r/20210219171311.421961-1-vasanth3g@gmail.com
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Enforce 'VMBus version &gt;= 5.2' on isolated guests</title>
<updated>2021-02-11T08:47:05+00:00</updated>
<author>
<name>Andrea Parri (Microsoft)</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2021-02-01T14:48:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7ef4b2f0d9adb73eb66e1f87f22953169c3dc7f8'/>
<id>urn:sha1:7ef4b2f0d9adb73eb66e1f87f22953169c3dc7f8</id>
<content type='text'>
Restrict the protocol version(s) that will be negotiated with the host
to be 5.2 or greater if the guest is running isolated.  This reduces the
footprint of the code that will be exercised by Confidential VMs and
hence the exposure to bugs and vulnerabilities.

Signed-off-by: Andrea Parri (Microsoft) &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/20210201144814.2701-4-parri.andrea@gmail.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels</title>
<updated>2020-04-23T13:17:11+00:00</updated>
<author>
<name>Andrea Parri (Microsoft)</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2020-04-06T00:15:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8b6a877c060ed6b86878fe66c7c6493a6054cf23'/>
<id>urn:sha1:8b6a877c060ed6b86878fe66c7c6493a6054cf23</id>
<content type='text'>
When Hyper-V sends an interrupt to the guest, the guest has to figure
out which channel the interrupt is associated with.  Hyper-V sets a bit
in a memory page that is shared with the guest, indicating a particular
"relid" that the interrupt is associated with.  The current Linux code
then uses a set of per-CPU linked lists to map a given "relid" to a
pointer to a channel structure.

This design introduces a synchronization problem if the CPU that Hyper-V
will interrupt for a certain channel is changed.  If the interrupt comes
on the "old CPU" and the channel was already moved to the per-CPU list
of the "new CPU", then the relid -&gt; channel mapping will fail and the
interrupt is dropped.  Similarly, if the interrupt comes on the new CPU
but the channel was not moved to the per-CPU list of the new CPU, then
the mapping will fail and the interrupt is dropped.

Relids are integers ranging from 0 to 2047.  The mapping from relids to
channel structures can be done by setting up an array with 2048 entries,
each entry being a pointer to a channel structure (hence total size ~16K
bytes, which is not a problem).  The array is global, so there are no
per-CPU linked lists to update.  The array can be searched and updated
by loading from/storing to the array at the specified index.  With no
per-CPU data structures, the above mentioned synchronization problem is
avoided and the relid2channel() function gets simpler.

Suggested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Andrea Parri (Microsoft) &lt;parri.andrea@gmail.com&gt;
Link: https://lore.kernel.org/r/20200406001514.19876-4-parri.andrea@gmail.com
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Always handle the VMBus messages on CPU0</title>
<updated>2020-04-23T13:17:11+00:00</updated>
<author>
<name>Andrea Parri (Microsoft)</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2020-04-06T00:15:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a857c55420f29da4fc131adc22b12d474c48f4c'/>
<id>urn:sha1:8a857c55420f29da4fc131adc22b12d474c48f4c</id>
<content type='text'>
A Linux guest have to pick a "connect CPU" to communicate with the
Hyper-V host.  This CPU can not be taken offline because Hyper-V does
not provide a way to change that CPU assignment.

Current code sets the connect CPU to whatever CPU ends up running the
function vmbus_negotiate_version(), and this will generate problems if
that CPU is taken offine.

Establish CPU0 as the connect CPU, and add logics to prevents the
connect CPU from being taken offline.   We could pick some other CPU,
and we could pick that "other CPU" dynamically if there was a reason to
do so at some point in the future.  But for now, #defining the connect
CPU to 0 is the most straightforward and least complex solution.

While on this, add inline comments explaining "why" offer and rescind
messages should not be handled by a same serialized work queue.

Suggested-by: Dexuan Cui &lt;decui@microsoft.com&gt;
Signed-off-by: Andrea Parri (Microsoft) &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Link: https://lore.kernel.org/r/20200406001514.19876-2-parri.andrea@gmail.com
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Remove dependencies on guest page size</title>
<updated>2019-11-22T01:10:45+00:00</updated>
<author>
<name>Himadri Pandya</name>
<email>himadrispandya@gmail.com</email>
</author>
<published>2019-07-30T09:49:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=53edce00ceb7443b6f4615b5c8ad71671723d8f5'/>
<id>urn:sha1:53edce00ceb7443b6f4615b5c8ad71671723d8f5</id>
<content type='text'>
Hyper-V assumes page size to be 4K. This might not be the case for ARM64
architecture. Hence use hyper-v page size and page allocation function
to avoid conflicts between different host and guest page size on ARM64.

Signed-off-by: Himadri Pandya &lt;himadri18.07@gmail.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers: hv: vmbus: Introduce latency testing</title>
<updated>2019-11-22T01:10:44+00:00</updated>
<author>
<name>Branden Bonaby</name>
<email>brandonbonaby94@gmail.com</email>
</author>
<published>2019-10-03T21:01:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=af9ca6f9bb16e446a44393a797d0ae74d356a5c7'/>
<id>urn:sha1:af9ca6f9bb16e446a44393a797d0ae74d356a5c7</id>
<content type='text'>
Introduce user specified latency in the packet reception path
By exposing the test parameters as part of the debugfs channel
attributes. We will control the testing state via these attributes.

Signed-off-by: Branden Bonaby &lt;brandonbonaby94@gmail.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
