[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 08/11] x86/dpci: switch to use a GSI EOI callback
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 8 Apr 2021 17:23:01 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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-SenderADCheck; bh=ToPtUjBIC2bgU6YSW+8amcXda8QXGfemGcE44UtHH5M=; b=OHS5MggJzCbLe1fZwAY5szRbaQ4AkBBZDoOqjOcWq7S7DZaJq54nkooi2DTvqP99o8bdG88XY8RL2eGbY6aoam/IhMJEFd9skwoq5XcfcojoRHv/rEGaP7rXeKLR2uxzmAY2OtP54lW4a1YwHGy6DQItvInTjAHeA6pR6QFeoFTFe3y5ujJcqbcZjaJS7o/5eRLuaj+6d/1f2vcPlwWkpu3OVVmsW/8ebV+3h7uNyexummwNhSE/9vbTtMUQEyezcbRRzhagrZpD4052HDaISj0N2AlXAEGA+A26hrPBulNbomzS69dmfejZ+Jhcxk/Bw/4pQYJsiiU/puzrdmAKEA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GsBeJIQuIqoa5nk7q+EDNQp4EiEHuTDUBNjOXWWsrsqQzBqTyUi2kIAvRmlRfPwqaCjDijASX45gFAxLJbEBPDxX06TaYyEa9q94huNyzz8RLXSjXKyqMfap3qSWT8aXRYeM64DOQmaVAJj6jj2+o8RqNzN1aLFFHzwhXm7G8ohNRl2hJP1oO6k0I3VwwhJWpmtvOldxxypTqLE4AZc0nD0oF1PybS5s5fMLDkz2jb5ai8PTGq5cCmjQ8cRLc+wDxOjfocbXOcJMaEooo1+TanrwbtMZf2d9vs/7G5cczDoPzTLDQqqj1mPOnDmEbg727AffLjhLrZrYb4qSnUVFJw==
- Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 08 Apr 2021 15:23:21 +0000
- Ironport-hdrordr: A9a23:aUGBwKmcgbP7UcLgCSV8IjllGm7pDfO9j2dD5ilNYBxZY6Wkvu iUtrAyyQL0hDENWHsphNCHP+26TWnB8INuiLN/AZ6LZyOjnGezNolt4c/ZwzPmEzDj7eI178 tdWoBEIpnLAVB+5PyW3CCRD8sgzN6b8KqhmOfZyDNXQRt3brx7hj0ZNi+wOCRNNW57LLA+E4 eR4dcCijq7YHIMbtm6AH5tZZm4m/TgkpX6bRkaQyM28QXmt0LS1JfWMTi9mi0fXTRG3Ks4/Q H+/TDRy62/v5iAu33h/kDJ6ZA+oqqF9vJiA4i2htEROnHQjG+TFflccpmjmBxwn+218lYtl7 D30mYdFuB+8WnYcG3wgTaF4XiY7B8U53XvyUCVjBLYyKSTLlJKaLszuatjfhTU8EYmtt1nuZ g7p16xjJZLEQjG2B30+tmgbWAVqmOPvXEgneQP5kYvN7c2Vbk5l/16wGplVL0EHC789bk9Fv hvAMz29J9tACynRkGckW91zNO2WHMvWj+AX0gZo8SQlwNbhXZj0iIjtYEit0ZF0Kh4Z4hP5u zCPKgtvLZSTvUOZaY4IOsaW8O4BkHEXBqkChPfHX3XUIU8f17doZ/+57s4oMuwfoYT8Zc0kJ PdFHtFqG8bYSvVeIyz9awO1iqIbHS2XDzrxM0bzYN+oKfASL3iNjDGYEwykvGnv+4UDqTgKr iOEaMTJ8WmAXrlGI5P0QG7cYJVM2MiXMocvct+dEmJpu7NN432ps3WePveP9PWYHUZc1K6Jk FGcCn4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5WkCE7LTNr1aghZs7k1L3fw9y1BdoHs7+z7xDE48b+kTAcGJv67IZe880Um8ay KhXxQeeUHTruT3w5JemuOiRR+nd9Q9Nm4k+DPU3P6dD/adrphZR1Nq7JAZyPhRM8U1XctI0icN WUg=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Apr 08, 2021 at 04:49:48PM +0200, Jan Beulich wrote:
> On 31.03.2021 12:33, Roger Pau Monne wrote:
> > @@ -515,17 +528,44 @@ int pt_irq_create_bind(
> > }
> > else
> > {
> > + /*
> > + * NB: the callback structure allocated below will never be
> > freed
> > + * once setup because it's used by the hardware domain and will
> > + * never be unregistered.
> > + */
> > + cb = xmalloc(struct hvm_gsi_eoi_callback);
>
> Is this comment as well as ...
>
> > ASSERT(is_hardware_domain(d));
> >
> > + if ( !cb )
> > + {
> > + spin_unlock(&d->event_lock);
> > + return -ENOMEM;
> > + }
> > +
> > /* MSI_TRANSLATE is not supported for the hardware domain. */
> > if ( pt_irq_bind->irq_type != PT_IRQ_TYPE_PCI ||
> > pirq >= hvm_domain_irq(d)->nr_gsis )
> > {
> > spin_unlock(&d->event_lock);
> > -
> > + xfree(cb);
> > return -EINVAL;
> > }
> > guest_gsi = pirq;
> > +
> > + cb->callback = dpci_eoi;
> > + cb->data = d;
> > + /*
> > + * IRQ binds created for the hardware domain are never
> > destroyed,
> > + * so it's fine to not keep a reference to cb here.
> > + */
> > + rc = hvm_gsi_register_callback(d, guest_gsi, cb);
>
> ... the one here really true? vpci_msi_arch_update() and
> vpci_msi_disable() seem to tell me otherwise (or for the former
> comment, they suggest there should be un-registration somewhere).
MSI doesn't use hvm_gsi_register_callback at all, since those are only
used for GSI interrupts. I should replace IRQ with GSI in the comment
above to make it clearer.
> It also doesn't seem logical to me, considering (yet to be made
> work) pass-through of devices or hot-unplugged ones, at which
> point Dom0 shouldn't retain IRQ bindings, I would think.
Hm, maybe. I think we are still very far from that. Right now GSIs are
bound to a PVH dom0 based on the unmasked vIO-APIC pins, and they are
never unbound. We could see about unbinding them, but TBH I would
expect a PVH dom0 to just mask the vIO-APIC pin when it has no
devices using it if those are unplugged.
Thanks, Roger.
|