All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	<xen-devel@lists.xenproject.org>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 1/3] xen/vioapic: add support for the extended destination ID field
Date: Tue, 25 Jan 2022 16:13:23 +0100	[thread overview]
Message-ID: <YfATkz+nse45Vg3C@Air-de-Roger> (raw)
In-Reply-To: <5f8d332d-1bc3-af71-27ba-a4ff7b6e9514@suse.com>

On Mon, Jan 24, 2022 at 02:20:47PM +0100, Jan Beulich wrote:
> On 20.01.2022 16:23, Roger Pau Monne wrote:
> > Such field uses bits 55:48, but for the purposes the register will be
> > used use bits 55:49 instead. Bit 48 is used to signal an RTE entry is
> > in remappable format which is not supported by the vIO-APIC.
> 
> Neither here nor in the cover letter you point at a formal specification
> of this mode of operation.

I'm not aware of any formal specification of this mode, apart from the
work done to introduce support in Linux and QEMU:

https://lore.kernel.org/all/20201009104616.1314746-1-dwmw2@infradead.org/
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=c1bb5418e

Adding David in case there's some kind of specification somewhere I'm
not aware of.

> What I'm aware of are vague indications of
> this mode's existence in some of Intel's chipset data sheets. Yet that
> leaves open, for example, whether indeed bit 48 cannot be used here.

Bit 48 cannot be used because it's already used to signal an RTE is in
remappable format. We still want to differentiate an RTE entry in
remappable format, as it should be possible to expose both the
extended ID support and an emulated IOMMU.

> > --- a/xen/arch/x86/hvm/vioapic.c
> > +++ b/xen/arch/x86/hvm/vioapic.c
> > @@ -412,7 +412,8 @@ static void ioapic_inj_irq(
> >  
> >  static void vioapic_deliver(struct hvm_vioapic *vioapic, unsigned int pin)
> >  {
> > -    uint16_t dest = vioapic->redirtbl[pin].fields.dest_id;
> > +    uint16_t dest = vioapic->redirtbl[pin].fields.dest_id |
> > +                    (vioapic->redirtbl[pin].fields.ext_dest_id << 8);
> 
> What if an existing guest has been writing non-zero in these bits? Can
> you really use them here without any further indication by the guest?

Those bits where reserved previously, so no OS should have used them.
There are hypervisors already in the field (QEMU/KVM and HyperV) using
this mode.

We could add a per-domain option to disable extended ID mode if we are
really worried about OSes having used those bits for some reason.

Thanks, Roger.


  reply	other threads:[~2022-01-25 15:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 15:23 [PATCH 0/3] x86/hvm: add support for extended destination ID Roger Pau Monne
2022-01-20 15:23 ` [PATCH 1/3] xen/vioapic: add support for the extended destination ID field Roger Pau Monne
2022-01-24 13:20   ` Jan Beulich
2022-01-25 15:13     ` Roger Pau Monné [this message]
2022-01-26 12:47       ` Jan Beulich
2022-01-26 19:21         ` David Woodhouse
2022-01-26 13:52       ` David Woodhouse
2022-01-26 14:23         ` Jan Beulich
2022-01-20 15:23 ` [PATCH 2/3] x86/vmsi: add support for extended destination ID in address field Roger Pau Monne
2022-01-24 13:47   ` Jan Beulich
2022-01-26 13:54     ` David Woodhouse
2022-01-26 14:22       ` Roger Pau Monné
2022-02-04  9:23     ` Roger Pau Monné
2022-02-04  9:30       ` Jan Beulich
2022-02-04  9:54         ` Roger Pau Monné
2022-02-04 10:20           ` Jan Beulich
2022-01-20 15:23 ` [PATCH 3/3] HACK: allow adding an offset to the x2APIC ID Roger Pau Monne
2022-01-26 14:03   ` David Woodhouse

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=YfATkz+nse45Vg3C@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dwmw2@infradead.org \
    --cc=jbeulich@suse.com \
    --cc=wl@xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.