Pull virtio updates from Michael Tsirkin: - vdpa generic device type support - more virtio hardening for broken devices (but on the same theme, revert some virtio hotplug hardening patches - they were misusing some interrupt flags and had to be reverted) - RSS support in virtio-net - max device MTU support in mlx5 vdpa - akcipher support in virtio-crypto - shared IRQ support in ifcvf vdpa - a minor performance improvement in vhost - enable virtio mem for ARM64 - beginnings of advance dma support - cleanups, fixes all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (33 commits) vdpa/mlx5: Avoid processing works if workqueue was destroyed vhost: handle error while adding split ranges to iotlb vdpa: support exposing the count of vqs to userspace vdpa: change the type of nvqs to u32 vdpa: support exposing the config size to userspace vdpa/mlx5: re-create forwarding rules after mac modified virtio: pci: check bar values read from virtio config space Revert "virtio_pci: harden MSI-X interrupts" Revert "virtio-pci: harden INTX interrupts" drivers/net/virtio_net: Added RSS hash report control. drivers/net/virtio_net: Added RSS hash report. drivers/net/virtio_net: Added basic RSS support. drivers/net/virtio_net: Fixed padded vheader to use v1 with hash. virtio: use virtio_device_ready() in virtio_device_restore() tools/virtio: compile with -pthread tools/virtio: fix after premapped buf support virtio_ring: remove flags check for unmap packed indirect desc virtio_ring: remove flags check for unmap split indirect desc virtio_ring: rename vring_unmap_state_packed() to vring_unmap_extra_packed() net/mlx5: Add support for configuring max device MTU ...
Showing the changes to include (5 of 32 files). Show all
Unified · Split
| @@ -80,12 +80,6 @@ static inline void balloon_devinfo_init(struct balloon_dev_info *balloon) · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | #ifdef CONFIG_BALLOON_COMPACTION |
| 82 | 82 | extern const struct address_space_operations balloon_aops; |
| 83 | −extern bool balloon_page_isolate(struct page *page, | |
| 84 | − isolate_mode_t mode); | |
| 85 | −extern void balloon_page_putback(struct page *page); | |
| 86 | −extern int balloon_page_migrate(struct address_space *mapping, | |
| 87 | − struct page *newpage, | |
| 88 | − struct page *page, enum migrate_mode mode); | |
| 89 | 83 | |
| 90 | 84 | /* |
| 91 | 85 | * balloon_page_insert - insert a page into the balloon's page list and make |
| @@ -155,22 +149,6 @@ static inline void balloon_page_delete(struct page *page) · 63 unmodified lines | ||
| 155 | 149 | list_del(&page->lru); |
| 156 | 150 | } |
| 157 | 151 | |
| 158 | −static inline bool balloon_page_isolate(struct page *page) | |
| 159 | −{ | |
| 160 | − return false; | |
| 161 | −} | |
| 162 | − | |
| 163 | −static inline void balloon_page_putback(struct page *page) | |
| 164 | −{ | |
| 165 | − return; | |
| 166 | −} | |
| 167 | − | |
| 168 | −static inline int balloon_page_migrate(struct page *newpage, | |
| 169 | − struct page *page, enum migrate_mode mode) | |
| 170 | −{ | |
| 171 | − return 0; | |
| 172 | −} | |
| 173 | − | |
| 174 | 152 | static inline gfp_t balloon_mapping_gfp_mask(void) |
| 175 | 153 | { |
| 176 | 154 | return GFP_HIGHUSER; |
| @@ -83,7 +83,7 @@ struct vdpa_device { · 82 unmodified lines | ||
| 83 | 83 | unsigned int index; |
| 84 | 84 | bool features_valid; |
| 85 | 85 | bool use_va; |
| 86 | − int nvqs; | |
| 86 | + u32 nvqs; | |
| 87 | 87 | struct vdpa_mgmt_dev *mdev; |
| 88 | 88 | }; |
| 89 | 89 | |
| @@ -207,7 +207,8 @@ struct vdpa_map_file { · 117 unmodified lines | ||
| 207 | 207 | * @reset: Reset device |
| 208 | 208 | * @vdev: vdpa device |
| 209 | 209 | * Returns integer: success (0) or error (< 0) |
| 210 | − * @get_config_size: Get the size of the configuration space | |
| 210 | + * @get_config_size: Get the size of the configuration space includes | |
| 211 | + * fields that are conditional on feature bits. | |
| 211 | 212 | * @vdev: vdpa device |
| 212 | 213 | * Returns size_t: configuration size |
| 213 | 214 | * @get_config: Read from device specific configuration space |
| @@ -337,10 +338,10 @@ struct vdpa_device *__vdpa_alloc_device(struct device *parent, · 123 unmodified lines | ||
| 337 | 338 | dev_struct, member)), name, use_va), \ |
| 338 | 339 | dev_struct, member) |
| 339 | 340 | |
| 340 | −int vdpa_register_device(struct vdpa_device *vdev, int nvqs); | |
| 341 | +int vdpa_register_device(struct vdpa_device *vdev, u32 nvqs); | |
| 341 | 342 | void vdpa_unregister_device(struct vdpa_device *vdev); |
| 342 | 343 | |
| 343 | −int _vdpa_register_device(struct vdpa_device *vdev, int nvqs); | |
| 344 | +int _vdpa_register_device(struct vdpa_device *vdev, u32 nvqs); | |
| 344 | 345 | void _vdpa_unregister_device(struct vdpa_device *vdev); |
| 345 | 346 | |
| 346 | 347 | /** |
| @@ -150,4 +150,11 @@ · 149 unmodified lines | ||
| 150 | 150 | /* Get the valid iova range */ |
| 151 | 151 | #define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \ |
| 152 | 152 | struct vhost_vdpa_iova_range) |
| 153 | + | |
| 154 | +/* Get the config size */ | |
| 155 | +#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32) | |
| 156 | + | |
| 157 | +/* Get the count of all virtqueues */ | |
| 158 | +#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32) | |
| 159 | + | |
| 153 | 160 | #endif |
| @@ -82,6 +82,12 @@ · 81 unmodified lines | ||
| 82 | 82 | /* This feature indicates support for the packed virtqueue layout. */ |
| 83 | 83 | #define VIRTIO_F_RING_PACKED 34 |
| 84 | 84 | |
| 85 | +/* | |
| 86 | + * Inorder feature indicates that all buffers are used by the device | |
| 87 | + * in the same order in which they have been made available. | |
| 88 | + */ | |
| 89 | +#define VIRTIO_F_IN_ORDER 35 | |
| 90 | + | |
| 85 | 91 | /* |
| 86 | 92 | * This feature indicates that memory accesses by the driver and the |
| 87 | 93 | * device are ordered in a way described by the platform. |
| @@ -37,6 +37,7 @@ · 36 unmodified lines | ||
| 37 | 37 | #define VIRTIO_CRYPTO_SERVICE_HASH 1 |
| 38 | 38 | #define VIRTIO_CRYPTO_SERVICE_MAC 2 |
| 39 | 39 | #define VIRTIO_CRYPTO_SERVICE_AEAD 3 |
| 40 | +#define VIRTIO_CRYPTO_SERVICE_AKCIPHER 4 | |
| 40 | 41 | |
| 41 | 42 | #define VIRTIO_CRYPTO_OPCODE(service, op) (((service) << 8) | (op)) |
| 42 | 43 | |
| @@ -57,6 +58,10 @@ struct virtio_crypto_ctrl_header { · 14 unmodified lines | ||
| 57 | 58 | VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x02) |
| 58 | 59 | #define VIRTIO_CRYPTO_AEAD_DESTROY_SESSION \ |
| 59 | 60 | VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x03) |
| 61 | +#define VIRTIO_CRYPTO_AKCIPHER_CREATE_SESSION \ | |
| 62 | + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x04) | |
| 63 | +#define VIRTIO_CRYPTO_AKCIPHER_DESTROY_SESSION \ | |
| 64 | + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x05) | |
| 60 | 65 | __le32 opcode; |
| 61 | 66 | __le32 algo; |
| 62 | 67 | __le32 flag; |
| @@ -180,6 +185,58 @@ struct virtio_crypto_aead_create_session_req { · 117 unmodified lines | ||
| 180 | 185 | __u8 padding[32]; |
| 181 | 186 | }; |
| 182 | 187 | |
| 188 | +struct virtio_crypto_rsa_session_para { | |
| 189 | +#define VIRTIO_CRYPTO_RSA_RAW_PADDING 0 | |
| 190 | +#define VIRTIO_CRYPTO_RSA_PKCS1_PADDING 1 | |
| 191 | + __le32 padding_algo; | |
| 192 | + | |
| 193 | +#define VIRTIO_CRYPTO_RSA_NO_HASH 0 | |
| 194 | +#define VIRTIO_CRYPTO_RSA_MD2 1 | |
| 195 | +#define VIRTIO_CRYPTO_RSA_MD3 2 | |
| 196 | +#define VIRTIO_CRYPTO_RSA_MD4 3 | |
| 197 | +#define VIRTIO_CRYPTO_RSA_MD5 4 | |
| 198 | +#define VIRTIO_CRYPTO_RSA_SHA1 5 | |
| 199 | +#define VIRTIO_CRYPTO_RSA_SHA256 6 | |
| 200 | +#define VIRTIO_CRYPTO_RSA_SHA384 7 | |
| 201 | +#define VIRTIO_CRYPTO_RSA_SHA512 8 | |
| 202 | +#define VIRTIO_CRYPTO_RSA_SHA224 9 | |
| 203 | + __le32 hash_algo; | |
| 204 | +}; | |
| 205 | + | |
| 206 | +struct virtio_crypto_ecdsa_session_para { | |
| 207 | +#define VIRTIO_CRYPTO_CURVE_UNKNOWN 0 | |
| 208 | +#define VIRTIO_CRYPTO_CURVE_NIST_P192 1 | |
| 209 | +#define VIRTIO_CRYPTO_CURVE_NIST_P224 2 | |
| 210 | +#define VIRTIO_CRYPTO_CURVE_NIST_P256 3 | |
| 211 | +#define VIRTIO_CRYPTO_CURVE_NIST_P384 4 | |
| 212 | +#define VIRTIO_CRYPTO_CURVE_NIST_P521 5 | |
| 213 | + __le32 curve_id; | |
| 214 | + __le32 padding; | |
| 215 | +}; | |
| 216 | + | |
| 217 | +struct virtio_crypto_akcipher_session_para { | |
| 218 | +#define VIRTIO_CRYPTO_NO_AKCIPHER 0 | |
| 219 | +#define VIRTIO_CRYPTO_AKCIPHER_RSA 1 | |
| 220 | +#define VIRTIO_CRYPTO_AKCIPHER_DSA 2 | |
| 221 | +#define VIRTIO_CRYPTO_AKCIPHER_ECDSA 3 | |
| 222 | + __le32 algo; | |
| 223 | + | |
| 224 | +#define VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PUBLIC 1 | |
| 225 | +#define VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PRIVATE 2 | |
| 226 | + __le32 keytype; | |
| 227 | + __le32 keylen; | |
| 228 | + | |
| 229 | + union { | |
| 230 | + struct virtio_crypto_rsa_session_para rsa; | |
| 231 | + struct virtio_crypto_ecdsa_session_para ecdsa; | |
| 232 | + } u; | |
| 233 | +}; | |
| 234 | + | |
| 235 | +struct virtio_crypto_akcipher_create_session_req { | |
| 236 | + struct virtio_crypto_akcipher_session_para para; | |
| 237 | + __u8 padding[36]; | |
| 238 | +}; | |
| 239 | + | |
| 183 | 240 | struct virtio_crypto_alg_chain_session_para { |
| 184 | 241 | #define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_HASH_THEN_CIPHER 1 |
| 185 | 242 | #define VIRTIO_CRYPTO_SYM_ALG_CHAIN_ORDER_CIPHER_THEN_HASH 2 |
| @@ -247,6 +304,8 @@ struct virtio_crypto_op_ctrl_req { · 61 unmodified lines | ||
| 247 | 304 | mac_create_session; |
| 248 | 305 | struct virtio_crypto_aead_create_session_req |
| 249 | 306 | aead_create_session; |
| 307 | + struct virtio_crypto_akcipher_create_session_req | |
| 308 | + akcipher_create_session; | |
| 250 | 309 | struct virtio_crypto_destroy_session_req |
| 251 | 310 | destroy_session; |
| 252 | 311 | __u8 padding[56]; |
| @@ -266,6 +325,14 @@ struct virtio_crypto_op_header { · 13 unmodified lines | ||
| 266 | 325 | VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x00) |
| 267 | 326 | #define VIRTIO_CRYPTO_AEAD_DECRYPT \ |
| 268 | 327 | VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AEAD, 0x01) |
| 328 | +#define VIRTIO_CRYPTO_AKCIPHER_ENCRYPT \ | |
| 329 | + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x00) | |
| 330 | +#define VIRTIO_CRYPTO_AKCIPHER_DECRYPT \ | |
| 331 | + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x01) | |
| 332 | +#define VIRTIO_CRYPTO_AKCIPHER_SIGN \ | |
| 333 | + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x02) | |
| 334 | +#define VIRTIO_CRYPTO_AKCIPHER_VERIFY \ | |
| 335 | + VIRTIO_CRYPTO_OPCODE(VIRTIO_CRYPTO_SERVICE_AKCIPHER, 0x03) | |
| 269 | 336 | __le32 opcode; |
| 270 | 337 | /* algo should be service-specific algorithms */ |
| 271 | 338 | __le32 algo; |
| @@ -390,6 +457,16 @@ struct virtio_crypto_aead_data_req { · 118 unmodified lines | ||
| 390 | 457 | __u8 padding[32]; |
| 391 | 458 | }; |
| 392 | 459 | |
| 460 | +struct virtio_crypto_akcipher_para { | |
| 461 | + __le32 src_data_len; | |
| 462 | + __le32 dst_data_len; | |
| 463 | +}; | |
| 464 | + | |
| 465 | +struct virtio_crypto_akcipher_data_req { | |
| 466 | + struct virtio_crypto_akcipher_para para; | |
| 467 | + __u8 padding[40]; | |
| 468 | +}; | |
| 469 | + | |
| 393 | 470 | /* The request of the data virtqueue's packet */ |
| 394 | 471 | struct virtio_crypto_op_data_req { |
| 395 | 472 | struct virtio_crypto_op_header header; |
| @@ -399,6 +476,7 @@ struct virtio_crypto_op_data_req { · 3 unmodified lines | ||
| 399 | 476 | struct virtio_crypto_hash_data_req hash_req; |
| 400 | 477 | struct virtio_crypto_mac_data_req mac_req; |
| 401 | 478 | struct virtio_crypto_aead_data_req aead_req; |
| 479 | + struct virtio_crypto_akcipher_data_req akcipher_req; | |
| 402 | 480 | __u8 padding[48]; |
| 403 | 481 | } u; |
| 404 | 482 | }; |
| @@ -408,6 +486,8 @@ struct virtio_crypto_op_data_req { · 3 unmodified lines | ||
| 408 | 486 | #define VIRTIO_CRYPTO_BADMSG 2 |
| 409 | 487 | #define VIRTIO_CRYPTO_NOTSUPP 3 |
| 410 | 488 | #define VIRTIO_CRYPTO_INVSESS 4 /* Invalid session id */ |
| 489 | +#define VIRTIO_CRYPTO_NOSPC 5 /* no free session ID */ | |
| 490 | +#define VIRTIO_CRYPTO_KEY_REJECTED 6 /* Signature verification failed */ | |
| 411 | 491 | |
| 412 | 492 | /* The accelerator hardware is ready */ |
| 413 | 493 | #define VIRTIO_CRYPTO_S_HW_READY (1 << 0) |
| @@ -438,7 +518,7 @@ struct virtio_crypto_config { · 24 unmodified lines | ||
| 438 | 518 | __le32 max_cipher_key_len; |
| 439 | 519 | /* Maximum length of authenticated key */ |
| 440 | 520 | __le32 max_auth_key_len; |
| 441 | − __le32 reserve; | |
| 521 | + __le32 akcipher_algo; | |
| 442 | 522 | /* Maximum size of each crypto request's content */ |
| 443 | 523 | __le64 max_size; |
| 444 | 524 | }; |