virtio,pci,pc: features, fixes
users can now control VM bit in smbios. vhost-user-device is now user-createable. intel_iommu now supports PRI virtio-net now supports GSO over UDP tunnel ghes now supports error injection amd iommu now supports dma remapping for vfio better error messages for virtio small fixes all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- iQFDBAABCgAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmji0s0PHG1zdEByZWRo YXQuY29tAAoJECgfDbjSjVRpuH4H/09h70IqAWZGHIWKGmmGGtdKOj3g54KuI0Ss mGECEsHvvBexOy670Qy8jdgXfaW4UuNui8BiOnJnGsBX8Y0dy+/yZori3KhkXkaY D57Ap9agkpHem7Vw0zgNsAF2bzDdlzTiQ6ns5oDnSq8yt82onCb5WGkWTGkPs/jL Gf8Jv+Ddcpt5SU4/hHPYC8pUhl7z4xPOOyl0Qp1GG21Pxf5v4sGFcWuGGB7UEPSQ MjZeoM0rSnLDtNg18sGwD5RPLQs13TbtgsVwijI79c3w3rcSpPNhGR5OWkdRCIYF 8A0Nhq0Yfo0ogTht7yt1QNPf/ktJkuoBuGVirvpDaix2tCBECes= =Zvq/ -----END PGP SIGNATURE----- Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging virtio,pci,pc: features, fixes users can now control VM bit in smbios. vhost-user-device is now user-createable. intel_iommu now supports PRI virtio-net now supports GSO over UDP tunnel ghes now supports error injection amd iommu now supports dma remapping for vfio better error messages for virtio small fixes all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # -----BEGIN PGP SIGNATURE----- # # iQFDBAABCgAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmji0s0PHG1zdEByZWRo # YXQuY29tAAoJECgfDbjSjVRpuH4H/09h70IqAWZGHIWKGmmGGtdKOj3g54KuI0Ss # mGECEsHvvBexOy670Qy8jdgXfaW4UuNui8BiOnJnGsBX8Y0dy+/yZori3KhkXkaY # D57Ap9agkpHem7Vw0zgNsAF2bzDdlzTiQ6ns5oDnSq8yt82onCb5WGkWTGkPs/jL # Gf8Jv+Ddcpt5SU4/hHPYC8pUhl7z4xPOOyl0Qp1GG21Pxf5v4sGFcWuGGB7UEPSQ # MjZeoM0rSnLDtNg18sGwD5RPLQs13TbtgsVwijI79c3w3rcSpPNhGR5OWkdRCIYF # 8A0Nhq0Yfo0ogTht7yt1QNPf/ktJkuoBuGVirvpDaix2tCBECes= # =Zvq/ # -----END PGP SIGNATURE----- # gpg: Signature made Sun 05 Oct 2025 01:19:25 PM PDT # gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469 # gpg: issuer "mst@redhat.com" # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [unknown] # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [unknown] # gpg: WARNING: The key's User ID is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu: (75 commits) virtio: improve virtqueue mapping error messages pci: Fix wrong parameter passing to pci_device_get_iommu_bus_devfn() intel_iommu: Simplify caching mode check with VFIO device intel_iommu: Enable Enhanced Set Root Table Pointer Support (ESRTPS) vdpa-dev: add get_vhost() callback for vhost-vdpa device amd_iommu: HATDis/HATS=11 support intel-iommu: Move dma_translation to x86-iommu amd_iommu: Refactor amdvi_page_walk() to use common code for page walk amd_iommu: Do not assume passthrough translation when DTE[TV]=0 amd_iommu: Toggle address translation mode on devtab entry invalidation amd_iommu: Add dma-remap property to AMD vIOMMU device amd_iommu: Set all address spaces to use passthrough mode on reset amd_iommu: Toggle memory regions based on address translation mode amd_iommu: Invalidate address translations on INVALIDATE_IOMMU_ALL amd_iommu: Add replay callback amd_iommu: Unmap all address spaces under the AMD IOMMU on reset amd_iommu: Use iova_tree records to determine large page size on UNMAP amd_iommu: Sync shadow page tables on page invalidation amd_iommu: Add basic structure to support IOMMU notifier updates amd_iommu: Add a page walker to sync shadow page tables on invalidation ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
92a0dcbd75
138 changed files with 4512 additions and 722 deletions
17
net/net.c
17
net/net.c
|
|
@ -522,6 +522,15 @@ bool qemu_has_uso(NetClientState *nc)
|
|||
return nc->info->has_uso(nc);
|
||||
}
|
||||
|
||||
bool qemu_has_tunnel(NetClientState *nc)
|
||||
{
|
||||
if (!nc || !nc->info->has_tunnel) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return nc->info->has_tunnel(nc);
|
||||
}
|
||||
|
||||
bool qemu_has_vnet_hdr(NetClientState *nc)
|
||||
{
|
||||
if (!nc || !nc->info->has_vnet_hdr) {
|
||||
|
|
@ -540,14 +549,13 @@ bool qemu_has_vnet_hdr_len(NetClientState *nc, int len)
|
|||
return nc->info->has_vnet_hdr_len(nc, len);
|
||||
}
|
||||
|
||||
void qemu_set_offload(NetClientState *nc, int csum, int tso4, int tso6,
|
||||
int ecn, int ufo, int uso4, int uso6)
|
||||
void qemu_set_offload(NetClientState *nc, const NetOffloads *ol)
|
||||
{
|
||||
if (!nc || !nc->info->set_offload) {
|
||||
return;
|
||||
}
|
||||
|
||||
nc->info->set_offload(nc, csum, tso4, tso6, ecn, ufo, uso4, uso6);
|
||||
nc->info->set_offload(nc, ol);
|
||||
}
|
||||
|
||||
int qemu_get_vnet_hdr_len(NetClientState *nc)
|
||||
|
|
@ -567,7 +575,8 @@ void qemu_set_vnet_hdr_len(NetClientState *nc, int len)
|
|||
|
||||
assert(len == sizeof(struct virtio_net_hdr_mrg_rxbuf) ||
|
||||
len == sizeof(struct virtio_net_hdr) ||
|
||||
len == sizeof(struct virtio_net_hdr_v1_hash));
|
||||
len == sizeof(struct virtio_net_hdr_v1_hash) ||
|
||||
len == sizeof(struct virtio_net_hdr_v1_hash_tunnel));
|
||||
|
||||
nc->vnet_hdr_len = len;
|
||||
nc->info->set_vnet_hdr_len(nc, len);
|
||||
|
|
|
|||
|
|
@ -366,8 +366,7 @@ static void netmap_set_vnet_hdr_len(NetClientState *nc, int len)
|
|||
}
|
||||
}
|
||||
|
||||
static void netmap_set_offload(NetClientState *nc, int csum, int tso4, int tso6,
|
||||
int ecn, int ufo, int uso4, int uso6)
|
||||
static void netmap_set_offload(NetClientState *nc, const NetOffloads *ol)
|
||||
{
|
||||
NetmapState *s = DO_UPCAST(NetmapState, nc, nc);
|
||||
|
||||
|
|
|
|||
|
|
@ -225,6 +225,11 @@ int tap_probe_has_uso(int fd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool tap_probe_has_tunnel(int fd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||
{
|
||||
}
|
||||
|
|
@ -239,8 +244,7 @@ int tap_fd_set_vnet_be(int fd, int is_be)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
void tap_fd_set_offload(int fd, int csum, int tso4,
|
||||
int tso6, int ecn, int ufo, int uso4, int uso6)
|
||||
void tap_fd_set_offload(int fd, const NetOffloads *ol)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -201,6 +201,17 @@ int tap_probe_has_uso(int fd)
|
|||
return 1;
|
||||
}
|
||||
|
||||
bool tap_probe_has_tunnel(int fd)
|
||||
{
|
||||
unsigned offload;
|
||||
|
||||
offload = TUN_F_CSUM | TUN_F_TSO4 | TUN_F_UDP_TUNNEL_GSO;
|
||||
if (ioctl(fd, TUNSETOFFLOAD, offload) < 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||
{
|
||||
if (ioctl(fd, TUNSETVNETHDRSZ, &len) == -1) {
|
||||
|
|
@ -244,8 +255,7 @@ int tap_fd_set_vnet_be(int fd, int is_be)
|
|||
abort();
|
||||
}
|
||||
|
||||
void tap_fd_set_offload(int fd, int csum, int tso4,
|
||||
int tso6, int ecn, int ufo, int uso4, int uso6)
|
||||
void tap_fd_set_offload(int fd, const NetOffloads *ol)
|
||||
{
|
||||
unsigned int offload = 0;
|
||||
|
||||
|
|
@ -254,22 +264,32 @@ void tap_fd_set_offload(int fd, int csum, int tso4,
|
|||
return;
|
||||
}
|
||||
|
||||
if (csum) {
|
||||
if (ol->csum) {
|
||||
offload |= TUN_F_CSUM;
|
||||
if (tso4)
|
||||
if (ol->tso4) {
|
||||
offload |= TUN_F_TSO4;
|
||||
if (tso6)
|
||||
}
|
||||
if (ol->tso6) {
|
||||
offload |= TUN_F_TSO6;
|
||||
if ((tso4 || tso6) && ecn)
|
||||
}
|
||||
if ((ol->tso4 || ol->tso6) && ol->ecn) {
|
||||
offload |= TUN_F_TSO_ECN;
|
||||
if (ufo)
|
||||
}
|
||||
if (ol->ufo) {
|
||||
offload |= TUN_F_UFO;
|
||||
if (uso4) {
|
||||
}
|
||||
if (ol->uso4) {
|
||||
offload |= TUN_F_USO4;
|
||||
}
|
||||
if (uso6) {
|
||||
if (ol->uso6) {
|
||||
offload |= TUN_F_USO6;
|
||||
}
|
||||
if (ol->tnl) {
|
||||
offload |= TUN_F_UDP_TUNNEL_GSO;
|
||||
}
|
||||
if (ol->tnl_csum) {
|
||||
offload |= TUN_F_UDP_TUNNEL_GSO_CSUM;
|
||||
}
|
||||
}
|
||||
|
||||
if (ioctl(fd, TUNSETOFFLOAD, offload) != 0) {
|
||||
|
|
|
|||
|
|
@ -53,4 +53,13 @@
|
|||
#define TUN_F_USO4 0x20 /* I can handle USO for IPv4 packets */
|
||||
#define TUN_F_USO6 0x40 /* I can handle USO for IPv6 packets */
|
||||
|
||||
/* I can handle TSO/USO for UDP tunneled packets */
|
||||
#define TUN_F_UDP_TUNNEL_GSO 0x080
|
||||
|
||||
/*
|
||||
* I can handle TSO/USO for UDP tunneled packets requiring csum offload for
|
||||
* the outer header
|
||||
*/
|
||||
#define TUN_F_UDP_TUNNEL_GSO_CSUM 0x100
|
||||
|
||||
#endif /* QEMU_TAP_LINUX_H */
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "tap_int.h"
|
||||
#include "qemu/ctype.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "net/net.h"
|
||||
|
||||
#include <sys/ethernet.h>
|
||||
#include <sys/sockio.h>
|
||||
|
|
@ -226,6 +227,11 @@ int tap_probe_has_uso(int fd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool tap_probe_has_tunnel(int fd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||
{
|
||||
}
|
||||
|
|
@ -240,8 +246,7 @@ int tap_fd_set_vnet_be(int fd, int is_be)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
void tap_fd_set_offload(int fd, int csum, int tso4,
|
||||
int tso6, int ecn, int ufo, int uso4, int uso6)
|
||||
void tap_fd_set_offload(int fd, const NetOffloads *ol)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ int tap_probe_has_uso(int fd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool tap_probe_has_tunnel(int fd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void tap_fd_set_vnet_hdr_len(int fd, int len)
|
||||
{
|
||||
}
|
||||
|
|
@ -66,8 +71,7 @@ int tap_fd_set_vnet_be(int fd, int is_be)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
void tap_fd_set_offload(int fd, int csum, int tso4,
|
||||
int tso6, int ecn, int ufo, int uso4, int uso6)
|
||||
void tap_fd_set_offload(int fd, const NetOffloads *ol)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
21
net/tap.c
21
net/tap.c
|
|
@ -62,6 +62,8 @@ static const int kernel_feature_bits[] = {
|
|||
VIRTIO_F_NOTIFICATION_DATA,
|
||||
VIRTIO_NET_F_RSC_EXT,
|
||||
VIRTIO_NET_F_HASH_REPORT,
|
||||
VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO,
|
||||
VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO,
|
||||
VHOST_INVALID_FEATURE_BIT
|
||||
};
|
||||
|
||||
|
|
@ -76,6 +78,7 @@ typedef struct TAPState {
|
|||
bool using_vnet_hdr;
|
||||
bool has_ufo;
|
||||
bool has_uso;
|
||||
bool has_tunnel;
|
||||
bool enabled;
|
||||
VHostNetState *vhost_net;
|
||||
unsigned host_vnet_hdr_len;
|
||||
|
|
@ -246,6 +249,14 @@ static bool tap_has_uso(NetClientState *nc)
|
|||
return s->has_uso;
|
||||
}
|
||||
|
||||
static bool tap_has_tunnel(NetClientState *nc)
|
||||
{
|
||||
TAPState *s = DO_UPCAST(TAPState, nc, nc);
|
||||
|
||||
assert(nc->info->type == NET_CLIENT_DRIVER_TAP);
|
||||
return s->has_tunnel;
|
||||
}
|
||||
|
||||
static bool tap_has_vnet_hdr(NetClientState *nc)
|
||||
{
|
||||
TAPState *s = DO_UPCAST(TAPState, nc, nc);
|
||||
|
|
@ -285,15 +296,14 @@ static int tap_set_vnet_be(NetClientState *nc, bool is_be)
|
|||
return tap_fd_set_vnet_be(s->fd, is_be);
|
||||
}
|
||||
|
||||
static void tap_set_offload(NetClientState *nc, int csum, int tso4,
|
||||
int tso6, int ecn, int ufo, int uso4, int uso6)
|
||||
static void tap_set_offload(NetClientState *nc, const NetOffloads *ol)
|
||||
{
|
||||
TAPState *s = DO_UPCAST(TAPState, nc, nc);
|
||||
if (s->fd < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
tap_fd_set_offload(s->fd, csum, tso4, tso6, ecn, ufo, uso4, uso6);
|
||||
tap_fd_set_offload(s->fd, ol);
|
||||
}
|
||||
|
||||
static void tap_exit_notify(Notifier *notifier, void *data)
|
||||
|
|
@ -375,6 +385,7 @@ static NetClientInfo net_tap_info = {
|
|||
.cleanup = tap_cleanup,
|
||||
.has_ufo = tap_has_ufo,
|
||||
.has_uso = tap_has_uso,
|
||||
.has_tunnel = tap_has_tunnel,
|
||||
.has_vnet_hdr = tap_has_vnet_hdr,
|
||||
.has_vnet_hdr_len = tap_has_vnet_hdr_len,
|
||||
.set_offload = tap_set_offload,
|
||||
|
|
@ -391,6 +402,7 @@ static TAPState *net_tap_fd_init(NetClientState *peer,
|
|||
int fd,
|
||||
int vnet_hdr)
|
||||
{
|
||||
NetOffloads ol = {};
|
||||
NetClientState *nc;
|
||||
TAPState *s;
|
||||
|
||||
|
|
@ -403,8 +415,9 @@ static TAPState *net_tap_fd_init(NetClientState *peer,
|
|||
s->using_vnet_hdr = false;
|
||||
s->has_ufo = tap_probe_has_ufo(s->fd);
|
||||
s->has_uso = tap_probe_has_uso(s->fd);
|
||||
s->has_tunnel = tap_probe_has_tunnel(s->fd);
|
||||
s->enabled = true;
|
||||
tap_set_offload(&s->nc, 0, 0, 0, 0, 0, 0, 0);
|
||||
tap_set_offload(&s->nc, &ol);
|
||||
/*
|
||||
* Make sure host header length is set correctly in tap:
|
||||
* it might have been modified by another instance of qemu.
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#define NET_TAP_INT_H
|
||||
|
||||
#include "qapi/qapi-types-net.h"
|
||||
#include "net/net.h"
|
||||
|
||||
int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
|
||||
int vnet_hdr_required, int mq_required, Error **errp);
|
||||
|
|
@ -37,8 +38,8 @@ void tap_set_sndbuf(int fd, const NetdevTapOptions *tap, Error **errp);
|
|||
int tap_probe_vnet_hdr(int fd, Error **errp);
|
||||
int tap_probe_has_ufo(int fd);
|
||||
int tap_probe_has_uso(int fd);
|
||||
void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo,
|
||||
int uso4, int uso6);
|
||||
bool tap_probe_has_tunnel(int fd);
|
||||
void tap_fd_set_offload(int fd, const NetOffloads *ol);
|
||||
void tap_fd_set_vnet_hdr_len(int fd, int len);
|
||||
int tap_fd_set_vnet_le(int fd, int vnet_is_le);
|
||||
int tap_fd_set_vnet_be(int fd, int vnet_is_be);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue