Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull virtio updates from Rusty Russell: "Some virtio internal cleanups, a new virtio device "virtio input", and a change to allow the legacy virtio balloon. Most excitingly, some lguest work! No seriously, I got some cleanup patches" * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: virtio: drop virtio_device_is_legacy_only virtio_pci: support non-legacy balloon devices virtio_mmio: support non-legacy balloon devices virtio_ccw: support non-legacy balloon devices virtio: balloon might not be a legacy device virtio_balloon: transitional interface virtio_ring: Update weak barriers to use dma_wmb/rmb virtio_pci_modern: switch to type-safe io accessors virtio_pci_modern: type-safe io accessors lguest: handle traps on the "interrupt suppressed" iret instruction. virtio: drop a useless config read virtio_config: reorder functions Add virtio-input driver. lguest: suppress interrupts for single insn, not range. lguest: simplify lguest_iret lguest: rename i386_head.S in the comments lguest: explicitly set miscdevice's private_data NULL lguest: fix pending interrupt test.
This commit is contained in:
@@ -61,8 +61,8 @@ struct lguest_data {
|
||||
u32 tsc_khz;
|
||||
|
||||
/* Fields initialized by the Guest at boot: */
|
||||
/* Instruction range to suppress interrupts even if enabled */
|
||||
unsigned long noirq_start, noirq_end;
|
||||
/* Instruction to suppress interrupts even if enabled */
|
||||
unsigned long noirq_iret;
|
||||
/* Address above which page tables are all identical. */
|
||||
unsigned long kernel_address;
|
||||
/* The vector to try to use for system calls (0x40 or 0x80). */
|
||||
|
@@ -108,8 +108,6 @@ struct virtio_device {
|
||||
void *priv;
|
||||
};
|
||||
|
||||
bool virtio_device_is_legacy_only(struct virtio_device_id id);
|
||||
|
||||
static inline struct virtio_device *dev_to_virtio(struct device *_dev)
|
||||
{
|
||||
return container_of(_dev, struct virtio_device, dev);
|
||||
|
@@ -298,13 +298,6 @@ static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val)
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset)
|
||||
{
|
||||
u8 ret;
|
||||
vdev->config->get(vdev, offset, &ret, sizeof(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Read @count fields, @bytes each. */
|
||||
static inline void __virtio_cread_many(struct virtio_device *vdev,
|
||||
unsigned int offset,
|
||||
@@ -326,7 +319,6 @@ static inline void __virtio_cread_many(struct virtio_device *vdev,
|
||||
} while (gen != old);
|
||||
}
|
||||
|
||||
|
||||
static inline void virtio_cread_bytes(struct virtio_device *vdev,
|
||||
unsigned int offset,
|
||||
void *buf, size_t len)
|
||||
@@ -334,6 +326,13 @@ static inline void virtio_cread_bytes(struct virtio_device *vdev,
|
||||
__virtio_cread_many(vdev, offset, buf, len, 1);
|
||||
}
|
||||
|
||||
static inline u8 virtio_cread8(struct virtio_device *vdev, unsigned int offset)
|
||||
{
|
||||
u8 ret;
|
||||
vdev->config->get(vdev, offset, &ret, sizeof(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void virtio_cwrite8(struct virtio_device *vdev,
|
||||
unsigned int offset, u8 val)
|
||||
{
|
||||
@@ -374,7 +373,6 @@ static inline u64 virtio_cread64(struct virtio_device *vdev,
|
||||
unsigned int offset)
|
||||
{
|
||||
u64 ret;
|
||||
vdev->config->get(vdev, offset, &ret, sizeof(ret));
|
||||
__virtio_cread_many(vdev, offset, &ret, 1, sizeof(ret));
|
||||
return virtio64_to_cpu(vdev, (__force __virtio64)ret);
|
||||
}
|
||||
|
@@ -21,19 +21,20 @@
|
||||
* actually quite cheap.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
static inline void virtio_mb(bool weak_barriers)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
if (weak_barriers)
|
||||
smp_mb();
|
||||
else
|
||||
#endif
|
||||
mb();
|
||||
}
|
||||
|
||||
static inline void virtio_rmb(bool weak_barriers)
|
||||
{
|
||||
if (weak_barriers)
|
||||
smp_rmb();
|
||||
dma_rmb();
|
||||
else
|
||||
rmb();
|
||||
}
|
||||
@@ -41,26 +42,10 @@ static inline void virtio_rmb(bool weak_barriers)
|
||||
static inline void virtio_wmb(bool weak_barriers)
|
||||
{
|
||||
if (weak_barriers)
|
||||
smp_wmb();
|
||||
dma_wmb();
|
||||
else
|
||||
wmb();
|
||||
}
|
||||
#else
|
||||
static inline void virtio_mb(bool weak_barriers)
|
||||
{
|
||||
mb();
|
||||
}
|
||||
|
||||
static inline void virtio_rmb(bool weak_barriers)
|
||||
{
|
||||
rmb();
|
||||
}
|
||||
|
||||
static inline void virtio_wmb(bool weak_barriers)
|
||||
{
|
||||
wmb();
|
||||
}
|
||||
#endif
|
||||
|
||||
struct virtio_device;
|
||||
struct virtqueue;
|
||||
|
Reference in New Issue
Block a user