From patchwork Mon Jun 25 09:34:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10485365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DF4AC60230 for ; Mon, 25 Jun 2018 09:34:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE52B2894D for ; Mon, 25 Jun 2018 09:34:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2CB52895A; Mon, 25 Jun 2018 09:34:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3CBB82894D for ; Mon, 25 Jun 2018 09:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TkCec92WIhRThcxWodOJmLRX5QMIrze1EABH8FyFfGc=; b=YY9GmNNKY6rNlm SCaRJDwtc2SoXSAtOULA7DtVWMDbhwSqOBOcnWDKo19pAmhUAyXNdSf3Rbh9Wc6Eff5bxV/TfwEpr 5lZiqTnjvGgYeb76yo27e5R6JnJbhLfDqpvuc3Xjx/hicQ9TIvWm03DaCwPGZ+M/jBcpFvx+CEoEm Giwyjrh420kCdyskgyF1LR2mne2FHq4swqzXqhNQjzxsS2OonHDhYwpdcqSNpPrHScYYCTSTDjiq9 vWeAXxXdSyvzpdFvoM9+o6mV+plxs9m0vgZf6nurSKgQl2aLB9krM4R3pHW9g+gcTKHDQEXZmPkid U/3hU0C9xB5oVmvC6Zsw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXNt9-0005UD-VH; Mon, 25 Jun 2018 09:34:24 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXNt7-0005Th-36 for linux-arm-kernel@lists.infradead.org; Mon, 25 Jun 2018 09:34:22 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 388AB18A; Mon, 25 Jun 2018 02:34:09 -0700 (PDT) Received: from localhost (unknown [10.37.8.103]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9AA9C3F59C; Mon, 25 Jun 2018 02:34:08 -0700 (PDT) Date: Mon, 25 Jun 2018 11:34:06 +0200 From: Christoffer Dall To: Marc Zyngier Subject: Re: [PATCH 4/4] KVM: arm/arm64: vgic: Allow VMs to configure interrupt groups Message-ID: <20180625093406.GC8004@C02W217FHV2R.local> References: <20180624221103.15055-1-christoffer.dall@arm.com> <20180624221103.15055-5-christoffer.dall@arm.com> <2f5feed6-c026-1871-25e4-943123c8b977@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2f5feed6-c026-1871-25e4-943123c8b977@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180625_023421_160361_8EC60EB6 X-CRM114-Status: GOOD ( 20.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andre Przywara , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jun 25, 2018 at 09:19:07AM +0100, Marc Zyngier wrote: > On 24/06/18 23:11, Christoffer Dall wrote: > > Implement the required MMIO accessors for GICv2 and GICv3 for the > > IGROUPR distributor and redistributor registers. > > > > This can allow guests to change behavior compared to running on previous > > versions of KVM, but only to align with the architecture and hardware > > implementations. > > > > Signed-off-by: Christoffer Dall > > --- > > virt/kvm/arm/vgic/vgic-mmio-v2.c | 2 +- > > virt/kvm/arm/vgic/vgic-mmio-v3.c | 2 +- > > virt/kvm/arm/vgic/vgic-mmio.c | 38 ++++++++++++++++++++++++++++++++ > > virt/kvm/arm/vgic/vgic-mmio.h | 6 +++++ > > 4 files changed, 46 insertions(+), 2 deletions(-) > > > > diff --git a/virt/kvm/arm/vgic/vgic-mmio-v2.c b/virt/kvm/arm/vgic/vgic-mmio-v2.c > > index 8d18f89397d3..ff3834d16ac9 100644 > > --- a/virt/kvm/arm/vgic/vgic-mmio-v2.c > > +++ b/virt/kvm/arm/vgic/vgic-mmio-v2.c > > @@ -362,7 +362,7 @@ static const struct vgic_register_region vgic_v2_dist_registers[] = { > > vgic_mmio_read_v2_misc, vgic_mmio_write_v2_misc, 12, > > VGIC_ACCESS_32bit), > > REGISTER_DESC_WITH_BITS_PER_IRQ(GIC_DIST_IGROUP, > > - vgic_mmio_read_raz, vgic_mmio_write_wi, NULL, NULL, 1, > > + vgic_mmio_read_group, vgic_mmio_write_group, NULL, NULL, 1, > > VGIC_ACCESS_32bit), > > REGISTER_DESC_WITH_BITS_PER_IRQ(GIC_DIST_ENABLE_SET, > > vgic_mmio_read_enable, vgic_mmio_write_senable, NULL, NULL, 1, > > diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c > > index 287784095b5b..76e422859745 100644 > > --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c > > +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c > > @@ -451,7 +451,7 @@ static const struct vgic_register_region vgic_v3_dist_registers[] = { > > vgic_mmio_read_rao, vgic_mmio_write_wi, 4, > > VGIC_ACCESS_32bit), > > REGISTER_DESC_WITH_BITS_PER_IRQ_SHARED(GICD_IGROUPR, > > - vgic_mmio_read_rao, vgic_mmio_write_wi, NULL, NULL, 1, > > + vgic_mmio_read_group, vgic_mmio_write_group, NULL, NULL, 1, > > VGIC_ACCESS_32bit), > > REGISTER_DESC_WITH_BITS_PER_IRQ_SHARED(GICD_ISENABLER, > > vgic_mmio_read_enable, vgic_mmio_write_senable, NULL, NULL, 1, > > I think you're missing the GICR_IGROUPR accessor in the redistributor > (despite mentioning it in the commit message). > Indeed. I fixed this up on my kernel.org branch (vgic-group-fixes), and the fix is pretty trivial: I did a test on the model using both GICv3 and GICv2-on-GICv3, seems happy still. Do you want me to send a v2, or do you prefer to fix this up locally? Thanks, -Christoffer diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c index 76e422859745..d2acad07dd30 100644 --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c @@ -524,7 +524,7 @@ static const struct vgic_register_region vgic_v3_rdbase_registers[] = { static const struct vgic_register_region vgic_v3_sgibase_registers[] = { REGISTER_DESC_WITH_LENGTH(GICR_IGROUPR0, - vgic_mmio_read_rao, vgic_mmio_write_wi, 4, + vgic_mmio_read_group, vgic_mmio_write_group, 4, VGIC_ACCESS_32bit), REGISTER_DESC_WITH_LENGTH(GICR_ISENABLER0, vgic_mmio_read_enable, vgic_mmio_write_senable, 4,