Displaying 20 results from an estimated 76 matches for "memcpy_fromio".
2020 Mar 19
2
[PATCH v3] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...sue by updating all drivers which can access a platform
provided ROM. Instead of calling the helper function pci_platform_rom()
which uses phys_to_virt(), call ioremap() directly on the pdev->rom.
radeon_read_platform_bios() previously directly accessed an __iomem
pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().
pci_platform_rom() now has no remaining callers, so remove it.
Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
---
Tested on a MacPro 1,1 with a Radeon X1900 XT card and 32-bit kernel.
Changes in v3:
- Inline pci_platform_rom()
Changes in v2:
- Add iounmap(...
2020 Mar 30
1
[PATCH v3] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...m
> > provided ROM. Instead of calling the helper function
> > pci_platform_rom() which uses phys_to_virt(), call ioremap() directly on
> the pdev->rom.
> >
> > radeon_read_platform_bios() previously directly accessed an __iomem
> > pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().
> >
> > pci_platform_rom() now has no remaining callers, so remove it.
> >
> > Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
>
> I applied this to pci/resource for v5.7. I would feel better if some of the
> graphics guys chimed...
2023 Jul 07
1
[PATCH virtio 1/4] pds_vdpa: reset to vdpa specified mac
...a_cmd_set_mac(pdsv, mac);
>> + ether_addr_copy(pdsv->mac, add_config->net.mac);
>> } else {
>> struct virtio_net_config __iomem *vc;
>>
>> vc = pdsv->vdpa_aux->vd_mdev.device;
>> - memcpy_fromio(mac, vc->mac, sizeof(mac));
>> - if (is_zero_ether_addr(mac)) {
>> - eth_random_addr(mac);
>> - dev_info(dev, "setting random mac %pM\n", mac);
>> - pds_vdpa_cmd_set_mac(pdsv, mac);...
2020 Mar 05
2
[PATCH v2 0/2] Fix loading of platform ROM from 32-bit EFI
This patch series fixes an oops when loading the radeon driver on old Macs
with a 32-bit EFI implementation.
Tested on a MacPro 1,1 with a Radeon X1900 XT card and 32-bit kernel.
Mikel Rychliski (2):
drm/radeon: Stop directly referencing iomem
PCI: Use ioremap(), not phys_to_virt() for platform ROM
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 1 +
2020 Apr 11
0
[PATCH AUTOSEL 5.5 121/121] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...sue by updating all drivers which can access a platform provided
ROM. Instead of calling the helper function pci_platform_rom() which uses
phys_to_virt(), call ioremap() directly on the pdev->rom.
radeon_read_platform_bios() previously directly accessed an __iomem
pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().
pci_platform_rom() now has no remaining callers, so remove it.
Link: https://lore.kernel.org/r/20200319021623.5426-1-mikel at mikelr.com
Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
Signed-off-by: Bjorn Helgaas <bhelgaas at google.com>
Acked-by: Alex De...
2020 Apr 11
0
[PATCH AUTOSEL 5.6 149/149] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...sue by updating all drivers which can access a platform provided
ROM. Instead of calling the helper function pci_platform_rom() which uses
phys_to_virt(), call ioremap() directly on the pdev->rom.
radeon_read_platform_bios() previously directly accessed an __iomem
pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().
pci_platform_rom() now has no remaining callers, so remove it.
Link: https://lore.kernel.org/r/20200319021623.5426-1-mikel at mikelr.com
Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
Signed-off-by: Bjorn Helgaas <bhelgaas at google.com>
Acked-by: Alex De...
2020 Apr 11
0
[PATCH AUTOSEL 5.4 108/108] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...sue by updating all drivers which can access a platform provided
ROM. Instead of calling the helper function pci_platform_rom() which uses
phys_to_virt(), call ioremap() directly on the pdev->rom.
radeon_read_platform_bios() previously directly accessed an __iomem
pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().
pci_platform_rom() now has no remaining callers, so remove it.
Link: https://lore.kernel.org/r/20200319021623.5426-1-mikel at mikelr.com
Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
Signed-off-by: Bjorn Helgaas <bhelgaas at google.com>
Acked-by: Alex De...
2020 Apr 11
0
[PATCH AUTOSEL 4.19 66/66] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...sue by updating all drivers which can access a platform provided
ROM. Instead of calling the helper function pci_platform_rom() which uses
phys_to_virt(), call ioremap() directly on the pdev->rom.
radeon_read_platform_bios() previously directly accessed an __iomem
pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().
pci_platform_rom() now has no remaining callers, so remove it.
Link: https://lore.kernel.org/r/20200319021623.5426-1-mikel at mikelr.com
Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
Signed-off-by: Bjorn Helgaas <bhelgaas at google.com>
Acked-by: Alex De...
2020 Mar 13
3
[PATCH RESEND v2 0/2] Fix loading of platform ROM from 32-bit EFI
This patch series fixes an oops when loading the radeon driver on old Macs
with a 32-bit EFI implementation.
Tested on a MacPro 1,1 with a Radeon X1900 XT card and 32-bit kernel.
Changes in v2:
- Add iounmap() call in nouveau
- Update function comment for pci_platform_rom()
- Minor changes to commit messages
Mikel Rychliski (2):
drm/radeon: Stop directly referencing iomem
PCI: Use
2020 Mar 28
0
[PATCH v3] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...rs which can access a platform
> provided ROM. Instead of calling the helper function pci_platform_rom()
> which uses phys_to_virt(), call ioremap() directly on the pdev->rom.
>
> radeon_read_platform_bios() previously directly accessed an __iomem
> pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().
>
> pci_platform_rom() now has no remaining callers, so remove it.
>
> Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
I applied this to pci/resource for v5.7. I would feel better if some
of the graphics guys chimed in, or even applied it via the D...
2020 Mar 13
0
[PATCH RESEND v2 1/2] drm/radeon: Stop directly referencing iomem
pci_platform_rom() returns an __iomem pointer which should not be
accessed directly. Change radeon_read_platform_bios() to use
memcpy_fromio() instead of calling kmemdup() on the __iomem pointer.
Signed-off-by: Mikel Rychliski <mikel at mikelr.com>
---
drivers/gpu/drm/radeon/radeon_bios.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/...
2020 Apr 28
0
[PATCH v3 52/75] x86/sev-es: Handle MMIO String Instructions
From: Joerg Roedel <jroedel at suse.de>
Add handling for emulation the MOVS instruction on MMIO regions, as done
by the memcpy_toio() and memcpy_fromio() functions.
Signed-off-by: Joerg Roedel <jroedel at suse.de>
---
arch/x86/kernel/sev-es.c | 78 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c
index e3662723ed76..84958a82f8e0 100644
--- a/arch/x86...
2020 Mar 13
0
[PATCH RESEND v2 2/2] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...u/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index 50dff69a0f6e..ea6a1fa98ad9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -207,6 +207,7 @@ static bool amdgpu_read_platform_bios(struct amdgpu_device *adev)
return false;
memcpy_fromio(adev->bios, bios, size);
+ iounmap(bios);
if (!check_atom_bios(adev->bios, size)) {
kfree(adev->bios);
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c
index 9b91da09dc5f..8a60a0db7b14 100644
--- a/drivers/gpu/d...
2015 Oct 02
2
[PATCH] bios: fix OF loading
...d(__powerpc__)
struct priv {
@@ -33,17 +34,27 @@ static u32
of_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{
struct priv *priv = data;
- if (offset + length <= priv->size) {
+ if (offset < priv->size) {
+ length = min_t(u32, length, priv->size - offset);
memcpy_fromio(bios->data + offset, priv->data + offset, length);
return length;
}
return 0;
}
+static u32
+of_size(void *data)
+{
+ struct priv *priv = data;
+
+ return priv->size;
+}
+
static void *
of_init(struct nvkm_bios *bios, const char *name)
{
- struct pci_dev *pdev = bios->subde...
2023 Jun 30
4
[PATCH virtio 0/4] pds_vdpa: mac, reset, and irq updates
v2 for internal review
- heavily reworked NET_F_MAC patch, matches recent PR-68875
- reordered to put "clean and reset vqs" before "alloc-irq"
to make them slightly simpler patches
- other minor cleanups for simpler patches
These are some fixes for device providing a MAC address, for allocating
irq resources later to support vhost use, and for properly cleaning
vq info
2023 Jun 30
4
[PATCH virtio 0/4] pds_vdpa: mac, reset, and irq updates
v2 for internal review
- heavily reworked NET_F_MAC patch, matches recent PR-68875
- reordered to put "clean and reset vqs" before "alloc-irq"
to make them slightly simpler patches
- other minor cleanups for simpler patches
These are some fixes for device providing a MAC address, for allocating
irq resources later to support vhost use, and for properly cleaning
vq info
2020 Mar 18
0
[PATCH RESEND v2 2/2] PCI: Use ioremap(), not phys_to_virt() for platform ROM
...dev->pdev->rom;
size_t romlen = rdev->pdev->romlen;
void __iomem *bios;
rdev->bios = NULL;
if (!rom || romlen == 0)
return false;
rdev->bios = kzalloc(romlen, GFP_KERNEL);
if (!rdev->bios)
return false;
bios = ioremap(rom, romlen);
if (!bios)
goto free_bios;
memcpy_fromio(rdev->bios, bios, romlen);
iounmap(bios);
if (rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa)
goto free_bios;
return true;
free_bios:
kfree(rdev->bios);
return false;
}
If this is preferred, I'll send an updated series. I'm assuming that the
removal of pci_platform_ro...
2020 Nov 03
0
[patch V3 31/37] drm/ttm: Replace kmap_atomic() usage
...= (void *)((unsigned long)src + (page << PAGE_SHIFT));
- dst = kmap_atomic_prot(d, prot);
- if (!dst)
- return -ENOMEM;
+ /*
+ * Ensure that a highmem page is mapped with the correct
+ * pgprot. For non highmem the mapping is already there.
+ */
+ dst = kmap_local_page_prot(d, prot);
memcpy_fromio(dst, src, PAGE_SIZE);
- kunmap_atomic(dst);
+ kunmap_local(dst);
return 0;
}
@@ -203,13 +205,15 @@ static int ttm_copy_ttm_io_page(struct t
return -ENOMEM;
dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT));
- src = kmap_atomic_prot(s, prot);
- if (!src)
- return -ENOMEM...
2013 Nov 26
0
[PATCH char-misc-linus 4/5] misc: mic: Fix sparse warnings and other endianness issues.
...ers/misc/mic/card/mic_virtio.c
> +++ b/drivers/misc/mic/card/mic_virtio.c
> @@ -248,17 +248,17 @@ static struct virtqueue *mic_find_vq(struct virtio_device *vdev,
> /* First assign the vring's allocated in host memory */
> vqconfig = mic_vq_config(mvdev->desc) + index;
> memcpy_fromio(&config, vqconfig, sizeof(config));
> - _vr_size = vring_size(config.num, MIC_VIRTIO_RING_ALIGN);
> + _vr_size = vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN);
> vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info));
> - va = mic_card_map(mvdev->mdev, con...
2020 Feb 14
1
[PATCH 41/62] x86/sev-es: Handle MSR events
On 2/13/20 11:23 PM, Joerg Roedel wrote:
> Yes, investigating this is on the list for future optimizations (besides
> caching CPUID results). My idea is to use alternatives patching for
> this. But the exception handling is needed anyway because #VC
> exceptions happen very early already, basically the first thing after
> setting up a stack is calling verify_cpu(), which uses CPUID.