<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/hv, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/hv?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/hv?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-10-27T10:58:14Z</updated>
<entry>
<title>Drivers: hv: fix repeated words in comments</title>
<updated>2022-10-27T10:58:14Z</updated>
<author>
<name>Jilin Yuan</name>
<email>yuanjilin@cdjrlc.com</email>
</author>
<published>2022-10-19T12:56:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=99632e3dbeb25a0ff86c4af4bba2dcf638624423'/>
<id>urn:sha1:99632e3dbeb25a0ff86c4af4bba2dcf638624423</id>
<content type='text'>
Delete the redundant word 'of'.

Signed-off-by: Jilin Yuan &lt;yuanjilin@cdjrlc.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/20221019125604.52999-1-yuanjilin@cdjrlc.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'hyperv-next-signed-20221009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux</title>
<updated>2022-10-10T20:59:01Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-10-10T20:59:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0e0073eb1b60f4ec6faecea034a6772fe1409a88'/>
<id>urn:sha1:0e0073eb1b60f4ec6faecea034a6772fe1409a88</id>
<content type='text'>
Pull hyperv updates from Wei Liu:

 - Remove unnecessary delay while probing for VMBus (Stanislav
   Kinsburskiy)

 - Optimize vmbus_on_event (Saurabh Sengar)

 - Fix a race in Hyper-V DRM driver (Saurabh Sengar)

 - Miscellaneous clean-up patches from various people

* tag 'hyperv-next-signed-20221009' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  x86/hyperv: Replace kmap() with kmap_local_page()
  drm/hyperv: Add ratelimit on error message
  hyperv: simplify and rename generate_guest_id
  Drivers: hv: vmbus: Split memcpy of flex-array
  scsi: storvsc: remove an extraneous "to" in a comment
  Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization
  Drivers: hv: vmbus: Use PCI_VENDOR_ID_MICROSOFT for better discoverability
  Drivers: hv: vmbus: Fix kernel-doc
  drm/hyperv: Don't overwrite dirt_needed value set by host
  Drivers: hv: vmbus: Optimize vmbus_on_event
</content>
</entry>
<entry>
<title>Merge branch 'acpi-dev'</title>
<updated>2022-09-30T18:05:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-09-30T18:05:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=80487a37def2a75f083388cf6e811bff9b6140df'/>
<id>urn:sha1:80487a37def2a75f083388cf6e811bff9b6140df</id>
<content type='text'>
Merge changes regarding the management of ACPI device objects for
6.1-rc1:

 - Rename ACPI device object reference counting functions (Rafael
   Wysocki).

 - Rearrange ACPI device object initialization code (Rafael Wysocki).

 - Drop parent field from struct acpi_device (Rafael Wysocki).

 - Extend the the int3472-tps68470 driver to support multiple consumers
   of a single TPS68470 along with the requisite framework-level
   support (Daniel Scally).

* acpi-dev:
  platform/x86: int3472: Add board data for Surface Go2 IR camera
  platform/x86: int3472: Support multiple gpio lookups in board data
  platform/x86: int3472: Support multiple clock consumers
  ACPI: bus: Add iterator for dependent devices
  ACPI: scan: Add acpi_dev_get_next_consumer_dev()
  ACPI: property: Use acpi_dev_parent()
  ACPI: Drop redundant acpi_dev_parent() header
  ACPI: PM: Fix NULL argument handling in acpi_device_get/set_power()
  ACPI: Drop parent field from struct acpi_device
  ACPI: scan: Eliminate __acpi_device_add()
  ACPI: scan: Rearrange initialization of ACPI device objects
  ACPI: scan: Rename acpi_bus_get_parent() and rearrange it
  ACPI: Rename acpi_bus_get/put_acpi_device()
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Split memcpy of flex-array</title>
<updated>2022-09-28T13:35:26Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2022-09-27T21:17:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=fb2d14add4f813c73bd9d28b750315ccb3f5f0ea'/>
<id>urn:sha1:fb2d14add4f813c73bd9d28b750315ccb3f5f0ea</id>
<content type='text'>
To work around a misbehavior of the compiler's ability to see into
composite flexible array structs (as detailed in the coming memcpy()
hardening series[1]), split the memcpy() of the header and the payload
so no false positive run-time overflow warning will be generated. This
results in the already inlined memcpy getting unrolled a little more,
which very slightly increases text size:

$ size drivers/hv/vmbus_drv.o.before drivers/hv/vmbus_drv.o
   text    data     bss     dec     hex filename
  22968    5239     232   28439    6f17 drivers/hv/vmbus_drv.o.before
  23032    5239     232   28503    6f57 drivers/hv/vmbus_drv.o

Avoids the run-time false-positive warning:

  memcpy: detected field-spanning write (size 212) of single field "&amp;ctx-&gt;msg" at drivers/hv/vmbus_drv.c:1133 (size 16)

[1] https://lore.kernel.org/linux-hardening/20220901065914.1417829-2-keescook@chromium.org/

Cc: "K. Y. Srinivasan" &lt;kys@microsoft.com&gt;
Cc: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
Cc: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
Cc: Wei Liu &lt;wei.liu@kernel.org&gt;
Cc: Dexuan Cui &lt;decui@microsoft.com&gt;
Cc: linux-hyperv@vger.kernel.org
Reported-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reported-by: "Gustavo A. R. Silva" &lt;gustavoars@kernel.org&gt;
Tested-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/20220927211736.3241175-1-keescook@chromium.org
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Don't wait for the ACPI device upon initialization</title>
<updated>2022-09-23T10:40:09Z</updated>
<author>
<name>Stanislav Kinsburskiy</name>
<email>stanislav.kinsburskiy@gmail.com</email>
</author>
<published>2022-09-21T18:39:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f7ac541e18e2a7b70ae215803e27c78e0f221d00'/>
<id>urn:sha1:f7ac541e18e2a7b70ae215803e27c78e0f221d00</id>
<content type='text'>
Waiting to 5 seconds in case of missing VMBus ACPI device is redundant as the
device is either present already or won't be available at all.

This patch enforces synchronous probing to make sure the bus traversal,
happening upon driver registering will either find the device (if present) or
not spend any additional time if device is absent.

Signed-off-by: Stanislav Kinsburskiy &lt;stanislav.kinsburskiy@gmail.com&gt;
CC: "K. Y. Srinivasan" &lt;kys@microsoft.com&gt;
CC: Haiyang Zhang &lt;haiyangz@microsoft.com&gt;
CC: Stephen Hemminger &lt;sthemmin@microsoft.com&gt;
CC: Wei Liu &lt;wei.liu@kernel.org&gt;
CC: Dexuan Cui &lt;decui@microsoft.com&gt;
CC: linux-hyperv@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Reviewed-by: Dexuan Cui &lt;decui@microsoft.com&gt;
Link: https://lore.kernel.org/r/166378554568.581670.1124852716698789244.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Use PCI_VENDOR_ID_MICROSOFT for better discoverability</title>
<updated>2022-09-23T10:30:37Z</updated>
<author>
<name>Easwar Hariharan</name>
<email>easwar.hariharan@microsoft.com</email>
</author>
<published>2022-09-19T22:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a99aaf2e3b334a0242ed3c07d39efdf6d4f530f1'/>
<id>urn:sha1:a99aaf2e3b334a0242ed3c07d39efdf6d4f530f1</id>
<content type='text'>
pci_ids.h already defines PCI_VENDOR_ID_MICROSOFT, and is included via
linux/pci.h. Use the define instead of the magic number.

Signed-off-by: Easwar Hariharan &lt;easwar.hariharan@microsoft.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/1663625084-2518-2-git-send-email-eahariha@linux.microsoft.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Fix kernel-doc</title>
<updated>2022-09-23T10:29:08Z</updated>
<author>
<name>Jiapeng Chong</name>
<email>jiapeng.chong@linux.alibaba.com</email>
</author>
<published>2022-09-19T06:38:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e1a863cddbed9cab1d768c720f598322e9a96edb'/>
<id>urn:sha1:e1a863cddbed9cab1d768c720f598322e9a96edb</id>
<content type='text'>
drivers/hv/vmbus_drv.c:1587: warning: expecting prototype for __vmbus_child_driver_register(). Prototype was for __vmbus_driver_register() instead.

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2210
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/20220919063815.1881-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: vmbus: Optimize vmbus_on_event</title>
<updated>2022-09-23T09:27:17Z</updated>
<author>
<name>Saurabh Sengar</name>
<email>ssengar@linux.microsoft.com</email>
</author>
<published>2022-07-25T09:37:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=78c65f0f3c0ca5198b454f59069a1c2e352424dd'/>
<id>urn:sha1:78c65f0f3c0ca5198b454f59069a1c2e352424dd</id>
<content type='text'>
In the vmbus_on_event loop, 2 jiffies timer will not serve the purpose if
callback_fn takes longer. For effective use move this check inside of
callback functions where needed. Out of all the VMbus drivers using
vmbus_on_event, only storvsc has a high packet volume, thus add this limit
only in storvsc callback for now.
There is no apparent benefit of loop itself because this tasklet will be
scheduled anyway again if there are packets left in ring buffer. This
patch removes this unnecessary loop as well.

Signed-off-by: Saurabh Sengar &lt;ssengar@linux.microsoft.com&gt;
Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Link: https://lore.kernel.org/r/1658741848-4210-1-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: Never allocate anything besides framebuffer from framebuffer memory region</title>
<updated>2022-09-05T17:02:15Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2022-08-27T13:03:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f0880e2cb7e1f8039a048fdd01ce45ab77247221'/>
<id>urn:sha1:f0880e2cb7e1f8039a048fdd01ce45ab77247221</id>
<content type='text'>
Passed through PCI device sometimes misbehave on Gen1 VMs when Hyper-V
DRM driver is also loaded. Looking at IOMEM assignment, we can see e.g.

$ cat /proc/iomem
...
f8000000-fffbffff : PCI Bus 0000:00
  f8000000-fbffffff : 0000:00:08.0
    f8000000-f8001fff : bb8c4f33-2ba2-4808-9f7f-02f3b4da22fe
...
fe0000000-fffffffff : PCI Bus 0000:00
  fe0000000-fe07fffff : bb8c4f33-2ba2-4808-9f7f-02f3b4da22fe
    fe0000000-fe07fffff : 2ba2:00:02.0
      fe0000000-fe07fffff : mlx4_core

the interesting part is the 'f8000000' region as it is actually the
VM's framebuffer:

$ lspci -v
...
0000:00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 [VGA controller])
	Flags: bus master, fast devsel, latency 0, IRQ 11
	Memory at f8000000 (32-bit, non-prefetchable) [size=64M]
...

 hv_vmbus: registering driver hyperv_drm
 hyperv_drm 5620e0c7-8062-4dce-aeb7-520c7ef76171: [drm] Synthvid Version major 3, minor 5
 hyperv_drm 0000:00:08.0: vgaarb: deactivate vga console
 hyperv_drm 0000:00:08.0: BAR 0: can't reserve [mem 0xf8000000-0xfbffffff]
 hyperv_drm 5620e0c7-8062-4dce-aeb7-520c7ef76171: [drm] Cannot request framebuffer, boot fb still active?

Note: "Cannot request framebuffer" is not a fatal error in
hyperv_setup_gen1() as the code assumes there's some other framebuffer
device there but we actually have some other PCI device (mlx4 in this
case) config space there!

The problem appears to be that vmbus_allocate_mmio() can use dedicated
framebuffer region to serve any MMIO request from any device. The
semantics one might assume of a parameter named "fb_overlap_ok"
aren't implemented because !fb_overlap_ok essentially has no effect.
The existing semantics are really "prefer_fb_overlap". This patch
implements the expected and needed semantics, which is to not allocate
from the frame buffer space when !fb_overlap_ok.

Note, Gen2 VMs are usually unaffected by the issue because
framebuffer region is already taken by EFI fb (in case kernel supports
it) but Gen1 VMs may have this region unclaimed by the time Hyper-V PCI
pass-through driver tries allocating MMIO space if Hyper-V DRM/FB drivers
load after it. Devices can be brought up in any sequence so let's
resolve the issue by always ignoring 'fb_mmio' region for non-FB
requests, even if the region is unclaimed.

Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Link: https://lore.kernel.org/r/20220827130345.1320254-4-vkuznets@redhat.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
<entry>
<title>Drivers: hv: Always reserve framebuffer region for Gen1 VMs</title>
<updated>2022-09-05T17:02:15Z</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2022-08-27T13:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2a8a8afba0c3053d0ea8686182f6b2104293037e'/>
<id>urn:sha1:2a8a8afba0c3053d0ea8686182f6b2104293037e</id>
<content type='text'>
vmbus_reserve_fb() tries reserving framebuffer region iff
'screen_info.lfb_base' is set. Gen2 VMs seem to have it set by EFI
and/or by the kernel EFI FB driver (or, in some edge cases like kexec,
the address where the buffer was moved, see
https://lore.kernel.org/all/20201014092429.1415040-1-kasong@redhat.com/)
but on Gen1 VM it depends on bootloader behavior. With grub, it depends
on 'gfxpayload=' setting but in some cases it is observed to be zero.
That being said, relying on 'screen_info.lfb_base' to reserve
framebuffer region is risky. For Gen1 VMs, it should always be
possible to get the address from the dedicated PCI device instead.

Check for legacy PCI video device presence and reserve the whole
region for framebuffer on Gen1 VMs.

Reviewed-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Link: https://lore.kernel.org/r/20220827130345.1320254-3-vkuznets@redhat.com
Signed-off-by: Wei Liu &lt;wei.liu@kernel.org&gt;
</content>
</entry>
</feed>
