search for: virtio_cread64

Displaying 20 results from an estimated 45 matches for "virtio_cread64".

Did you mean: virtio_cread
2017 Jan 16
2
[PATCH 2/2] virtio_scsi: Implement fc_host
On 16/01/2017 17:04, Fam Zheng wrote: > + node_name = virtio_cread64(vdev, > + offsetof(struct virtio_scsi_config, primary_wwnn)); > + port_name = virtio_cread64(vdev, > + offsetof(struct virtio_scsi_config, primary_wwpn)); > + } else { > + node_name = virtio_cread64(vdev, > + offsetof(struct virtio_scsi_config, secondary_wwnn)); > + po...
2017 Jan 16
2
[PATCH 2/2] virtio_scsi: Implement fc_host
On 16/01/2017 17:04, Fam Zheng wrote: > + node_name = virtio_cread64(vdev, > + offsetof(struct virtio_scsi_config, primary_wwnn)); > + port_name = virtio_cread64(vdev, > + offsetof(struct virtio_scsi_config, primary_wwpn)); > + } else { > + node_name = virtio_cread64(vdev, > + offsetof(struct virtio_scsi_config, secondary_wwnn)); > + po...
2017 Jan 16
0
[PATCH 2/2] virtio_scsi: Implement fc_host
On Mon, 01/16 17:45, Paolo Bonzini wrote: > > > On 16/01/2017 17:04, Fam Zheng wrote: > > + node_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, primary_wwnn)); > > + port_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config, primary_wwpn)); > > + } else { > > + node_name = virtio_cread64(vdev, > > + offsetof(struct virtio_scsi_config...
2017 Jan 16
0
[PATCH 2/2] virtio_scsi: Implement fc_host
...,15 +966,38 @@ static int virtscsi_init(struct virtio_device *vdev, return err; } +static void virtscsi_update_fc_host_attrs(struct virtio_device *vdev) +{ + struct Scsi_Host *shost = vdev->priv; + u64 node_name, port_name; + + if (virtscsi_config_get(vdev, primary_active)) { + node_name = virtio_cread64(vdev, + offsetof(struct virtio_scsi_config, primary_wwnn)); + port_name = virtio_cread64(vdev, + offsetof(struct virtio_scsi_config, primary_wwpn)); + } else { + node_name = virtio_cread64(vdev, + offsetof(struct virtio_scsi_config, secondary_wwnn)); + port_name = virtio_cread64(vdev, +...
2017 Jan 16
9
[PATCH 0/2] virtio-scsi: Implement FC_HOST feature
This series implements the proposed fc_host feature of virtio-scsi. The first patch updates the data structure changes according to the spec proposal; the second patch actually implements the operations. Fam Zheng (2): virtio_scsi: Add fc_host definitions virtio_scsi: Implement fc_host drivers/scsi/virtio_scsi.c | 55 +++++++++++++++++++++++++++++++++++++++-
2017 Jan 16
9
[PATCH 0/2] virtio-scsi: Implement FC_HOST feature
This series implements the proposed fc_host feature of virtio-scsi. The first patch updates the data structure changes according to the spec proposal; the second patch actually implements the operations. Fam Zheng (2): virtio_scsi: Add fc_host definitions virtio_scsi: Implement fc_host drivers/scsi/virtio_scsi.c | 55 +++++++++++++++++++++++++++++++++++++++-
2017 Jan 17
2
[PATCH 2/2] virtio_scsi: Implement fc_host
...ecause they are defined as "u8 x[8]" in the virtio_scsi_config struct. So you would need to read with virtio_cread_bytes and pass the result to wwn_to_u64. For example, if you have 0x500123456789abcd this would be 0x50 0x01 0x23 0x45 0x67 0x89 0xab 0cd in virtio_scsi_config, and then virtio_cread64 would read it as a little-endian u64, 0xcdab896745230150. Maybe your QEMU patch is also writing things as little-endian 64-bit integers, rather than 8-element arrays of bytes? Paolo > Maybe we should use u64 in struct virtio_scsi_config as well?
2017 Jan 17
2
[PATCH 2/2] virtio_scsi: Implement fc_host
...ecause they are defined as "u8 x[8]" in the virtio_scsi_config struct. So you would need to read with virtio_cread_bytes and pass the result to wwn_to_u64. For example, if you have 0x500123456789abcd this would be 0x50 0x01 0x23 0x45 0x67 0x89 0xab 0cd in virtio_scsi_config, and then virtio_cread64 would read it as a little-endian u64, 0xcdab896745230150. Maybe your QEMU patch is also writing things as little-endian 64-bit integers, rather than 8-element arrays of bytes? Paolo > Maybe we should use u64 in struct virtio_scsi_config as well?
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...tio_device *vdev, unsigned int offset) { - u32 ret; + u32 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio32_to_cpu(vdev, (__force __virtio32)ret); } @@ -378,7 +378,7 @@ static inline void virtio_cwrite32(struct virtio_device *vdev, static inline u64 virtio_cread64(struct virtio_device *vdev, unsigned int offset) { - u64 ret; + u64 ret = 0; __virtio_cread_many(vdev, offset, &ret, 1, sizeof(ret)); return virtio64_to_cpu(vdev, (__force __virtio64)ret); }
2017 Jan 17
0
[PATCH 2/2] virtio_scsi: Implement fc_host
..." in the > virtio_scsi_config struct. So you would need to read with > virtio_cread_bytes and pass the result to wwn_to_u64. > > For example, if you have 0x500123456789abcd this would be > > 0x50 0x01 0x23 0x45 0x67 0x89 0xab 0cd > > in virtio_scsi_config, and then virtio_cread64 would read it as a > little-endian u64, 0xcdab896745230150. Maybe your QEMU patch is also > writing things as little-endian 64-bit integers, rather than 8-element > arrays of bytes? Yes, they all used 64-bit integers in a "less surprising" endian. I think there is an endianness...
2020 Aug 05
0
[PATCH v3 23/38] virtio_config: cread/write cleanup
...unsigned int offset, u32 val) { + __virtio32 v; + might_sleep(); - val = (__force u32)cpu_to_virtio32(vdev, val); - vdev->config->set(vdev, offset, &val, sizeof(val)); + v = cpu_to_virtio32(vdev, val); + vdev->config->set(vdev, offset, &v, sizeof(v)); } static inline u64 virtio_cread64(struct virtio_device *vdev, unsigned int offset) { - u64 ret; + __virtio64 ret; + __virtio_cread_many(vdev, offset, &ret, 1, sizeof(ret)); - return virtio64_to_cpu(vdev, (__force __virtio64)ret); + return virtio64_to_cpu(vdev, ret); } static inline void virtio_cwrite64(struct virti...
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...tio_device *vdev, unsigned int offset) { - u32 ret; + u32 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio32_to_cpu(vdev, (__force __virtio32)ret); } @@ -378,7 +378,7 @@ static inline void virtio_cwrite32(struct virtio_device *vdev, static inline u64 virtio_cread64(struct virtio_device *vdev, unsigned int offset) { - u64 ret; + u64 ret = 0; __virtio_cread_many(vdev, offset, &ret, 1, sizeof(ret)); return virtio64_to_cpu(vdev, (__force __virtio64)ret); }
2014 Oct 07
0
[PATCH RFC 05/11] virtio_config: endian conversion for v1.0.
...et; + return virtio_to_cpu_u32(vdev, ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = cpu_to_virtio_u32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -250,12 +252,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio_to_cpu_u64(vdev, ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = cpu_to_virtio_u64(vdev...
2014 Oct 22
0
[PATCH RFC v2 07/16] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__force u32)cpu_to_virtio32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -283,12 +285,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio64_to_cpu(vdev, (__force __virtio64)ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = (__f...
2014 Oct 22
0
[PATCH RFC v3 07/16] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__force u32)cpu_to_virtio32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -283,12 +285,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio64_to_cpu(vdev, (__force __virtio64)ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = (__f...
2014 Nov 24
0
[PATCH v3 06/41] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__force u32)cpu_to_virtio32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -299,12 +301,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio64_to_cpu(vdev, (__force __virtio64)ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = (__f...
2014 Nov 27
0
[PATCH v5 09/45] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__force u32)cpu_to_virtio32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -299,12 +301,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio64_to_cpu(vdev, (__force __virtio64)ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = (__f...
2014 Nov 27
0
[PATCH v6 10/46] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__force u32)cpu_to_virtio32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -346,12 +348,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio64_to_cpu(vdev, (__force __virtio64)ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = (__f...
2014 Nov 30
1
[PATCH v7 10/46] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__force u32)cpu_to_virtio32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -346,12 +348,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio64_to_cpu(vdev, (__force __virtio64)ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = (__f...
2014 Dec 01
0
[PATCH v8 10/50] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__force u32)cpu_to_virtio32(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -346,12 +348,13 @@ static inline u64 virtio_cread64(struct virtio_device *vdev, { u64 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio64_to_cpu(vdev, (__force __virtio64)ret); } static inline void virtio_cwrite64(struct virtio_device *vdev, unsigned int offset, u64 val) { + val = (__f...