[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a5ec1f1-a0f4-9c55-38df-c48dfe9234f7@linux.ibm.com>
Date: Wed, 8 Dec 2021 13:59:17 +0100
From: Christian Borntraeger <borntraeger@...ux.ibm.com>
To: Matthew Rosato <mjrosato@...ux.ibm.com>, linux-s390@...r.kernel.org
Cc: alex.williamson@...hat.com, cohuck@...hat.com,
schnelle@...ux.ibm.com, farman@...ux.ibm.com, pmorel@...ux.ibm.com,
hca@...ux.ibm.com, gor@...ux.ibm.com,
gerald.schaefer@...ux.ibm.com, agordeev@...ux.ibm.com,
frankja@...ux.ibm.com, david@...hat.com, imbrenda@...ux.ibm.com,
vneethv@...ux.ibm.com, oberpar@...ux.ibm.com, freude@...ux.ibm.com,
thuth@...hat.com, pasic@...ux.ibm.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/32] s390/airq: allow for airq structure that uses an
input vector
Am 07.12.21 um 21:57 schrieb Matthew Rosato:
> When doing device passthrough where interrupts are being forwarded
> from host to guest, we wish to use a pinned section of guest memory
> as the vector (the same memory used by the guest as the vector).
>
> Signed-off-by: Matthew Rosato <mjrosato@...ux.ibm.com>
> ---
> arch/s390/include/asm/airq.h | 4 +++-
> arch/s390/pci/pci_irq.c | 8 ++++----
> drivers/s390/cio/airq.c | 10 +++++++---
> drivers/s390/virtio/virtio_ccw.c | 2 +-
> 4 files changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/arch/s390/include/asm/airq.h b/arch/s390/include/asm/airq.h
> index 7918a7d09028..e82e5626e139 100644
> --- a/arch/s390/include/asm/airq.h
> +++ b/arch/s390/include/asm/airq.h
> @@ -47,8 +47,10 @@ struct airq_iv {
> #define AIRQ_IV_PTR 4 /* Allocate the ptr array */
> #define AIRQ_IV_DATA 8 /* Allocate the data array */
> #define AIRQ_IV_CACHELINE 16 /* Cacheline alignment for the vector */
> +#define AIRQ_IV_GUESTVEC 32 /* Vector is a pinned guest page */
>
> -struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags);
> +struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags,
> + unsigned long *vec);
> void airq_iv_release(struct airq_iv *iv);
> unsigned long airq_iv_alloc(struct airq_iv *iv, unsigned long num);
> void airq_iv_free(struct airq_iv *iv, unsigned long bit, unsigned long num);
> diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c
> index 880bcd73f11a..dfd4f3276a6d 100644
> --- a/arch/s390/pci/pci_irq.c
> +++ b/arch/s390/pci/pci_irq.c
> @@ -296,7 +296,7 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
> zdev->aisb = bit;
>
> /* Create adapter interrupt vector */
> - zdev->aibv = airq_iv_create(msi_vecs, AIRQ_IV_DATA | AIRQ_IV_BITLOCK);
> + zdev->aibv = airq_iv_create(msi_vecs, AIRQ_IV_DATA | AIRQ_IV_BITLOCK, 0);
> if (!zdev->aibv)
> return -ENOMEM;
>
> @@ -421,7 +421,7 @@ static int __init zpci_directed_irq_init(void)
> union zpci_sic_iib iib = {{0}};
> unsigned int cpu;
>
> - zpci_sbv = airq_iv_create(num_possible_cpus(), 0);
> + zpci_sbv = airq_iv_create(num_possible_cpus(), 0, 0);
For a pointer use NULL? Also in other places. With the indentation fix this looks sane.
Powered by blists - more mailing lists