From: eric.auger@linaro.org (Eric Auger)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 05/12] KVM: arm64: introduce ITS emulation file with stub functions
Date: Thu, 7 Apr 2016 17:09:51 +0200 [thread overview]
Message-ID: <5706783F.4040906@linaro.org> (raw)
In-Reply-To: <57067356.40508@arm.com>
On 04/07/2016 04:48 PM, Marc Zyngier wrote:
> Hi Eric,
>
> On 07/04/16 15:08, Eric Auger wrote:
>> Hi Marc,
>> On 04/07/2016 04:04 PM, Marc Zyngier wrote:
>>> On 26/03/16 02:14, Andre Przywara wrote:
>>>> The ARM GICv3 ITS emulation code goes into a separate file, but
>>>> needs to be connected to the GICv3 emulation, of which it is an
>>>> option.
>>>> Introduce the skeleton with function stubs to be filled later.
>>>> Introduce the basic ITS data structure and initialize it, but don't
>>>> return any success yet, as we are not yet ready for the show.
>>>>
>>>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>>>> ---
>>>> arch/arm64/kvm/Makefile | 1 +
>>>> include/kvm/vgic/vgic.h | 6 +++
>>>> include/linux/irqchip/arm-gic-v3.h | 1 +
>>>> virt/kvm/arm/vgic/its-emul.c | 84 ++++++++++++++++++++++++++++++++++++++
>>>> virt/kvm/arm/vgic/vgic.h | 14 +++++++
>>>> virt/kvm/arm/vgic/vgic_init.c | 6 +++
>>>> virt/kvm/arm/vgic/vgic_mmio.c | 18 ++++++--
>>>> 7 files changed, 126 insertions(+), 4 deletions(-)
>>>> create mode 100644 virt/kvm/arm/vgic/its-emul.c
>>>>
>>>> diff --git a/arch/arm64/kvm/Makefile b/arch/arm64/kvm/Makefile
>>>> index 2f5d431..3bec10e 100644
>>>> --- a/arch/arm64/kvm/Makefile
>>>> +++ b/arch/arm64/kvm/Makefile
>>>> @@ -28,6 +28,7 @@ kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/vgic/vgic-v2.o
>>>> kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/vgic/vgic-v3.o
>>>> kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/vgic/vgic_mmio.o
>>>> kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/vgic/vgic_kvm_device.o
>>>> +kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/vgic/its-emul.o
>>>> else
>>>> kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/vgic.o
>>>> kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/vgic-v2.o
>>>> diff --git a/include/kvm/vgic/vgic.h b/include/kvm/vgic/vgic.h
>>>> index 8ea5dd7..c79bed5 100644
>>>> --- a/include/kvm/vgic/vgic.h
>>>> +++ b/include/kvm/vgic/vgic.h
>>>> @@ -112,6 +112,11 @@ struct vgic_io_device {
>>>> struct kvm_io_device dev;
>>>> };
>>>>
>>>> +struct vgic_its {
>>>> + bool enabled;
>>>> + spinlock_t lock;
>>>> +};
>>>> +
>>>> struct vgic_dist {
>>>> bool in_kernel;
>>>> bool ready;
>>>> @@ -153,6 +158,7 @@ struct vgic_dist {
>>>> u64 *pendbaser;
>>>>
>>>> bool lpis_enabled;
>>>> + struct vgic_its its;
>>>> };
>>>>
>>>> struct vgic_v2_cpu_if {
>>>> diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h
>>>> index d5d798b..a813c3e 100644
>>>> --- a/include/linux/irqchip/arm-gic-v3.h
>>>> +++ b/include/linux/irqchip/arm-gic-v3.h
>>>> @@ -177,6 +177,7 @@
>>>> #define GITS_CWRITER 0x0088
>>>> #define GITS_CREADR 0x0090
>>>> #define GITS_BASER 0x0100
>>>> +#define GITS_IDREGS_BASE 0xffd0
>>>> #define GITS_PIDR2 GICR_PIDR2
>>>>
>>>> #define GITS_TRANSLATER 0x10040
>>>> diff --git a/virt/kvm/arm/vgic/its-emul.c b/virt/kvm/arm/vgic/its-emul.c
>>>> new file mode 100644
>>>> index 0000000..49dd5e4
>>>> --- /dev/null
>>>> +++ b/virt/kvm/arm/vgic/its-emul.c
>>>> @@ -0,0 +1,84 @@
>>>> +/*
>>>> + * GICv3 ITS emulation
>>>> + *
>>>> + * Copyright (C) 2015 ARM Ltd.
>>>> + * Author: Andre Przywara <andre.przywara@arm.com>
>>>> + *
>>>> + * This program is free software; you can redistribute it and/or modify
>>>> + * it under the terms of the GNU General Public License version 2 as
>>>> + * published by the Free Software Foundation.
>>>> + *
>>>> + * This program is distributed in the hope that it will be useful,
>>>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>>> + * GNU General Public License for more details.
>>>> + *
>>>> + * You should have received a copy of the GNU General Public License
>>>> + * along with this program. If not, see <http://www.gnu.org/licenses/>.
>>>> + */
>>>> +
>>>> +#include <linux/cpu.h>
>>>> +#include <linux/kvm.h>
>>>> +#include <linux/kvm_host.h>
>>>> +#include <linux/interrupt.h>
>>>> +
>>>> +#include <linux/irqchip/arm-gic-v3.h>
>>>> +
>>>> +#include <asm/kvm_emulate.h>
>>>> +#include <asm/kvm_arm.h>
>>>> +#include <asm/kvm_mmu.h>
>>>> +
>>>> +#include "vgic.h"
>>>> +#include "vgic_mmio.h"
>>>> +
>>>> +struct vgic_register_region its_registers[] = {
>>>> + REGISTER_DESC_WITH_LENGTH(GITS_CTLR,
>>>> + vgic_mmio_read_raz, vgic_mmio_write_wi, 4),
>>>> + REGISTER_DESC_WITH_LENGTH(GITS_IIDR,
>>>> + vgic_mmio_read_raz, vgic_mmio_write_wi, 4),
>>>> + REGISTER_DESC_WITH_LENGTH(GITS_TYPER,
>>>> + vgic_mmio_read_raz, vgic_mmio_write_wi, 4),
>>>
>>> GITS_TYPER is a 64bit register with plenty of things in the upper bits.
>> In practice I think the 32 upper bits are reserved.
>
> Not quite. Only bits [63:38] are reserved. See 8.19.8 in the
> Architecture Specification (IHI 0069B).
Ah OK. Was using an older arch spec(PRD03-GENC-010745 22.0) Now switched
to the indicated one and indeed it's different !;-)
Eric
>
> Thanks,
>
> M.
>
next prev parent reply other threads:[~2016-04-07 15:09 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-26 2:13 [PATCH v4 00/12] KVM: arm64: GICv3 ITS emulation Andre Przywara
2016-03-26 2:13 ` [PATCH v4 01/12] KVM: extend struct kvm_msi to hold a 32-bit device ID Andre Przywara
2016-04-03 9:15 ` Christoffer Dall
2016-05-25 15:55 ` Andre Przywara
2016-05-25 16:16 ` Marc Zyngier
2016-05-31 13:05 ` Christoffer Dall
2016-05-05 17:55 ` Chalamarla, Tirumalesh
2016-03-26 2:14 ` [PATCH v4 02/12] KVM: arm/arm64: extend arch CAP checks to allow per-VM capabilities Andre Przywara
2016-04-03 10:08 ` Christoffer Dall
2016-04-05 12:48 ` Eric Auger
2016-05-05 18:00 ` Chalamarla, Tirumalesh
2016-03-26 2:14 ` [PATCH v4 03/12] KVM: arm64: Introduce new MMIO region for the ITS base address Andre Przywara
2016-04-03 10:08 ` Christoffer Dall
2016-04-05 12:47 ` Eric Auger
2016-04-07 13:44 ` Marc Zyngier
2016-05-05 18:08 ` Chalamarla, Tirumalesh
2016-05-09 15:47 ` Marc Zyngier
2016-05-09 16:53 ` Chalamarla, Tirumalesh
2016-05-09 17:09 ` Marc Zyngier
2016-03-26 2:14 ` [PATCH v4 04/12] KVM: arm64: handle ITS related GICv3 redistributor registers Andre Przywara
2016-04-03 10:08 ` Christoffer Dall
2016-04-05 12:55 ` Eric Auger
2016-04-05 15:17 ` Eric Auger
2016-04-07 13:54 ` Marc Zyngier
2016-04-07 13:58 ` Marc Zyngier
2016-05-05 18:06 ` Chalamarla, Tirumalesh
2016-03-26 2:14 ` [PATCH v4 05/12] KVM: arm64: introduce ITS emulation file with stub functions Andre Przywara
2016-04-05 16:03 ` Eric Auger
2016-04-07 14:04 ` Marc Zyngier
2016-04-07 14:08 ` Eric Auger
2016-04-07 14:48 ` Marc Zyngier
2016-04-07 15:09 ` Eric Auger [this message]
2016-04-07 15:19 ` Marc Zyngier
2016-03-26 2:14 ` [PATCH v4 06/12] KVM: arm64: implement basic ITS register handlers Andre Przywara
2016-04-03 10:08 ` Christoffer Dall
2016-04-06 9:36 ` Eric Auger
2016-05-25 13:49 ` Andre Przywara
2016-04-07 14:35 ` Marc Zyngier
2016-05-25 11:37 ` Andre Przywara
2016-05-26 9:10 ` Marc Zyngier
2016-06-03 15:42 ` Andre Przywara
2016-06-03 16:54 ` Marc Zyngier
2016-05-05 18:51 ` Chalamarla, Tirumalesh
2016-03-26 2:14 ` [PATCH v4 07/12] KVM: arm64: add data structures to model ITS interrupt translation Andre Przywara
2016-04-06 9:53 ` Eric Auger
2016-03-26 2:14 ` [PATCH v4 08/12] KVM: arm64: connect LPIs to the VGIC emulation Andre Przywara
2016-04-06 12:00 ` Eric Auger
2016-05-05 18:59 ` Chalamarla, Tirumalesh
2016-03-26 2:14 ` [PATCH v4 09/12] KVM: arm64: sync LPI configuration and pending tables Andre Przywara
2016-04-06 13:41 ` Eric Auger
2016-06-03 14:17 ` Andre Przywara
2016-03-26 2:14 ` [PATCH v4 10/12] KVM: arm64: implement ITS command queue command handlers Andre Przywara
2016-05-05 19:12 ` Chalamarla, Tirumalesh
2016-05-25 14:34 ` Andre Przywara
2016-03-26 2:14 ` [PATCH v4 11/12] KVM: arm64: implement MSI injection in ITS emulation Andre Przywara
2016-03-26 2:14 ` [PATCH v4 12/12] KVM: arm64: enable ITS emulation as a virtual MSI controller Andre Przywara
2016-06-03 4:26 ` [PATCH v4 00/12] KVM: arm64: GICv3 ITS emulation Bharat Bhushan
2016-06-03 14:32 ` Andre Przywara
2016-06-06 5:29 ` Bharat Bhushan
2016-06-07 8:02 ` Christoffer Dall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5706783F.4040906@linaro.org \
--to=eric.auger@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).