[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] xen/vioapic: add support for the extended destination ID field


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 25 Jan 2022 16:13:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=U3+UgH08CvOSDe5Oh14icPNTKe8R+DoJt2CNc16FP10=; b=Sw7lm6g36R+JaExxqv3JjW6zSS+4YbvYEPbkC3dP6cmwCpUh9OX3Rg9Sp5vcDDpV4g3YDUfAfPuHE4QvVUmS99/hCtUIg24yPFCkOeBRM624OQ0dpotQjSriauUzK7u2Pyw+pZFvw3AquhHzfqHEAt7amZDwqfkSx3pgnRimawUcRFXOLf2E/DO+ic7OyS0njdb4NKB+t8kiboAGPixa12QJjt52Rf/HlYSR/oBKVLdxVlZiBk/G4vKvZbE4DD5VPPg1K2ZNKPIix/x/0y0TqkNlDCRFoT45tJ1ZcqQ0b/wlN32s5TB7IE1Nj+OiGqlPNgnJVL2832EeEHSSV8WZFA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f6dpwWH7AyLfZvbtp9a6nKFPDOPwQ8LHbzMD8mXQZVHiI+nOU2BMFmKeifwyLL2XLHCZG4TbUx0USEDchR2sfpG2525xwecvkyZxsybF5+56MqDYuaToszhxZFcxsYfvkx8V9FAaXxFWp4uZenGQ0eSjAMsa1351+s841ycgQxwHeCTLNtKNK0fibj97DA2RN0L1UAvCl4wlJH0h+2IxuLKdyW3m9L36HpBxrJyQLea9SPvIDGcbTpLrBUcxATUzDB1cnarnRt0mtOdUZ3AHXHXfiaSuaiMgb/6yqyWcYiy0HxD2/7+4T1CRkuRvOlVZVd3WOFv7sSD+ZJ+DnFROWA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>
  • Delivery-date: Tue, 25 Jan 2022 15:13:38 +0000
  • Ironport-data: A9a23:NlNmUqK29BsMDJ+HFE+RLJIlxSXFcZb7ZxGr2PjKsXjdYENSgj0Dz mYYWjzUOPqOYDeke9glboizpB9U75+Byd9jSQtlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUakideSc+EH170Us5xrZj6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB2Pj/909 foQjqacTFcQH6bxhLhDQiRHRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsF2gcsuNo/zNZ43sXB81zDJS/0hRPgvRo2Uv4ABjWxp2qiiG97nP ZcbTQhVfC/ZXB1hNEgPUc0hvKSR0yyXnzpw9wvO+PtfD3Lo5Bx81v3hPcTYfvSORN5JhQCIq 2Te5WP7DxoGctuFxlKt/m2pmbXnnCX1QoseGbS0sPlwjzW7xGYeFRkXXluTuuSihwi1XNc3A 1MQ0jojq+417kPDczXmd0Tm+jje5EdaAocOVb1hgO2Q9kbKywCJKW05YWN6UvAj5PYXTgE2i gGYosy8UFSDr4apYX6a876Vqxa7Ni4UM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AUdAH0+4WMHf+LqUgLzM2eabRWa DsrvZvln6FQzA6f867Dn4KU6zqoMDKrovvZVojCwQ84AeDoDu04PqieiLolCs2Yndq+/MP4G LFmwv26uGKtOy68AbV0yv2445NkNXs59NfDIini9QTKB/rlgG0Db4REIGqjXQQmqWC+VwqmN 7Dr1MJONly0WrYeiWPrR7ky2DboUETwk6n7WXdrWrooMT/Sj5/IdFGn5hlfhzQ7FdllM1g0Y pQtljp+KZ/PFflpmDQ9tLIXxZlmg6funw5i9MeiHRZTM83dKJRl4oC50lYea1wUB4S0LpXUd WGMfuspMq/KTihHjPkVyhUsZGRt00Ib1m7qhNogL3W79BU9EoJu3fwivZv20voz6hNO6Ws0d 60R5iApIs+P/P+UpgNd9vpYfHHfFAlEii8eV57HzzcZdM60jT22trK3Ik=
  • Ironport-sdr: 6aaHGghgiBzo3QR8b1R0jS9CSVAZh0hHeA/KrxBj53J/ufLeqMwcTBv0UcimNNOi+91/Mr6jZ3 mfrlOIr/l0waQFjAdeHqJasi+4zvp3qGs7ZctsCDNRVapIYjXQ1j6QnfBLwOW7sPUZ4arVNdAO rqwEAaGaG/l1c/DkK1XB1OAZXV3c4QvkAjl67jN1cYPfYLM8kr9p4xbP3QUO9ARchBE1ig0kKZ 2vFuZW5Jnjj/HY9lvRM34tn8IAXr+Sr9hngW2ZWqEdupQzPHUzvGEf0h8iWW6/WAm5sFs83zoN pkeLDW6WY+DZM8dEk2tqu5va
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxxxxxxx/
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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.