From 7c43b32a36151b23a4a84144bfca0dade4e64ade Mon Sep 17 00:00:00 2001 From: Keiichi Watanabe Date: Tue, 28 Jan 2020 18:56:09 +0900 Subject: [PATCH] crosvm: virtio: Use larger IDs for crosvm-specific devices Stop using 30 and 31 as device IDs of virtio-wl and virtio-tpm, as these numbers were reserved for virtio-video devices in the upstream [1]. Instead, use integers from 63, which is the largest number we can use for a virtio device ID. Note that this CL must be merged after kernels with CL:2024135 landed. [1]: https://github.com/oasis-tcs/virtio-spec/issues/67 BUG=chromium:1031512 TEST=Check if /dev/wl0 exists on ARCVM with CL:2024135 Change-Id: I267c7702d3c28642492f560170a0d1d9d6523c31 Signed-off-by: Keiichi Watanabe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2025127 Reviewed-by: Chirantan Ekbote Reviewed-by: Stephen Barber Commit-Queue: Fergus Dall --- devices/src/virtio/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devices/src/virtio/mod.rs b/devices/src/virtio/mod.rs index a1701f5894..7716fe07c9 100644 --- a/devices/src/virtio/mod.rs +++ b/devices/src/virtio/mod.rs @@ -75,8 +75,9 @@ const TYPE_IOMMU: u32 = 23; const TYPE_FS: u32 = 26; const TYPE_PMEM: u32 = 27; // Additional types invented by crosvm -const TYPE_WL: u32 = 30; -const TYPE_TPM: u32 = 31; +const MAX_VIRTIO_DEVICE_ID: u32 = 63; +const TYPE_WL: u32 = MAX_VIRTIO_DEVICE_ID; +const TYPE_TPM: u32 = MAX_VIRTIO_DEVICE_ID - 1; const VIRTIO_F_VERSION_1: u32 = 32;