[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 06/11] x86/hvm: allowing registering EOI callbacks for GSIs
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 8 Apr 2021 14:52:20 +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=UnkaIzl0sG2ha4I24F3qmNNOsqwb4SuhiuGvbcyONGE=; b=Ipd9I6sT54AG08MhYWhpT6W52Z0CIL01CXqzYHBVlTOPC6tp1WJ5tqfdONqC/Ui8dSFXodvmpmeHCyghtc+YxgwD+hYM0Ia5cUhUacFUfzLUZS0yUOQTZXGP6F4nGlTXlMbI5L5rU+2A8YEHHQ78XGtIT2f1mkakzH8YA9t5d21HKWPI4Ex3tqVStfo2IaijvG2LUkWCNe8IfrfU+CueEZXWwkPZ/FsoHDTAZYt384iuqmTdyt6zvZvUS50SKe938yVa10t1unCFJKge0V1XIa0DVxWDjFwCYFclPi0s+mgwlkkpCddNuKzvmTQnPxd9EKMwt5kzA/ypOwWM5pLGuw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fMFyTW7Ys6xo662O/Mu7OpcRjQBlkm7V0zvXKM7jn4lMydOK2HJbDZXzFQC3wI8sy5UD+H33l3UWvqgxBf85W3AcdmPpRY8qDDey6/uXjYx34AIFePKvQ8c4+zu1GT5B2k8KYfXaztzve9YcZkQ2umJjb3AEFK7Ql3lSDNt68eACb2Pw8QTqH+PuQnGdiodCF9h9C63JzGU0cX8A9BsD1Shp/ZtxXReK4mEG6AKYllY97/5MW9ijW2TLA0Rz8OdTK9+PaHuQsnKItu/hQIn8/I0FVEWNuN0mU/NjiB3O6ozXGdrsJtrm/ejfqnseCce0WISl3FA+rExTchLGye6AVQ==
- 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>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 08 Apr 2021 12:52:47 +0000
- Ironport-hdrordr: A9a23:SAHUdaE2/svrG5tepLqFipHXdLJzesId70hD6mlYQxZYa9Hdss iokugS2xOcskd1ZFgLn9ecNK6cBVbV8pBo6YccVI3SODXOkm2uMY1k8M/e2DXmASLz7apw0q 1nfqh4BrTLfCNHpOz95xS1FMtl/cmf/MmT9J/j5lpkUA0CUdAC0y5XEQCee3cbeCBjJb4UUK WR/dBGoT3IQwVsUu2eCmMeV+bO4/3n/aiWAyIuPBIs5AmQgT7A0teTeHL04j4kXy5S2rBnyG DZkmXCl9iemsumwRzR3XK71fprsebh0ddKCYitjcUYO1zX6jqAWYV7V7WO+A0yueGkgWxKrP DwpX4bUPhb2jf0RCWVqQGo8xT82DwugkWSrmOwsD/Gm4jFYx4UT+BGnplUdxPF7VFIhqAb7I tbm2SDt5RWChvcnCPyo9jQPisa73aJnQ==
- Ironport-sdr: T0FvJo/9/EPz6Ji2XpJzsPg6/GYcEBvjA0Lleziwvn4pQRDfD1T5sj9zoZ0yZgXr7rouFJ7kJb /pUlXMZPn1nLJmCIWRbazJUSNbaEHxGUfvW/82542qVDzkgLQwuL4jLx3y5ytfJ14XgK6uIfpW CtFgC7dU/EoHbmU8bgYDUrxAseXtSAggCIZr+YbqKGLqLNsJoqWlqebB4pZgplZZ5KzzyMHadu Ul+pvprMmh37bHu4NrslIJ+VRO76RV6ekTMC85zayTF4gO3tEzoJnp3/Kn8f5FDDPQspcQZ30T 484=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Apr 07, 2021 at 05:51:14PM +0200, Jan Beulich wrote:
> On 31.03.2021 12:32, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/hvm/irq.c
> > +++ b/xen/arch/x86/hvm/irq.c
> > +void hvm_gsi_unregister_callback(struct domain *d, unsigned int gsi,
> > + struct hvm_gsi_eoi_callback *cb)
> > +{
> > + struct hvm_irq *hvm_irq = hvm_domain_irq(d);
> > + const struct list_head *tmp;
> > +
> > + if ( gsi >= hvm_irq->nr_gsis )
> > + {
> > + ASSERT_UNREACHABLE();
> > + return;
> > + }
> > +
> > + write_lock(&hvm_irq->gsi_callbacks_lock);
> > + list_for_each ( tmp, &hvm_irq->gsi_callbacks[gsi] )
> > + if ( tmp == &cb->list )
> > + {
> > + list_del(&cb->list);
> > + break;
> > + }
> > + write_unlock(&hvm_irq->gsi_callbacks_lock);
> > +}
>
> Perhaps somehow flag, at least in debug builds, if the callback
> wasn#t found?
I've added a debug printf here to warn if the callback is not found,
but I see it triggering because hpet_set_timer will call
destroy_periodic_time and create_periodic_time and thus two calls will
be made to hvm_gsi_unregister_callback. This is fine, but adding a
message there gets too verbose, so I will drop it and leave the code
as-is.
I don't see a problem with calling destroy_periodic_time multiple
times even if the timer was not active, and that shouldn't result in a
message being printed.
Thanks, Roger.
|