Displaying 20 results from an estimated 27 matches for "check_offsets".
2015 Jan 15
1
[PATCH] virtio_pci_modern: validate features
...n.c
index 17f0228..a8fd267 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -570,6 +570,7 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
int err, common, isr, notify, device;
u32 notify_length;
u32 notify_offset;
+ u64 features;
check_offsets();
@@ -676,12 +677,19 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
vp_dev->vdev.config = &virtio_pci_config_nodev_ops;
}
+ features = vp_get_features(vdev);
+ if (!features & (1ULL << VIRTIO_F_VERSION_1))
+ goto err_valid_features;
+
vp_dev->confi...
2015 Jan 15
1
[PATCH] virtio_pci_modern: validate features
...n.c
index 17f0228..a8fd267 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -570,6 +570,7 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
int err, common, isr, notify, device;
u32 notify_length;
u32 notify_offset;
+ u64 features;
check_offsets();
@@ -676,12 +677,19 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
vp_dev->vdev.config = &virtio_pci_config_nodev_ops;
}
+ features = vp_get_features(vdev);
+ if (!features & (1ULL << VIRTIO_F_VERSION_1))
+ goto err_valid_features;
+
vp_dev->confi...
2014 Dec 30
0
[PATCH RFC v2 6/7] virtio_pci: macros for PCI layout offsets.
...f63b4c..ba04055 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -470,6 +470,67 @@ static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type,
return 0;
}
+/* This is part of the ABI. Don't screw with it. */
+static inline void check_offsets(void)
+{
+ /* Note: disk space was harmed in compilation of this function. */
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_VNDR !=
+ offsetof(struct virtio_pci_cap, cap_vndr));
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_NEXT !=
+ offsetof(struct virtio_pci_cap, cap_next));
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_LEN !=
+...
2014 Dec 30
0
[PATCH RFC v2 6/7] virtio_pci: macros for PCI layout offsets.
...f63b4c..ba04055 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -470,6 +470,67 @@ static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type,
return 0;
}
+/* This is part of the ABI. Don't screw with it. */
+static inline void check_offsets(void)
+{
+ /* Note: disk space was harmed in compilation of this function. */
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_VNDR !=
+ offsetof(struct virtio_pci_cap, cap_vndr));
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_NEXT !=
+ offsetof(struct virtio_pci_cap, cap_next));
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_LEN !=
+...
2023 May 03
1
[PATCH v5 virtio 01/11] virtio: allow caller to override device id in vp_modern
...b46bef96..9b2d6614de67 100644
--- a/drivers/virtio/virtio_pci_modern_dev.c
+++ b/drivers/virtio/virtio_pci_modern_dev.c
@@ -218,21 +218,29 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
int err, common, isr, notify, device;
u32 notify_length;
u32 notify_offset;
+ int devid;
check_offsets();
- /* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
- if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
- return -ENODEV;
-
- if (pci_dev->device < 0x1040) {
- /* Transitional devices: use the PCI subsystem device id as
- * virtio device id,...
2015 Feb 11
2
[RFC 0/2] virtio_pci: patches never to apply.
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support,
but I'm pretty sure we should never allow these patches upstream.
Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG.
Rusty Russell (2):
virtio_pci: abstract all MMIO accesses.
virtio: Introducing virtio_pci.no_mmio, the worst boot option in
history.
drivers/virtio/virtio_pci_common.c |
2015 Feb 11
2
[RFC 0/2] virtio_pci: patches never to apply.
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support,
but I'm pretty sure we should never allow these patches upstream.
Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG.
Rusty Russell (2):
virtio_pci: abstract all MMIO accesses.
virtio: Introducing virtio_pci.no_mmio, the worst boot option in
history.
drivers/virtio/virtio_pci_common.c |
2015 Jan 21
14
[PATCH pre-squash 00/14] virtio 1.0: virtio-pci fixup
This is just the full patchset reposted with fixups in correct order,
before squashing them.
I also tweaked commit log for patch
"virtio_pci: modern driver"
I also included Gerd's tag:
Tested-by: Gerd Hoffmann <kraxel at redhat.com>
You can find it all before the rebase -i --autosquash in my tree:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git virtio-next
2015 Jan 21
14
[PATCH pre-squash 00/14] virtio 1.0: virtio-pci fixup
This is just the full patchset reposted with fixups in correct order,
before squashing them.
I also tweaked commit log for patch
"virtio_pci: modern driver"
I also included Gerd's tag:
Tested-by: Gerd Hoffmann <kraxel at redhat.com>
You can find it all before the rebase -i --autosquash in my tree:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git virtio-next
2015 Jan 20
0
[PATCH 03/05] fixup! virtio_pci: macros for PCI layout offsets
...VIRTIO_PCI_COMMON_DFSELECT 0
#define VIRTIO_PCI_COMMON_DF 4
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index c86594e..b2e707ad 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -474,8 +474,10 @@ static inline void check_offsets(void)
offsetof(struct virtio_pci_cap, cap_next));
BUILD_BUG_ON(VIRTIO_PCI_CAP_LEN !=
offsetof(struct virtio_pci_cap, cap_len));
- BUILD_BUG_ON(VIRTIO_PCI_CAP_TYPE_AND_BAR !=
- offsetof(struct virtio_pci_cap, type_and_bar));
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_CFG_TYPE !=
+ o...
2015 Jan 20
0
[PATCH 05/05] virtio_pci_modern: drop an unused function
...v, u8 cfg_type,
return 0;
}
-static void virtio_pci_release_dev(struct device *_d)
-{
- struct virtio_device *vdev = dev_to_virtio(_d);
- struct virtio_pci_device *vp_dev = to_vp_device(vdev);
-
- kfree(vp_dev);
-}
-
/* This is part of the ABI. Don't screw with it. */
static inline void check_offsets(void)
{
--
MST
2015 Jan 20
0
[PATCH 03/05] fixup! virtio_pci: macros for PCI layout offsets
...VIRTIO_PCI_COMMON_DFSELECT 0
#define VIRTIO_PCI_COMMON_DF 4
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index c86594e..b2e707ad 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -474,8 +474,10 @@ static inline void check_offsets(void)
offsetof(struct virtio_pci_cap, cap_next));
BUILD_BUG_ON(VIRTIO_PCI_CAP_LEN !=
offsetof(struct virtio_pci_cap, cap_len));
- BUILD_BUG_ON(VIRTIO_PCI_CAP_TYPE_AND_BAR !=
- offsetof(struct virtio_pci_cap, type_and_bar));
+ BUILD_BUG_ON(VIRTIO_PCI_CAP_CFG_TYPE !=
+ o...
2015 Jan 20
0
[PATCH 05/05] virtio_pci_modern: drop an unused function
...v, u8 cfg_type,
return 0;
}
-static void virtio_pci_release_dev(struct device *_d)
-{
- struct virtio_device *vdev = dev_to_virtio(_d);
- struct virtio_pci_device *vp_dev = to_vp_device(vdev);
-
- kfree(vp_dev);
-}
-
/* This is part of the ABI. Don't screw with it. */
static inline void check_offsets(void)
{
--
MST
2015 Jan 21
9
[PATCH post-squash 0/9] virtio 1.0: virtio-pci fixup
This is just repost of all patches with fixups squashed in - convenient
if you just want to remove old ones from queue and apply new ones.
I also tweaked commit log for patch
"virtio_pci: modern driver"
I also included Gerd's tag:
Tested-by: Gerd Hoffmann <kraxel at redhat.com>
You can find it all before the rebase -i --autosquash in my tree:
2015 Jan 21
9
[PATCH post-squash 0/9] virtio 1.0: virtio-pci fixup
This is just repost of all patches with fixups squashed in - convenient
if you just want to remove old ones from queue and apply new ones.
I also tweaked commit log for patch
"virtio_pci: modern driver"
I also included Gerd's tag:
Tested-by: Gerd Hoffmann <kraxel at redhat.com>
You can find it all before the rebase -i --autosquash in my tree:
2023 Mar 23
0
[PATCH v3 virtio 1/8] virtio: allow caller to override device id and DMA mask
...ern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c
> index 869cb46bef96..6ad1bb9ae8fa 100644
> --- a/drivers/virtio/virtio_pci_modern_dev.c
> +++ b/drivers/virtio/virtio_pci_modern_dev.c
> @@ -221,18 +221,25 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev)
>
> check_offsets();
>
> - /* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
> - if (pci_dev->device < 0x1000 || pci_dev->device > 0x107f)
> - return -ENODEV;
> -
> - if (pci_dev->device < 0x1040) {
> - /* Tra...
2013 May 30
5
[PATCH RFC] virtio-pci: new config layout: using memory BAR
Anthony Liguori <aliguori at us.ibm.com> writes:
> Rusty Russell <rusty at rustcorp.com.au> writes:
>
>> Anthony Liguori <aliguori at us.ibm.com> writes:
>>> "Michael S. Tsirkin" <mst at redhat.com> writes:
>>>> + case offsetof(struct virtio_pci_common_cfg, device_feature_select):
>>>> + return
2013 May 30
5
[PATCH RFC] virtio-pci: new config layout: using memory BAR
Anthony Liguori <aliguori at us.ibm.com> writes:
> Rusty Russell <rusty at rustcorp.com.au> writes:
>
>> Anthony Liguori <aliguori at us.ibm.com> writes:
>>> "Michael S. Tsirkin" <mst at redhat.com> writes:
>>>> + case offsetof(struct virtio_pci_common_cfg, device_feature_select):
>>>> + return
2001 Mar 13
5
is this null block OK?
Hi,
A system running ext3 crashed this afternoon (nothing to do with ext3, bad
network driver). Is was saving a file from emacs when it happened. The
file system is 0.06b and had ordered data as the mount option. Let me
emphasize this was running ext3 pure, not with SnapFS or InterMezzo layered
on top of it.
strace reveals that Emacs does
open("existing file name", O_TRUNC |
2014 Dec 11
6
[PATCH RFC 0/5] virtio_pci: modern driver
Based on Rusty's patches.
Coding style and funny jokes are his.
Bugs and a star wars reference (should be easy to spot) are mine.
Untested, but useful as basis for beginning the qemu work.
TODO:
= simplify probing: use a common probe function, probe with modern driver
first, if that fails - probe with legacy driver.
BUGS: ATM legacy driver can win and drive a transitional device