Displaying 20 results from an estimated 166 matches for "virtio_cwrite".
2016 Nov 28
3
[virtio-dev] Re: [PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
...4:10:22PM +0800, Gonglei wrote:
> > > Virtio modern devices are always little edian, let's introduce
> > > the LE functions for read/write configuration space for
> > > virtio modern devices, which avoid complaint by Sparse when
> > > we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices.
> > >
> > > Signed-off-by: Gonglei <arei.gonglei at huawei.com>
> > > ---
> > > include/linux/virtio_config.h | 45
> > +++++++++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 45 insertions(+)
> > >
&g...
2016 Nov 28
3
[virtio-dev] Re: [PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
...4:10:22PM +0800, Gonglei wrote:
> > > Virtio modern devices are always little edian, let's introduce
> > > the LE functions for read/write configuration space for
> > > virtio modern devices, which avoid complaint by Sparse when
> > > we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices.
> > >
> > > Signed-off-by: Gonglei <arei.gonglei at huawei.com>
> > > ---
> > > include/linux/virtio_config.h | 45
> > +++++++++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 45 insertions(+)
> > >
&g...
2016 Nov 27
2
[PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
On Tue, Nov 22, 2016 at 04:10:22PM +0800, Gonglei wrote:
> Virtio modern devices are always little edian, let's introduce
> the LE functions for read/write configuration space for
> virtio modern devices, which avoid complaint by Sparse when
> we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices.
>
> Signed-off-by: Gonglei <arei.gonglei at huawei.com>
> ---
> include/linux/virtio_config.h | 45 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/include/linux/virtio_config.h b/include/linux/virtio...
2016 Nov 27
2
[PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
On Tue, Nov 22, 2016 at 04:10:22PM +0800, Gonglei wrote:
> Virtio modern devices are always little edian, let's introduce
> the LE functions for read/write configuration space for
> virtio modern devices, which avoid complaint by Sparse when
> we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices.
>
> Signed-off-by: Gonglei <arei.gonglei at huawei.com>
> ---
> include/linux/virtio_config.h | 45 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/include/linux/virtio_config.h b/include/linux/virtio...
2015 Mar 31
2
[PATCH v2 1/6] virtio_balloon: transitional interface
...ize(struct virtio_balloon *vb)
{
- __le32 actual = cpu_to_le32(vb->num_pages);
+ u32 actual = vb->num_pages;
+
+ /* Legacy balloon config space is LE, unlike all other devices. */
+ if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
+ actual = (__force u32)cpu_to_le32(num_pages);
- virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
- &actual);
+ virtio_cwrite(vb->vdev, struct virtio_balloon_config,
+ actual, &actual);
}
/*
--
MST
2015 Mar 31
2
[PATCH v2 1/6] virtio_balloon: transitional interface
...ize(struct virtio_balloon *vb)
{
- __le32 actual = cpu_to_le32(vb->num_pages);
+ u32 actual = vb->num_pages;
+
+ /* Legacy balloon config space is LE, unlike all other devices. */
+ if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
+ actual = (__force u32)cpu_to_le32(num_pages);
- virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
- &actual);
+ virtio_cwrite(vb->vdev, struct virtio_balloon_config,
+ actual, &actual);
}
/*
--
MST
2016 Nov 28
0
[virtio-dev] Re: [PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
...e, Nov 22, 2016 at 04:10:22PM +0800, Gonglei wrote:
> > Virtio modern devices are always little edian, let's introduce
> > the LE functions for read/write configuration space for
> > virtio modern devices, which avoid complaint by Sparse when
> > we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices.
> >
> > Signed-off-by: Gonglei <arei.gonglei at huawei.com>
> > ---
> > include/linux/virtio_config.h | 45
> +++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 45 insertions(+)
> >
> > diff --git a/include/linux/...
2020 Jul 12
2
[PATCH] virtio_balloon: clear modern features under legacy
...d update_balloon_size(struct virtio_balloon *vb)
{
u32 actual = vb->num_pages;
/* Legacy balloon config space is LE, unlike all other devices. */
if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
actual = (__force u32)cpu_to_le32(actual);
virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
&actual);
}
this is LE even without VIRTIO_F_VERSION_1, so matches spec.
/* Start with poison val of 0 representing general init */
__u32 poison_val = 0;
/*...
2020 Jul 12
2
[PATCH] virtio_balloon: clear modern features under legacy
...d update_balloon_size(struct virtio_balloon *vb)
{
u32 actual = vb->num_pages;
/* Legacy balloon config space is LE, unlike all other devices. */
if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
actual = (__force u32)cpu_to_le32(actual);
virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
&actual);
}
this is LE even without VIRTIO_F_VERSION_1, so matches spec.
/* Start with poison val of 0 representing general init */
__u32 poison_val = 0;
/*...
2016 Nov 28
0
[virtio-dev] Re: [PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family
...glei wrote:
> > > > Virtio modern devices are always little edian, let's introduce
> > > > the LE functions for read/write configuration space for
> > > > virtio modern devices, which avoid complaint by Sparse when
> > > > we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices.
> > > >
> > > > Signed-off-by: Gonglei <arei.gonglei at huawei.com>
> > > > ---
> > > > include/linux/virtio_config.h | 45
> > > +++++++++++++++++++++++++++++++++++++++++++
> > > > 1 file changed, 45 i...
2020 Mar 10
2
[PATCH v2] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
....
Can add one.
>
>> if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON)) {
>> /* Start with poison val of 0 representing general init */
>> __u32 poison_val = 0;
>> @@ -986,15 +980,6 @@ static int virtballoon_probe(struct virtio_device *vdev)
>> virtio_cwrite(vb->vdev, struct virtio_balloon_config,
>> poison_val, &poison_val);
>> }
>> - /*
>> - * We continue to use VIRTIO_BALLOON_F_DEFLATE_ON_OOM to decide if a
>> - * shrinker needs to be registered to relieve memory pressure.
>> - */
>> -...
2020 Mar 10
2
[PATCH v2] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
....
Can add one.
>
>> if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_PAGE_POISON)) {
>> /* Start with poison val of 0 representing general init */
>> __u32 poison_val = 0;
>> @@ -986,15 +980,6 @@ static int virtballoon_probe(struct virtio_device *vdev)
>> virtio_cwrite(vb->vdev, struct virtio_balloon_config,
>> poison_val, &poison_val);
>> }
>> - /*
>> - * We continue to use VIRTIO_BALLOON_F_DEFLATE_ON_OOM to decide if a
>> - * shrinker needs to be registered to relieve memory pressure.
>> - */
>> -...
2015 Apr 01
0
[PATCH v2 1/6] virtio_balloon: transitional interface
...__le32 actual = cpu_to_le32(vb->num_pages);
> + u32 actual = vb->num_pages;
> +
> + /* Legacy balloon config space is LE, unlike all other devices. */
> + if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
> + actual = (__force u32)cpu_to_le32(num_pages);
>
> - virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
> - &actual);
> + virtio_cwrite(vb->vdev, struct virtio_balloon_config,
> + actual, &actual);
> }
Final line is gratitous reformatting.
I would leave the device *exactly* as is, ugly structure packing and
all...
2019 Jan 03
1
[PATCH 2/2] virtio: document virtio_config_ops restrictions
...atus, or @get_features/
> + * @finalize_features are NOT safe to be called from an atomic
> + * context.
> * @get: read the value of a configuration field
> * vdev: the virtio_device
> * offset: the offset of the configuration field
Then might_sleep in virtio_cread/virtio_cwrite and
friends would be appropriate? I guess we'll need to fix
balloon first.
> --
> 2.17.2
2020 Aug 05
0
[PATCH v3 29/38] virtio_balloon: use LE config space accesses
...ages;
@@ -462,11 +459,8 @@ static void update_balloon_size(struct virtio_balloon *vb)
u32 actual = vb->num_pages;
/* Legacy balloon config space is LE, unlike all other devices. */
- if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
- actual = (__force u32)cpu_to_le32(actual);
-
- virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
- &actual);
+ virtio_cwrite_le(vb->vdev, struct virtio_balloon_config, actual,
+ &actual);
}
static void update_balloon_stats_func(struct work_struct *work)
@@ -579,12 +573,10 @@ static u32 virtio_balloon_cmd_id_received(st...
2020 Aug 05
1
[PATCH v3 30/38] virtio_input: convert to LE accessors
..., 16 deletions(-)
diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
index efaf65b0f42d..877b2ea3ed05 100644
--- a/drivers/virtio/virtio_input.c
+++ b/drivers/virtio/virtio_input.c
@@ -113,9 +113,9 @@ static u8 virtinput_cfg_select(struct virtio_input *vi,
{
u8 size;
- virtio_cwrite(vi->vdev, struct virtio_input_config, select, &select);
- virtio_cwrite(vi->vdev, struct virtio_input_config, subsel, &subsel);
- virtio_cread(vi->vdev, struct virtio_input_config, size, &size);
+ virtio_cwrite_le(vi->vdev, struct virtio_input_config, select, &select);
+...
2020 Aug 04
1
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
...l S. Tsirkin" <mst at redhat.com> wrote:
> Currently all config space fields are of the type __uXX.
> This confuses people and some drivers (notably vdpa)
> access them using CPU endian-ness - which only
> works well for legacy or LE platforms.
>
> Update virtio_cread/virtio_cwrite macros to allow __virtioXX
> and __leXX field types. Follow-up patches will convert
> config space to use these types.
>
> Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
> ---
> include/linux/virtio_config.h | 50 +++++++++++++++++++++++++++++++++--
> 1 file chan...
2020 Jul 13
0
[PATCH] virtio_balloon: clear modern features under legacy
...lloon *vb)
> {
> u32 actual = vb->num_pages;
>
> /* Legacy balloon config space is LE, unlike all other devices. */
> if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
> actual = (__force u32)cpu_to_le32(actual);
>
> virtio_cwrite(vb->vdev, struct virtio_balloon_config, actual,
> &actual);
> }
>
>
> this is LE even without VIRTIO_F_VERSION_1, so matches spec.
>
> /* Start with poison val of 0 representing general init */
> __u32 poison_val =...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
On 2020/8/4 ??4:58, Michael S. Tsirkin wrote:
> Currently all config space fields are of the type __uXX.
> This confuses people and some drivers (notably vdpa)
> access them using CPU endian-ness - which only
> works well for legacy or LE platforms.
>
> Update virtio_cread/virtio_cwrite macros to allow __virtioXX
> and __leXX field types. Follow-up patches will convert
> config space to use these types.
>
> Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
> ---
> include/linux/virtio_config.h | 50 +++++++++++++++++++++++++++++++++--
> 1 file cha...
2020 Aug 05
2
[PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space
On 2020/8/4 ??4:58, Michael S. Tsirkin wrote:
> Currently all config space fields are of the type __uXX.
> This confuses people and some drivers (notably vdpa)
> access them using CPU endian-ness - which only
> works well for legacy or LE platforms.
>
> Update virtio_cread/virtio_cwrite macros to allow __virtioXX
> and __leXX field types. Follow-up patches will convert
> config space to use these types.
>
> Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
> ---
> include/linux/virtio_config.h | 50 +++++++++++++++++++++++++++++++++--
> 1 file cha...