History log of /freebsd/sys/dev/hyperv/pcib/vmbus_pcib.c (Results 1 – 25 of 33)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 18250ec6 06-Dec-2024 John Baldwin <jhb@FreeBSD.org>

Replace calls to bus_generic_attach with bus_attach_children

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675


Revision tags: release/14.2.0, release/13.4.0
# 5b56413d 25-Jul-2024 Warner Losh <imp@FreeBSD.org>

newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY

Sponsored by: Netflix


# 8415a654 18-Jul-2024 Jessica Clarke <jrtc27@FreeBSD.org>

Retire non-NEW_PCIB code and remove config option

All architectures enable NEW_PCIB in DEFAULTS (arm being the most recent
to do so in 121be555997b (arm: Set NEW_PCIB in DEFAULTS rather than a
subse

Retire non-NEW_PCIB code and remove config option

All architectures enable NEW_PCIB in DEFAULTS (arm being the most recent
to do so in 121be555997b (arm: Set NEW_PCIB in DEFAULTS rather than a
subset of kernel configs")), so it's time we removed the legacy code
that no longer sees much testing and has a significant maintenance
burden.

Reviewed by: jhb, andrew, emaste
Differential Revision: https://reviews.freebsd.org/D32954

show more ...


Revision tags: release/14.1.0
# 9dbf5b0e 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE

The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.

new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE

The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44131

show more ...


# 2baed46e 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCE

The public bus_activate/deactivate_resource() API still accepts both
forms, but the internal kobj methods no longer pass th

new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCE

The public bus_activate/deactivate_resource() API still accepts both
forms, but the internal kobj methods no longer pass the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44130

show more ...


# fef01f04 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'type' argument from BUS_ADJUST_RESOURCE

The public bus_adjust_resource() API still accepts both forms, but the
internal kobj method no longer passes the argument. Implementatio

new-bus: Remove the 'type' argument from BUS_ADJUST_RESOURCE

The public bus_adjust_resource() API still accepts both forms, but the
internal kobj method no longer passes the argument. Implementations
which need the type now use rman_get_type() to fetch the value from
the allocated resource.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44128

show more ...


# 999174ba 08-Mar-2024 Wei Hu <whu@FreeBSD.org>

Hyper-V: vPCI: fix cpu id mis-mapping in vmbus_pcib_map_msi()

The msi address contains apic id. The code in vmbus_pcib_map_msi()
treats it as cpu id, which could cause mis-configuration of msix
IRQs

Hyper-V: vPCI: fix cpu id mis-mapping in vmbus_pcib_map_msi()

The msi address contains apic id. The code in vmbus_pcib_map_msi()
treats it as cpu id, which could cause mis-configuration of msix
IRQs, leading to missing interrupts for SRIOV devices. This happens
when apic id is not the same as cpu id on certain large VM sizes
with multiple numa domains in Azure. Fix this issue by correctly
mapping apic ids to cpu ids.

On vPCI version before 1.4, it only supports up to 64 vcpus
for msi/msix interrupt. This change also adds a check and returns
error if the vcpu_id is greater than 63.

Reported by: NetApp
Tested by: whu
MFC after: 1 week

show more ...


Revision tags: release/13.3.0
# 9c4effb1 23-Jan-2024 John Baldwin <jhb@FreeBSD.org>

hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources

Specifically for bus_activate/adjust/deactivate_bus methods.

Differential Revision: https://reviews.freebsd.org/D43431


Revision tags: release/14.0.0
# 4196186d 11-Sep-2023 Li-Wen Hsu <lwhsu@FreeBSD.org>

hyperv/vmbus: Flip a message to only be emitted on failure

This message is not very useful when things are working well.
Flip its meaning and let it only be emitted on failure.

While here, pet styl

hyperv/vmbus: Flip a message to only be emitted on failure

This message is not very useful when things are working well.
Flip its meaning and let it only be emitted on failure.

While here, pet style(9).

Reviewed by: mhorne, whu
Differential Revision: https://reviews.freebsd.org/D41788

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 62f9bcf2 22-May-2023 Andrew Turner <andrew@FreeBSD.org>

Switch to contigmalloc in the Hyper-V code

In the Hyper-V drivers we need to allocate buffers shared between the
host and guest. This memory has been allocated with bus_dma, however
it doesn't use t

Switch to contigmalloc in the Hyper-V code

In the Hyper-V drivers we need to allocate buffers shared between the
host and guest. This memory has been allocated with bus_dma, however
it doesn't use this correctly, e.g. it is missing calls to
bus_dmamap_sync. Along with this on arm64 we need this memory to be
mapped with the correct memory type that bus_dma may not use.

Switch to contigmalloc to allocate this memory as this will correctly
allocate cacheable memory.

Reviewed by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40227

show more ...


Revision tags: release/13.2.0, release/12.4.0
# b02a3977 23-Jun-2022 Elliott Mitchell <ehem+freebsd@m5p.com>

hyperv: purge EOL release compatibility

Remove FreeBSD 11 and earlier support

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.f

hyperv: purge EOL release compatibility

Remove FreeBSD 11 and earlier support

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

show more ...


# c75ae522 01-Feb-2023 Wei Hu <whu@FreeBSD.org>

arm64: Hyper-V: vPCI: Fix typo and some indentations

Fix a typo and some indentation errors in the previous commits.

Reported by: jrtc27
Fixes: db247798c5640 ("arm64: Hyper-V: vPCI: SPI MSI mapping

arm64: Hyper-V: vPCI: Fix typo and some indentations

Fix a typo and some indentation errors in the previous commits.

Reported by: jrtc27
Fixes: db247798c5640 ("arm64: Hyper-V: vPCI: SPI MSI mapping for gic v3 acpi in arm64")
Fixes: 6e5b082cab8d9 ("arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4")
Sponsored by: Microsoft

show more ...


# ea11861e 01-Feb-2023 Wei Hu <whu@FreeBSD.org>

arm64: Hyper-V: vPCI: Enabling v-PCI in FreeBSD in ARM64 Hyper-V

This patch does remaining enablement in hyperv vpci driver to work
on arm64 Hyper-V. For that it required to use PCI protocol 1.4 and

arm64: Hyper-V: vPCI: Enabling v-PCI in FreeBSD in ARM64 Hyper-V

This patch does remaining enablement in hyperv vpci driver to work
on arm64 Hyper-V. For that it required to use PCI protocol 1.4 and
corresponding different PCI message handling. Also new MSI allocation,
MSI-X mapping, release.

This is the last patch of total three patches to enalbe Hyper-V vPCI
support in arm64.

Reviewed by: whu
Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Obtained from: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D37958

show more ...


# 6e5b082c 01-Feb-2023 Wei Hu <whu@FreeBSD.org>

arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4

This is enabling the PCI protocol 1.4 and corresponding structures
in order to support arm64 Hyper-V.

This is the 2nd of the three patches to e

arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4

This is enabling the PCI protocol 1.4 and corresponding structures
in order to support arm64 Hyper-V.

This is the 2nd of the three patches to enable Hyper-V vPCI support
in arm64.

Reviewed by: whu
Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Obtained from: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D37780

show more ...


Revision tags: release/13.1.0
# c1cef544 07-May-2022 John Baldwin <jhb@FreeBSD.org>

hyperv: Remove unused devclass arguments to DRIVER_MODULE.


# 5473dee7 30-Mar-2022 Wei Hu <whu@FreeBSD.org>

Hyper-V: vPCI: Write back original BAR values after prepopulating bars

In vmbus_pcib_prepopulate_bars(), after writing all 1's to the
avialable device bars, those without being configured by device

Hyper-V: vPCI: Write back original BAR values after prepopulating bars

In vmbus_pcib_prepopulate_bars(), after writing all 1's to the
avialable device bars, those without being configured by device driver
are also set to its initialized values. However, this could cause
weird problem which results to device failure. The issue has been
reported to happen on LSI 9211-8i HBA card for DDA access on Hyper-V.
Writing back the orignal BAR values seem to work around this problem.

Reported by: Alexander Motin <mavbsd@gmail.com>
Tested by: Mathias Kraut <krautmaster@gmail.com>
Fixes: 75412a521f6 Hyper-V: vPCI: Prepopulate device bars
MFC after: 1 month

show more ...


# c6df6f53 10-Dec-2021 Warner Losh <imp@FreeBSD.org>

Create wrapper for Giant taken for newbus

Create a wrapper for newbus to take giant and for busses to take it too.
bus_topo_lock() should be called before interacting with newbus routines
and unlock

Create wrapper for Giant taken for newbus

Create a wrapper for newbus to take giant and for busses to take it too.
bus_topo_lock() should be called before interacting with newbus routines
and unlocked with bus_topo_unlock(). If you need the topology lock for
some reason, bus_topo_mtx() will provide that.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D31831

show more ...


Revision tags: release/12.3.0
# 75412a52 27-Nov-2021 Wei Hu <whu@FreeBSD.org>

Hyper-V: vPCI: Prepopulate device bars

In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weir

Hyper-V: vPCI: Prepopulate device bars

In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weird problems cuasing PCI code failure when configuring
bars.

Just write all 1's to those bars whose probed values are not the same
as current read ones. This seems to make Hyper-V vPCI and
pci_write_bar() to cooperate correctly on these releases.

Reported by: khng@freebsd.org
Tested by: khng@freebsd.org
MFC after: 2 weeks
Sponsored by: Microsoft

show more ...


Revision tags: release/13.0.0, release/12.2.0
# 75c2786c 15-Oct-2020 Wei Hu <whu@FreeBSD.org>

Hyper-V: pcib: Check revoke status during device attach

It is possible that the vmbus pcib channel is revoked during attach path.
The attach path could be waiting for response from host and this res

Hyper-V: pcib: Check revoke status during device attach

It is possible that the vmbus pcib channel is revoked during attach path.
The attach path could be waiting for response from host and this response will never
arrive since the channel has already been revoked from host point of view. Check
this situation during wait complete and return failed if this happens.

Reported by: Netapp
MFC after: 2 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D26486

show more ...


Revision tags: release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0
# 14b841d4 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

MFH @ r337607, in preparation for boarding


# f9c0a512 10-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r337286 through r337585.


# aaf13123 04-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Fix build of hyperv with base gcc on i386

Summary:
Base gcc fails to compile `sys/dev/hyperv/pcib/vmbus_pcib.c` for i386,
with the following -Werror warnings:

cc1: warnings being treated as errors

Fix build of hyperv with base gcc on i386

Summary:
Base gcc fails to compile `sys/dev/hyperv/pcib/vmbus_pcib.c` for i386,
with the following -Werror warnings:

cc1: warnings being treated as errors
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'new_pcichild_device':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:567: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_on_channel_callback':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:940: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_protocol_negotiation':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1012: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_enter_d0':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1073: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_send_resources_allocated':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1125: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_map_msi':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1730: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

This is because on i386, several casts from `uint64_t` to a pointer
reduce the value from 64 bit to 32 bit.

For gcc, this can be fixed by an intermediate cast to uintptr_t. Note
that I am assuming the incoming values will always fit into 32 bit!

Differential Revision: https://reviews.freebsd.org/D15753
MFC after: 3 days

show more ...


Revision tags: release/11.2.0, release/10.4.0
# 1409e715 21-Aug-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r322398 through r322746.


# 82baa8db 14-Aug-2017 Enji Cooper <ngie@FreeBSD.org>

MFhead@r322515


12