[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, 15 Apr 2021 18:04: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=6SjXWGrp9x1UQTfhOryqES6S9F26Ex2hBlUeJ3sK+Go=; b=DyMsoU7aSzgH3yrns7sBu+ILAEoHGtcWuEtiSBOVmG4s3MOan2DHoisSEhSr7SOYUn3VRNe8lkEDgZgrALLEEVLAL8/8Y3e71OrLRLxVO+IvqpjogYLSei/5ld8DuTw9H8iZfBumN6NBMDsgkbJsLCr9Zdt2QAI2QUbRQBSWsUeDwfBs+E0xMGEvRJ4iG/6z7Pb6juAty7s7yQEtMLpjoh0ATbr+JfAWN4AKdJeGMNsQxY2/fBeyJcPGUYCtS4oTYuJHcOR1g/wy3LhjVYiu7dYfxqoRatFbmK8Xy+Ui/HtdcHqPaQ0bfM/8s/32uiXnOoXilzTTqt8/3+pgVZ6Qig==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IvPjyTk78iTjHrmJjvztf08qbwg6SjEbvU/GYa/aD13DtxRBSBi+ys8CaF8Fu31qiHhtD5MrfoEuMSItOvcOpLwse2VMm1LzwJhVM9PMRsriEHoBU7cqEtAqWm4LFKdwF4niS5WN53djMuaY1972T4FjOS3hcbXZwOhx+QtAinxdrUW5VQnGG1RKo/alDoEwl1/uEc/FisZuzc/n1+EqUEGhikO1SW1JYf+DygZb7kZZbNCsafa+gU4P2zbktQ3B2ZW11Jh6r35/GoeAGEDD8xqigeT3yIvYnH9CjqlU18/4Gopayxc2lGWJ9ACFYVAFj7WSRZ9gTtjwmNeI0A02Ng==
  • Authentication-results: esa5.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, 15 Apr 2021 16:04:35 +0000
  • Ironport-hdrordr: A9a23:s75IZq0VwynR58jHxa+7jAqjBWhyeYIsi2QD101hICF9WtCEls yogfQQ3QL1jjFUY307hdWcIsC7LE/035hz/IUXIPOeTBDr0VHYSb1KwKnD53nbGyP4/vNAzq sIScJDIfD5EFQSt6nHySaiFdJI+re62YSJocub8Ht3VwFtbMhbnmVEIyKWCFd/SgUDJbdRLv qhz/FKrTahZngbB/7TbhU4dtPOusHRk9beaQMGbiRN1CC1kTiq5LTmeiLovSs2bjUn+9Yf2F mAqSPVzOGJs/a3yhjTvlWjlah+qZ/a5fZoQOCJgsgRAD3whgivf5QJYcz+gBkF5NuBxXxvvN 7QowoxH8kb0QKsQkiF5SHD9iOl8DEy52TswVWV6EGT3vDRdXYBJOdqwad6GyGpj3YIjZVH/4 9gm1+9jd5xCyjNmSzsjuK4Ly1Cpw6PjlcJ1dIIg2c3a/p4VJZh6bYx0WlyC5k6ECfz+OkcYZ JTJfCZ3vpQfF+ABkqp2FVH8ZipVnQ3KB+MXlIPjMyTyyRXh3B01SIjtbUioks=
  • Ironport-sdr: l0Zhbn+qt6/I3DWAZT68vtAj21Qas5+XoyLxof99nVr0lKCd8ZJIpxghuaosPPHVrbMiY4DCxv lsqsBf7winQIMC/AtPqqhmGKfqXVYbjnT0D7BdQOcB1w0vKvtsyk9hNi7Wx5F9mydciBjrr7xA UpKCzCc2+tSVlR+4yUps4Irp8l6n9dnMbJyCMKQlCOCp2qtH4Nn8+ElgrQcYQTfeM5dyIbDuDs JKKVz7U8M7QC4BKkEehusnZ+5zk8Yt0JdjxywgEnsGp/gaJv+qSbvdf330PoGB5Cco+fM4l87I wxk=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 07, 2021 at 07:08:06PM +0200, Roger Pau Monné wrote:
> 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_execute_callbacks(unsigned int gsi)
> > > +{
> > > +    struct hvm_irq *hvm_irq = hvm_domain_irq(current->domain);
> > > +    struct hvm_gsi_eoi_callback *cb;
> > > +
> > > +    read_lock(&hvm_irq->gsi_callbacks_lock);
> > > +    list_for_each_entry ( cb, &hvm_irq->gsi_callbacks[gsi], list )
> > > +        cb->callback(gsi, cb->data);
> > > +    read_unlock(&hvm_irq->gsi_callbacks_lock);
> > > +}
> > 
> > Just as an observation (for now at least) - holding the lock here
> > means the callbacks cannot re-register themselves.
> 
> Well, re-registering would be weird, as the callback is not
> unregistered after execution. What is likely more relevant is that the
> callback cannot unregister itself. I haven't found a need for this so
> far, so I think it's fine.

I'm afraid I was wrong here - rtc_pf_callback could attempt to
unregister the timer, and thus end up calling
hvm_gsi_unregister_callback inside of a callback.

I need to figure a way to solve this. We already run the RTC in no ack
mode (which is correct because of the flag we expose in the WAET ACPI
table), and hence I wonder if we still need to keep the code for the
strict_mode around, since it's not used at all. Would you be OK with
me removing the mode_strict related code?

Thanks, Roger.



 


Rackspace

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