Skip to content

Commit ee09844

Browse files
Dorinda Basseyslp
authored andcommitted
libkrunfw: Add virtio-CAN driver support
Add virtio CAN driver patch v13 from upstream kernel mailing list to enable vhost-user CAN device support in libkrun. The driver implements a complete CAN bus interface over Virtio transport, supporting both CAN Classic and CAN-FD. Changes: - Add patch 0027-can-virtio-Add-virtio-CAN-driver.patch (v13 from lore.kernel.org/virtualization) - Enable CAN kernel configs Fixes: - Kernel 6.12 compatibility fix for can_priv structure access: change can.fd.data_bittiming to can.data_bittiming (struct layout changed in kernel 6.13+) - Fix FORTIFY_SOURCE panic in virtio_can_start_xmit: set can_tx_msg->tx_out.length before memcpy() to satisfy __counted_by_le() buffer bounds checking. The driver has been tested with rust-vmm vhost-device-can backend. Upstream patch authors: - Matias Ezequiel Vara Larsen <mvaralar@redhat.com> - Harald Mommer <harald.mommer@oss.qualcomm.com> - Mikhail Golubev-Ciuchea <mikhail.golubev-ciuchea@oss.qualcomm.com> Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
1 parent f60c093 commit ee09844

3 files changed

Lines changed: 1551 additions & 2 deletions

File tree

config-libkrunfw_aarch64

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,12 @@ CONFIG_NET_FLOW_LIMIT=y
10261026
# end of Networking options
10271027

10281028
# CONFIG_HAMRADIO is not set
1029-
# CONFIG_CAN is not set
1029+
CONFIG_CAN=y
1030+
CONFIG_CAN_RAW=y
1031+
CONFIG_CAN_BCM=y
1032+
CONFIG_CAN_GW=y
1033+
CONFIG_CAN_VCAN=y
1034+
CONFIG_CAN_VIRTIO_CAN=y
10301035
# CONFIG_BT is not set
10311036
# CONFIG_AF_RXRPC is not set
10321037
CONFIG_AF_KCM=y

config-libkrunfw_x86_64

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,12 @@ CONFIG_NET_FLOW_LIMIT=y
930930
# end of Networking options
931931

932932
# CONFIG_HAMRADIO is not set
933-
# CONFIG_CAN is not set
933+
CONFIG_CAN=y
934+
CONFIG_CAN_RAW=y
935+
CONFIG_CAN_BCM=y
936+
CONFIG_CAN_GW=y
937+
CONFIG_CAN_VCAN=y
938+
CONFIG_CAN_VIRTIO_CAN=y
934939
# CONFIG_BT is not set
935940
# CONFIG_AF_RXRPC is not set
936941
# CONFIG_AF_KCM is not set

0 commit comments

Comments
 (0)