public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH v2] xen: Add support for XenServer 6.1 platform device
Date: Fri, 28 Feb 2025 13:37:54 +0100	[thread overview]
Message-ID: <Z8GuItUuhbF1UZ9V@macbook.local> (raw)
In-Reply-To: <a14c6897-075c-4b2c-8906-75eb96d5c430@citrix.com>

On Thu, Feb 27, 2025 at 03:41:54PM +0000, Andrew Cooper wrote:
> On 27/02/2025 2:50 pm, Frediano Ziglio wrote:
> > On XenServer on Windows machine a platform device with ID 2 instead of
> > 1 is used.
> >
> > This device is mainly identical to device 1 but due to some Windows
> > update behaviour it was decided to use a device with a different ID.
> >
> > This causes compatibility issues with Linux which expects, if Xen
> > is detected, to find a Xen platform device (5853:0001) otherwise code
> > will crash due to some missing initialization (specifically grant
> > tables). Specifically from dmesg
> >
> >     RIP: 0010:gnttab_expand+0x29/0x210
> >     Code: 90 0f 1f 44 00 00 55 31 d2 48 89 e5 41 57 41 56 41 55 41 89 fd
> >           41 54 53 48 83 ec 10 48 8b 05 7e 9a 49 02 44 8b 35 a7 9a 49 02
> >           <8b> 48 04 8d 44 39 ff f7 f1 45 8d 24 06 89 c3 e8 43 fe ff ff
> >           44 39
> >     RSP: 0000:ffffba34c01fbc88 EFLAGS: 00010086

I think the back trace might be more helpful here rather than the raw
code?

Not sure if it helps, but there's a document in upstream Xen
repository that lists the IDs:

https://xenbits.xen.org/docs/unstable/man/xen-pci-device-reservations.7.html

It would be good to record the information you have gathered about the
different devices somewhere.  Maybe xen-pci-device-reservations would
be a good place to list the intended usage of those device IDs, as
right now it just lists the allocated ranges, but no information about
what's the purpose of each device.

> >     ...
> >
> > The device 2 is presented by Xapi adding device specification to
> > Qemu command line.
> >
> > Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> 
> I'm split about this.  It's just papering over the bugs that exist
> elsewhere in the Xen initialisation code.
> 
> But, if we're going to take this approach, then 0xc000 needs adding too,
> which is the other device ID you might find when trying to boot Linux in
> a VM configured using a Windows template.

Won't adding 0xc000 cause issues?  As then the xenpci driver will bind
to two devices on the same system (either 0001 or 0002, and
additionally c000).  As it's my understanding that the device with ID
c000 will be present in conjunction with either a device with ID 0001
or 0002.

Thanks, Roger.

  parent reply	other threads:[~2025-02-28 12:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 14:03 [PATCH] xen: Add support for XenServer 6.1 platform device Frediano Ziglio
2025-02-25 17:50 ` Bjorn Helgaas
2025-02-27 14:50 ` [PATCH v2] " Frediano Ziglio
2025-02-27 15:29   ` Jürgen Groß
2025-02-27 15:41   ` Andrew Cooper
2025-02-28 12:12     ` Frediano Ziglio
2025-02-28 12:37     ` Roger Pau Monné [this message]
2025-03-07 11:14       ` Frediano Ziglio
2025-03-14  7:43         ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z8GuItUuhbF1UZ9V@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bhelgaas@google.com \
    --cc=frediano.ziglio@cloud.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox