Groups | Search | Server Info | Login | Register
Groups > gnu.hurd.bug > #12060
| Path | csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail |
|---|---|
| From | Joan Lledó <jlledom@mailfence.com> |
| Newsgroups | gnu.hurd.bug |
| Subject | Re: PCI arbiter crash on last qemu image |
| Date | Sat, 22 Aug 2020 12:38:16 +0200 (CEST) |
| Lines | 92 |
| Approved | bug-hurd@gnu.org |
| Message-ID | <mailman.728.1598092707.2469.bug-hurd@gnu.org> (permalink) |
| References | <78d17df2-64dd-692e-4151-ad14e25a97d6@mailfence.com> <2f03cf83-9dff-1b92-a6e0-96ae20bfda49@zamaudio.com> <e3d57b71-af84-c035-7799-0c4dc6bfdae4@mailfence.com> <c5ae2597-dd25-58f6-8aa2-18b60b91fe5f@zamaudio.com> <ce86a983-886d-cf4d-bb44-106a17ad9282@mailfence.com> <728b60a0-d226-5d36-ba76-82f1f6ce3101@zamaudio.com> <fc77f621-d051-06ba-0d0a-839a269b89ee@mailfence.com> |
| Reply-To | jlledom@member.fsf.org |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | usenet.stanford.edu 1598092707 11922 209.51.188.17 (22 Aug 2020 10:38:27 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| To | bug-hurd@gnu.org |
| Envelope-to | bug-hurd@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailfence.com; s=20160819-nLV10XS2; t=1598092699; bh=dqS8Knr/2ObKvIbZIuyihId9Lq7OOPzobCQrGekk+Uw=; h=Reply-To:Subject:To:References:From:Date:In-Reply-To:From; b=ewqb/mU56c0Df5+qoDm1IWWaSFIKVrgKsfeCCgCb1QX0/n3PYRLD/xruCSRQw9yAl dTDA4IK/Akw5sa38EquK5J5/RPHMT7tq014RRcHHcBsOsrv58ThahCRJyHf+dcrwuG wre4EM5cpb3B4LSP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MwMXH14sh6cDIXJ0Ut1v7eScM0slpy3eey1RbEjNjNeqeeVUWJsbpm6c5pBM2fjc= |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
| In-Reply-To | <728b60a0-d226-5d36-ba76-82f1f6ce3101@zamaudio.com> |
| Content-Language | en-US |
| X-ContactOffice-Account | com:219870206 |
| Received-SPF | pass client-ip=212.3.242.97; envelope-from=jlledom@mailfence.com; helo=mailout-l3b-97.contactoffice.com |
| X-detected-operating-system | by eggs.gnu.org: First seen = 2020/08/22 06:38:19 |
| X-ACL-Warn | Detected OS = Linux 3.11 and newer [fuzzy] |
| X-Spam_score_int | -27 |
| X-Spam_score | -2.8 |
| X-Spam_bar | -- |
| X-Spam_report | (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no |
| X-Spam_action | no action |
| X-BeenThere | bug-hurd@gnu.org |
| X-Mailman-Version | 2.1.23 |
| Precedence | list |
| List-Id | Bug reports for the GNU Hurd <bug-hurd.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-hurd>, <mailto:bug-hurd-request@gnu.org?subject=unsubscribe> |
| List-Archive | <https://lists.gnu.org/archive/html/bug-hurd> |
| List-Post | <mailto:bug-hurd@gnu.org> |
| List-Help | <mailto:bug-hurd-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-hurd>, <mailto:bug-hurd-request@gnu.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <fc77f621-d051-06ba-0d0a-839a269b89ee@mailfence.com> |
| X-Mailman-Original-References | <78d17df2-64dd-692e-4151-ad14e25a97d6@mailfence.com> <2f03cf83-9dff-1b92-a6e0-96ae20bfda49@zamaudio.com> <e3d57b71-af84-c035-7799-0c4dc6bfdae4@mailfence.com> <c5ae2597-dd25-58f6-8aa2-18b60b91fe5f@zamaudio.com> <ce86a983-886d-cf4d-bb44-106a17ad9282@mailfence.com> <728b60a0-d226-5d36-ba76-82f1f6ce3101@zamaudio.com> |
| Xref | csiph.com gnu.hurd.bug:12060 |
Show key headers only | View raw
Hi,
> I have removed my latest patch from my upstream merge request and
replaced it
> with a patch that fixes the problem:
I took a look at your patch.
> mappings[devp->num_mappings].flags = map_flags;
> mappings[devp->num_mappings].memory = NULL;
>
> - if (dev->regions[region].memory == NULL) {
> - err = (*pci_sys->methods->map_range)(dev,
> -
&mappings[devp->num_mappings]);
> - }
> + err = (*pci_sys->methods->map_range)(dev,
&mappings[devp->num_mappings]);
>
> if (err == 0) {
> *addr = mappings[devp->num_mappings].memory;
I've spent some time studying memory management in libpciaccess and
haven't found a reason to make range mappings and region mappings
mutually exclusive. This completely disables range mappings in the x86
backend, since a region mapping for each region is done during the bus
scan.
However, I think the problem here is the x86 backend, not the common
interface. If we take a look at all other backends we'll see that:
1.- Neither of them call its probe() from its create(). So it's the
client who must call pci_device_probe(), it's our arbiter who should do
it and it doesn't.
2.- Neither of them map memory from its probe(). So again it's the
client who must call either pci_device_map_range() or
pci_device_map_region(), and again it's our arbiter who is not doing it.
This is due to our transition from having a libpciaccess copy of x86
backend embedded in the arbiter to use libpciaccess. When it was
embedded, I modified it to probe and map everything during the bus scan,
but the original code in libpciaccess[1] didn't do it. So we are not
using libpciaccess properly and we modified libpciaccess to fit us
instead of the other way around.
It's the commit in [2] that introduced the problem. And that affected to
all clients who use the x86 backend and mapped memory, though it seems
we are the only ones or at least the first ones to worry.
I don't think modifying the common interface of libpciaccess is the
solution, b/c that would affect all clients, not only those using the
x86 backend, I don't see why range and region mappings are mutually
exclusive but they are and clients assume that. So what we should do
instead is modify the x86 backend to behave as others and adapt the
arbiter to use libpciaccess right.
Would you like to fix the backend and I fix the arbiter?
-----
[1]
https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/blob/a167bd6474522a709ff3cbb00476c0e4309cb66f/src/x86_pci.c
[2]
https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/commit/95fbfeeacfd054de1037d6a10dee03b2b2cbc290
El 22/8/20 a les 8:35, Damien Zammit ha escrit:
> Joan,
>
> On 18/8/20 6:51 am, Joan Lledó wrote:
>> El 17/8/20 a les 1:51, Damien Zammit ha escrit:
>>> Perhaps a better way to fix the mapping problem I encountered
>>> is by removing the check for previous mappings when trying to map regions,
>
> I have removed my latest patch from my upstream merge request and replaced it
> with a patch that fixes the problem:
>
> https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/merge_requests/12/commits
>
> Samuel, would you be able to fix the debian package of libpciaccess based on the above?
> (ie, remove one patch and add one patch).
>
> I now get the following with my version of pciaccess (and rumpdisk still works with x86 method):
>
> root@zamhurd:~# hexdump -C -n16 /servers/bus/pci/0000/00/02/0/region0
> 00000000 45 02 14 18 00 00 00 00 83 02 00 00 00 00 00 00 |E...............|
> 00000010
> root@zamhurd:~#
>
> Damien
>
Back to gnu.hurd.bug | Previous | Next | Find similar
Re: PCI arbiter crash on last qemu image Joan Lledó <jlledom@mailfence.com> - 2020-08-22 12:38 +0200
csiph-web