[Qemu-devel] [PATCH 0/2] spapr/irq: remove the XICS offset adjustment for the dual machine

Cédric Le Goater posted 2 patches 6 years, 8 months ago
Test docker-mingw@fedora passed
Test asan passed
Test checkpatch passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190213210756.27032-1-clg@kaod.org
Maintainers: David Gibson <david@gibson.dropbear.id.au>
include/hw/ppc/spapr_irq.h |  2 +-
hw/ppc/spapr_irq.c         | 45 ++++++++++----------------------------
2 files changed, 12 insertions(+), 35 deletions(-)
[Qemu-devel] [PATCH 0/2] spapr/irq: remove the XICS offset adjustment for the dual machine
Posted by Cédric Le Goater 6 years, 8 months ago
Hello,

When using the 'dual' interrupt mode, the source numbers of both sPAPR
IRQ backends are aligned to share a common IRQ number space and to use
a similar mapping of the machine qemu_irq array which is indexed by
the source number.

The XICS IRQ number range initially being [ 0x1000 - 0x2000 ], this
requires to change the XICS ICSState offset to 0 and to provision for
an extra 4K of source numbers and qemu_irqs which will never be used
by the machine when running under the XICS interrupt mode. This is not
an optimal solution.

Moreover, the KVM support for the 'dual' interrupt mode will require
some adjustments. The XICS KVM device considers that the IRQ numbers
start at XICS_IRQ_BASE (0x1000) and we have no way to inform KVM of
the offset change. We will need to ignore the lower 4K numbers when
capturing or restoring the source states from the XICS KVM device.

The first patch allocates an IRQ number space of the expected size for
the XICS sPAPR IRQ backend. The overall IRQ number space size and the
qemu_irq array size is still the one required by the 'dual' sPAPR IRQ
backend, that is, in sync with XIVE. The second patch removes the
ICSState offset adjustment. This last change adds some benefits as it
simplifies greatly the qirq() method of the 'dual' sPAPR IRQ backend.

C.

Cédric Le Goater (2):
  spapr/irq: add an 'nr_irq' parameter to initialize the backend.
  spapr/irq: remove the XICS offset adjustment

 include/hw/ppc/spapr_irq.h |  2 +-
 hw/ppc/spapr_irq.c         | 45 ++++++++++----------------------------
 2 files changed, 12 insertions(+), 35 deletions(-)

-- 
2.20.1


Re: [Qemu-devel] [PATCH 0/2] spapr/irq: remove the XICS offset adjustment for the dual machine
Posted by David Gibson 6 years, 8 months ago
On Wed, Feb 13, 2019 at 10:07:54PM +0100, Cédric Le Goater wrote:
> Hello,
> 
> When using the 'dual' interrupt mode, the source numbers of both sPAPR
> IRQ backends are aligned to share a common IRQ number space and to use
> a similar mapping of the machine qemu_irq array which is indexed by
> the source number.
> 
> The XICS IRQ number range initially being [ 0x1000 - 0x2000 ], this
> requires to change the XICS ICSState offset to 0 and to provision for
> an extra 4K of source numbers and qemu_irqs which will never be used
> by the machine when running under the XICS interrupt mode. This is not
> an optimal solution.
> 
> Moreover, the KVM support for the 'dual' interrupt mode will require
> some adjustments. The XICS KVM device considers that the IRQ numbers
> start at XICS_IRQ_BASE (0x1000) and we have no way to inform KVM of
> the offset change. We will need to ignore the lower 4K numbers when
> capturing or restoring the source states from the XICS KVM device.
> 
> The first patch allocates an IRQ number space of the expected size for
> the XICS sPAPR IRQ backend. The overall IRQ number space size and the
> qemu_irq array size is still the one required by the 'dual' sPAPR IRQ
> backend, that is, in sync with XIVE. The second patch removes the
> ICSState offset adjustment. This last change adds some benefits as it
> simplifies greatly the qirq() method of the 'dual' sPAPR IRQ
> backend.

Ah, much nicer.  Applied to ppc-for-4.0, thanks.


> 
> C.
> 
> Cédric Le Goater (2):
>   spapr/irq: add an 'nr_irq' parameter to initialize the backend.
>   spapr/irq: remove the XICS offset adjustment
> 
>  include/hw/ppc/spapr_irq.h |  2 +-
>  hw/ppc/spapr_irq.c         | 45 ++++++++++----------------------------
>  2 files changed, 12 insertions(+), 35 deletions(-)
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [PATCH 0/2] spapr/irq: remove the XICS offset adjustment for the dual machine
Posted by Cédric Le Goater 6 years, 8 months ago
On 2/14/19 1:49 AM, David Gibson wrote:
> On Wed, Feb 13, 2019 at 10:07:54PM +0100, Cédric Le Goater wrote:
>> Hello,
>>
>> When using the 'dual' interrupt mode, the source numbers of both sPAPR
>> IRQ backends are aligned to share a common IRQ number space and to use
>> a similar mapping of the machine qemu_irq array which is indexed by
>> the source number.
>>
>> The XICS IRQ number range initially being [ 0x1000 - 0x2000 ], this
>> requires to change the XICS ICSState offset to 0 and to provision for
>> an extra 4K of source numbers and qemu_irqs which will never be used
>> by the machine when running under the XICS interrupt mode. This is not
>> an optimal solution.
>>
>> Moreover, the KVM support for the 'dual' interrupt mode will require
>> some adjustments. The XICS KVM device considers that the IRQ numbers
>> start at XICS_IRQ_BASE (0x1000) and we have no way to inform KVM of
>> the offset change. We will need to ignore the lower 4K numbers when
>> capturing or restoring the source states from the XICS KVM device.
>>
>> The first patch allocates an IRQ number space of the expected size for

s/IRQ number space/source numbers/

There is still some confusion in the way I use the terms "IRQ number" 
and "source number". These are two different number spaces. I should
pay more attention.

>> the XICS sPAPR IRQ backend. The overall IRQ number space size and the
>> qemu_irq array size is still the one required by the 'dual' sPAPR IRQ
>> backend, that is, in sync with XIVE. The second patch removes the
>> ICSState offset adjustment. This last change adds some benefits as it
>> simplifies greatly the qirq() method of the 'dual' sPAPR IRQ
>> backend.
> 
> Ah, much nicer.  Applied to ppc-for-4.0, thanks.

I will just drop patch "spapr/xics: ignore the lower 4K in the IRQ 
number space"

Thanks,

C.