* [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers.
@ 2013-11-25 14:56 Greg Kurz
2014-02-11 2:11 ` Alexey Kardashevskiy
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2013-11-25 14:56 UTC (permalink / raw)
To: rusty; +Cc: marc.zyngier, qemu-devel
Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
hw/9pfs/virtio-9p-device.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index f0ffbe8..72ef60a 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -19,6 +19,7 @@
#include "fsdev/qemu-fsdev.h"
#include "virtio-9p-xattr.h"
#include "virtio-9p-coth.h"
+#include "hw/virtio/virtio-access.h"
static uint32_t virtio_9p_get_features(VirtIODevice *vdev, uint32_t features)
{
@@ -34,7 +35,7 @@ static void virtio_9p_get_config(VirtIODevice *vdev, uint8_t *config)
len = strlen(s->tag);
cfg = g_malloc0(sizeof(struct virtio_9p_config) + len);
- stw_raw(&cfg->tag_len, len);
+ virtio_stw_p(&cfg->tag_len, len);
/* We don't copy the terminating null to config space */
memcpy(cfg->tag, s->tag, len);
memcpy(config, cfg, s->config_size);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers.
2013-11-25 14:56 [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers Greg Kurz
@ 2014-02-11 2:11 ` Alexey Kardashevskiy
0 siblings, 0 replies; 4+ messages in thread
From: Alexey Kardashevskiy @ 2014-02-11 2:11 UTC (permalink / raw)
To: Greg Kurz; +Cc: marc.zyngier, Rusty Russell, QEMU Developers
[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]
Is anyone going to pull this series anywhere? Thanks!
On Tue, Nov 26, 2013 at 1:56 AM, Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p.
>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> ---
> hw/9pfs/virtio-9p-device.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
> index f0ffbe8..72ef60a 100644
> --- a/hw/9pfs/virtio-9p-device.c
> +++ b/hw/9pfs/virtio-9p-device.c
> @@ -19,6 +19,7 @@
> #include "fsdev/qemu-fsdev.h"
> #include "virtio-9p-xattr.h"
> #include "virtio-9p-coth.h"
> +#include "hw/virtio/virtio-access.h"
>
> static uint32_t virtio_9p_get_features(VirtIODevice *vdev, uint32_t
> features)
> {
> @@ -34,7 +35,7 @@ static void virtio_9p_get_config(VirtIODevice *vdev,
> uint8_t *config)
>
> len = strlen(s->tag);
> cfg = g_malloc0(sizeof(struct virtio_9p_config) + len);
> - stw_raw(&cfg->tag_len, len);
> + virtio_stw_p(&cfg->tag_len, len);
> /* We don't copy the terminating null to config space */
> memcpy(cfg->tag, s->tag, len);
> memcpy(config, cfg, s->config_size);
>
>
>
--
--
Alexey
[-- Attachment #2: Type: text/html, Size: 1766 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 3/8] virtio: allow byte swapping for vring and config access
@ 2013-08-12 7:59 Rusty Russell
2013-09-09 12:44 ` [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers Greg Kurz
0 siblings, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2013-08-12 7:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Rusty Russell
This is based on a simpler patch by Anthony Liguouri, which only handled
the vring accesses. We also need some drivers to access these helpers,
eg. for data which contains headers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
hw/virtio/virtio.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 09f62c6..178647b 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -18,6 +18,7 @@
#include "hw/virtio/virtio.h"
#include "qemu/atomic.h"
#include "hw/virtio/virtio-bus.h"
+#include "hw/virtio/virtio-access.h"
/*
* The alignment to use between consumer and producer parts of vring.
@@ -104,49 +105,49 @@ static inline uint64_t vring_desc_addr(hwaddr desc_pa, int i)
{
hwaddr pa;
pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, addr);
- return ldq_phys(pa);
+ return virtio_ldq_phys(pa);
}
static inline uint32_t vring_desc_len(hwaddr desc_pa, int i)
{
hwaddr pa;
pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, len);
- return ldl_phys(pa);
+ return virtio_ldl_phys(pa);
}
static inline uint16_t vring_desc_flags(hwaddr desc_pa, int i)
{
hwaddr pa;
pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, flags);
- return lduw_phys(pa);
+ return virtio_lduw_phys(pa);
}
static inline uint16_t vring_desc_next(hwaddr desc_pa, int i)
{
hwaddr pa;
pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, next);
- return lduw_phys(pa);
+ return virtio_lduw_phys(pa);
}
static inline uint16_t vring_avail_flags(VirtQueue *vq)
{
hwaddr pa;
pa = vq->vring.avail + offsetof(VRingAvail, flags);
- return lduw_phys(pa);
+ return virtio_lduw_phys(pa);
}
static inline uint16_t vring_avail_idx(VirtQueue *vq)
{
hwaddr pa;
pa = vq->vring.avail + offsetof(VRingAvail, idx);
- return lduw_phys(pa);
+ return virtio_lduw_phys(pa);
}
static inline uint16_t vring_avail_ring(VirtQueue *vq, int i)
{
hwaddr pa;
pa = vq->vring.avail + offsetof(VRingAvail, ring[i]);
- return lduw_phys(pa);
+ return virtio_lduw_phys(pa);
}
static inline uint16_t vring_used_event(VirtQueue *vq)
@@ -158,42 +159,42 @@ static inline void vring_used_ring_id(VirtQueue *vq, int i, uint32_t val)
{
hwaddr pa;
pa = vq->vring.used + offsetof(VRingUsed, ring[i].id);
- stl_phys(pa, val);
+ virtio_stl_phys(pa, val);
}
static inline void vring_used_ring_len(VirtQueue *vq, int i, uint32_t val)
{
hwaddr pa;
pa = vq->vring.used + offsetof(VRingUsed, ring[i].len);
- stl_phys(pa, val);
+ virtio_stl_phys(pa, val);
}
static uint16_t vring_used_idx(VirtQueue *vq)
{
hwaddr pa;
pa = vq->vring.used + offsetof(VRingUsed, idx);
- return lduw_phys(pa);
+ return virtio_lduw_phys(pa);
}
static inline void vring_used_idx_set(VirtQueue *vq, uint16_t val)
{
hwaddr pa;
pa = vq->vring.used + offsetof(VRingUsed, idx);
- stw_phys(pa, val);
+ virtio_stw_phys(pa, val);
}
static inline void vring_used_flags_set_bit(VirtQueue *vq, int mask)
{
hwaddr pa;
pa = vq->vring.used + offsetof(VRingUsed, flags);
- stw_phys(pa, lduw_phys(pa) | mask);
+ virtio_stw_phys(pa, virtio_lduw_phys(pa) | mask);
}
static inline void vring_used_flags_unset_bit(VirtQueue *vq, int mask)
{
hwaddr pa;
pa = vq->vring.used + offsetof(VRingUsed, flags);
- stw_phys(pa, lduw_phys(pa) & ~mask);
+ virtio_stw_phys(pa, virtio_lduw_phys(pa) & ~mask);
}
static inline void vring_avail_event(VirtQueue *vq, uint16_t val)
@@ -203,7 +204,7 @@ static inline void vring_avail_event(VirtQueue *vq, uint16_t val)
return;
}
pa = vq->vring.used + offsetof(VRingUsed, ring[vq->vring.num]);
- stw_phys(pa, val);
+ virtio_stw_phys(pa, val);
}
void virtio_queue_set_notification(VirtQueue *vq, int enable)
--
1.8.1.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers.
2013-08-12 7:59 [Qemu-devel] [PATCH 3/8] virtio: allow byte swapping for vring and config access Rusty Russell
@ 2013-09-09 12:44 ` Greg Kurz
2013-09-10 5:21 ` Rusty Russell
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2013-09-09 12:44 UTC (permalink / raw)
To: qemu-devel; +Cc: rusty
Follow-up to Rusty's virtio endianness serie: enough to get a working
virtfs mount.
Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
hw/9pfs/virtio-9p-device.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
index f0ffbe8..bc2d0da 100644
--- a/hw/9pfs/virtio-9p-device.c
+++ b/hw/9pfs/virtio-9p-device.c
@@ -19,6 +19,7 @@
#include "fsdev/qemu-fsdev.h"
#include "virtio-9p-xattr.h"
#include "virtio-9p-coth.h"
+#include "hw/virtio/virtio-access.h"
static uint32_t virtio_9p_get_features(VirtIODevice *vdev, uint32_t features)
{
@@ -34,7 +35,7 @@ static void virtio_9p_get_config(VirtIODevice *vdev, uint8_t *config)
len = strlen(s->tag);
cfg = g_malloc0(sizeof(struct virtio_9p_config) + len);
- stw_raw(&cfg->tag_len, len);
+ virtio_stl_p(&cfg->tag_len, len);
/* We don't copy the terminating null to config space */
memcpy(cfg->tag, s->tag, len);
memcpy(config, cfg, s->config_size);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers.
2013-09-09 12:44 ` [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers Greg Kurz
@ 2013-09-10 5:21 ` Rusty Russell
0 siblings, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2013-09-10 5:21 UTC (permalink / raw)
To: Greg Kurz, qemu-devel; +Cc: Michael Neuling
Greg Kurz <gkurz@linux.vnet.ibm.com> writes:
> Follow-up to Rusty's virtio endianness serie: enough to get a working
> virtfs mount.
>
> Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p.
>
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Thanks!
I've reworked my patches in line with the anticipated KVM_GET_ONE_REG
from Mikey, and put this into the series.
Mikey, here's the template I assumed (needs CONFIG_KVM implementation of
kvmppc_update_spr_lpcr).
Cheers,
Rusty.
FIXME: Implement for KVM using KVM_GET_ONE_REG!
diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
index 771cfbe..30d8af6 100644
--- a/target-ppc/kvm_ppc.h
+++ b/target-ppc/kvm_ppc.h
@@ -29,6 +29,7 @@ int kvmppc_clear_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits);
int kvmppc_or_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits);
int kvmppc_set_tcr(PowerPCCPU *cpu);
int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu);
+void kvmppc_update_spr_lpcr(PowerPCCPU *cpu);
#ifndef CONFIG_USER_ONLY
off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd);
@@ -159,6 +160,10 @@ static inline bool kvmppc_has_cap_epr(void)
{
return false;
}
+
+static inline void kvmppc_update_spr_lpcr(PowerPCCPU *cpu)
+{
+}
#endif
#ifndef CONFIG_KVM
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-02-11 2:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-25 14:56 [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers Greg Kurz
2014-02-11 2:11 ` Alexey Kardashevskiy
-- strict thread matches above, loose matches on Subject: below --
2013-08-12 7:59 [Qemu-devel] [PATCH 3/8] virtio: allow byte swapping for vring and config access Rusty Russell
2013-09-09 12:44 ` [Qemu-devel] [PATCH] hw/9pfs/virtio_9p_device: use virtio wrappers to access headers Greg Kurz
2013-09-10 5:21 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).