Groups | Search | Server Info | Login | Register
Groups > gnu.hurd.bug > #12067
| From | Damien Zammit <damien@zamaudio.com> |
|---|---|
| Newsgroups | gnu.hurd.bug |
| Subject | Re: PCI arbiter crash on last qemu image |
| Date | 2020-08-26 19:13 +1000 |
| Message-ID | <mailman.1296.1598433226.2469.bug-hurd@gnu.org> (permalink) |
| References | (6 earlier) <fc77f621-d051-06ba-0d0a-839a269b89ee@mailfence.com> <2559279e-72a6-a87a-ad0d-cbe71102f69e@zamaudio.com> <7c5e596c-2f62-9843-8478-681c2e5e9fcc@zamaudio.com> <81a609ee-4a10-5e91-1872-8cb861087e90@mailfence.com> <988c3be1-d697-8366-69f6-0bd25f01f5a9@zamaudio.com> |
Hi,
On 23/8/20 8:47 pm, Joan Lledó wrote:
> http://git.savannah.gnu.org/cgit/hurd/hurd.git/log/?h=jlledom-pciaccess-map
Thanks for doing this, I tried it locally and fixed two bugs in my libpciaccess patches:
diff --git a/src/x86_pci.c b/src/x86_pci.c
index 1614729..1e70f35 100644
--- a/src/x86_pci.c
+++ b/src/x86_pci.c
@@ -275,6 +275,7 @@ map_dev_mem(void **dest, size_t mem_offset, size_t mem_size, int write)
return errno;
}
+ close(memfd);
return 0;
#endif
}
@@ -505,7 +506,7 @@ pci_nfuncs(struct pci_device *dev, uint8_t *nfuncs)
static error_t
pci_device_x86_read_rom(struct pci_device *dev, void *buffer)
{
- void *bios;
+ void *bios = NULL;
struct pci_device_private *d = (struct pci_device_private *)dev;
int err;
> Also in map_dev_mem(), it seems to be some problem when mapping the rom.
> I tried to read the rom with hexdump:
>
> hexdump -Cn 16 /servers/bus/pci/0000/00/03/0/rom
This command now works (every time).
> In pci_device_x86_read_rom() the memory is mapped and unmapped for each
> read. I wonder if it's correct to unmap with munmap() something mapped
> with vm_map()
I think it's okay to munmap memory mapped with vm_map
but I forgot to initialise the rom memory pointer to NULL.
See http://git.zammit.org/libpciaccess.git/log/?h=rumpdisk-upstream again for updated branch.
If you think everything is okay with this, I will squash the last patch and submit patches upstream.
Thanks,
Damien
Back to gnu.hurd.bug | Previous | Next | Find similar
Re: PCI arbiter crash on last qemu image Damien Zammit <damien@zamaudio.com> - 2020-08-26 19:13 +1000
csiph-web