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

Re: [PATCH v2 2/5] x86/ioapic: RTE modifications must use ioapic_write_entry


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 25 Jul 2023 15:30:47 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JkzvlS7YgjafCSIz40nYce5MrEYRCo9o9cp+rHpmmAA=; b=T1/TN2QaH/IqEm5oQT07CV8aUsNdUFKpg50RrEhBW40fUnp8vQefEPM3a3kjpodvvuY0tXg8mUi/t7sSZMvNmS4e6gJh31nGoFhzoIE/VBu88Urqr/5eDoWLIS0AgHQsOU1thRnC2ve3cBbud+ebOeHvi5ojFiiJoUZsjtBRZYlo8Cas6gXjptkff4q3EhIVKKp+5VxwD39KTwXD4KWfbfylpjTVyj73djm8F6xnsjUcrkv282qLpalIPmOUIG3rKvdjVpOfzN8TtoXd0hmOikkTqyfGMx/vg+I09lUo5nO+IZGwpLMbGqy2Z/xlCC7YC9MLwoMqRjh4g1W7Hn+EQQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j4lIUoEkcyNIg8e8SZayu16/lUbCefrAw9uXbj8duYYML9cwB88OYE6btE8AW/dafkNxQRRZv4jX3NQi4Pcya15XfDj8n+tvJrub/BCIQMRROWNCsaufTRVLKCI4whi+v6RNDcn7R13lj+OV4yhmb5YLC9GVIRpkzzUzjgbtqVbz8QBa6GkxGBV3cCDskylCnsjN5rN/K4Wd4CKnZdxXmvPw5oEnhTQ/P+HkaJQApXQQ6TEWm7bx3sAdLhJ3fuD3/u6wjBD89mphJGoon5fq1r4a8fNSz/R3dzMnYBaCVHBvI6AI1uDkxQPY+55f8nYSjfILwROKHBtFQItSrwgfcA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 25 Jul 2023 13:31:24 +0000
  • Ironport-data: A9a23:CKTwB62qSwWj8VyZFvbD5fJwkn2cJEfYwER7XKvMYLTBsI5bpzEAz GEcXmHQb6qIZGTxeNEiYIuxpk4Hu5OExtcwSQRlpC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb8XuDgNyo4GlD5gNkOKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfGX8Qz OMWOD42cQGspMCzxYuQWvhIv5F2RCXrFNt3VnBI6xj8VK5jZK+ZBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvi6KlFwZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r137CUzX+gBd56+LuQ1vhW0G/PxUUoCDoxWX++uPuDjHzhcocKQ 6AT0m90xUQoz2SpRNTgWxyzoFafowURHdFXFoUS9wWl2qfSpQGDCQAsXjNHLdArqsIybTgrz UOS2cPkAyR1t7+YQm7b8a2bxQ5eIgAQJG4GICobFw0M5oC7pJlp10qfCNF+DKSyk9v5Xynqx CyHpzQ/gLNVitMX06K8/hbMhDfESoX1czPZLz7/BgqNhj6Vrqb1N+RENXCzAS58Ebuk
  • Ironport-hdrordr: A9a23:3EIqoqvJnY/Ve9kZT5Eba8ni7skDx9V00zEX/kB9WHVpmwKj9v xG+85rsSMc6QxhPU3I/OrrBEDuex7hHPJOjbX409+ZLXPbUSiTXfpfBbKL+UycJ8SGzJ8g6U 4DSchD4azLfDpHZJ3BkW6F+r8bqbHtzEnPv4jjJhxWPGJXgs9bgTuRIzzrbXFedU1pBYcZCJ HZ3cZOvTymEE5nFviTNz0qX/Xju9aOr57tYQcHCxk7gTP+9A+A2frVEwW4whxbaD9Ewa4j/W /Z1yT1676uqevT8G6s60bjq7pXhfr8wZ94CMuAhtN9EESLti+kaJ59W7qLoTAyp/vH0idVrO Xx
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Jul 18, 2023 at 05:40:18PM +0200, Jan Beulich wrote:
> On 18.07.2023 14:43, Roger Pau Monne wrote:
> > --- a/xen/arch/x86/io_apic.c
> > +++ b/xen/arch/x86/io_apic.c
> > @@ -584,16 +585,16 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const 
> > cpumask_t *mask)
> >              dest = SET_APIC_LOGICAL_ID(dest);
> >          entry = irq_2_pin + irq;
> >          for (;;) {
> > -            unsigned int data;
> > +            struct IO_APIC_route_entry rte;
> > +
> >              pin = entry->pin;
> >              if (pin == -1)
> >                  break;
> >  
> > -            io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
> > -            data = io_apic_read(entry->apic, 0x10 + pin*2);
> > -            data &= ~IO_APIC_REDIR_VECTOR_MASK;
> > -            data |= MASK_INSR(desc->arch.vector, 
> > IO_APIC_REDIR_VECTOR_MASK);
> > -            io_apic_modify(entry->apic, 0x10 + pin*2, data);
> > +            rte = __ioapic_read_entry(entry->apic, pin, false);
> > +            rte.dest.dest32 = dest;
> > +            rte.vector = desc->arch.vector;
> > +            __ioapic_write_entry(entry->apic, pin, false, rte);
> 
> ... this makes me wonder whether there shouldn't be an
> __ioapic_modify_entry() capable of suppressing one of the two
> writes (but still being handed the full RTE).

I've wondered about this, and I'm not sure how often can one of the
two writes be suppressed here, as we modify both the low (for the
vector) and the high part of the RTE (for the destination).  It's
unlikely that the same vector could be used on both destinations, and
IMO such case doesn't warrant the introduction of the extra logic
required in order to suppress one of the writes.

Am I overlooking something?

Thanks, Roger.



 


Rackspace

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