From patchwork Sat Jul 14 17:05:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10524873 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 C181560245 for ; Sat, 14 Jul 2018 21:53:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A07A228896 for ; Sat, 14 Jul 2018 21:53:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 921FA288B5; Sat, 14 Jul 2018 21:53: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=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=unavailable 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 7D5E528894 for ; Sat, 14 Jul 2018 21:53:30 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1kIiPxVGw2xnhsMv4MZD15lganFIANhD1gErjhs97VM=; b=od8W2MVJQPPgee 1gv+S8WVzXqcZ8YbwHaf936N1DupQkNHQE67I3ERqfXl61HOHWpYSSJ96NmFu9F66V49qKHiPEFtM ypU4kF7p0l4zl6kl8UsboPQb6zjAtUViu24Kd4QBAu+6orC0pGflwadgP9GYFdOdGqRFUxiL+1gPY 9WMeYFi6OGiJy08ch975T9b39+HysXjFFJX6A0mVGPxdG5UDOJOur49Qldy4mDSkU9klS/u+fKOGg oMTj1rBl9rDjDzaP1mlwkgHv5rRRDwXbFmxZRiZvrJuEvL0JdQ/iIhsMAxbhkpaBynE0SFbsh+QM2 9evSGr37zzr4ie6C7Leg==; 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 1feSTW-0003Vl-Ja; Sat, 14 Jul 2018 21:53:10 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1feSTV-0003VM-DU for linux-arm-kernel@bombadil.infradead.org; Sat, 14 Jul 2018 21:53:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KPzDmug+Cxvx1clHDmQLzx2rkFMs95rV6P2fzTmJURs=; b=bJN7MKeCO/c++Zf1XsEWBB7oFS LkgT48Tokrvh8K/qb/94vMy9qk+EGEwpa57GUC+qo0D9CtbJd4qxzUgjq1AHtQsy4Kcdfp14vxWnl PhpfC+ta3eabbl6EUII72rRFlRcHw2JhpYP1Ap93RQCqxo58++c9gTakrB4P03HpYM6KIyy2IUThZ WrUWF5d3twEi6E7y8XJAzoDr/jihJgbV00+vyp8OUXPE0LlhP+wmXbZiCBeBXkPTnA+yyhAQkPxVb fJGY8FCrK/jQVRVl7gcJccUwUcLEsPg8kKzdLutonryBqJLG+C453IXqU97oYikAugxD4X9Zz67uW 8VI8sfkQ==; Received: from mail-ve1eur03hn0234.outbound.protection.outlook.com ([104.47.9.234] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1feO0V-0000d3-CY for linux-arm-kernel@lists.infradead.org; Sat, 14 Jul 2018 17:06:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KPzDmug+Cxvx1clHDmQLzx2rkFMs95rV6P2fzTmJURs=; b=BevYMyXSYV4vnE8T8Md0XwY/JL+BHHnZAE7u+0xZnoQIodLWKbT1y8fpRAEXlkkVwybGtURFFnhnZOAJq7jNWGkvOxVZ3bBP1cp+NarhJP+lCBKjjCWhm7jMHTmj7ka5EEhsQGNhCe9srzBgLtsj1SR18i8yvkN1A0KYISZynv0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christoffer.Dall@arm.com; Received: from localhost (217.140.96.140) by DB6PR0801MB2037.eurprd08.prod.outlook.com (2603:10a6:4:76::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.19; Sat, 14 Jul 2018 17:06:09 +0000 From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 4/9] KVM: arm/arm64: vgic: Add group field to struct irq Date: Sat, 14 Jul 2018 19:05:35 +0200 Message-Id: <1531587940-2490-5-git-send-email-christoffer.dall@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531587940-2490-1-git-send-email-christoffer.dall@arm.com> References: <1531587940-2490-1-git-send-email-christoffer.dall@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: PR0P264CA0037.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1::25) To DB6PR0801MB2037.eurprd08.prod.outlook.com (2603:10a6:4:76::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23239ab7-1ca6-4b3e-e0ce-08d5e9ac1853 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB6PR0801MB2037; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB2037; 3:0jOmPO8UHCFrvTC5Vvh/f4odThkkdiN7MUJ9IGeQSI90nSOIlNdhbGGy7RvjS7drcwD9Tm+yfym2X8HR6RL7WVaFGsL9PR/Cu2Pipy2vwZ8jtjdOGTM0Nr1WkcMDqA8KOWmfpBYlIifvNz4KByInIWuIp5hb5isJRVrnpGxGHgsgDiKIagEFDwf+6cLHVTpJDS8ZPH5KKYCGmVoEQHGlPliKeKmiSqrRRJfXOdIHO23p8pkj4A7VutKvUzd0v7no; 25:kgdfAePfuKUFEZ1CdcGhTsiwb/a1UJ736RI4cww28koZqQ4CQsZHyKQzMJW98V2uHEovbW1+PFk43mLXQlRGlEacWDmnOfX3cMlQUMvyWWT96yiU2VvhrDdg7kMyNu1QQhOamF9rkEcigfLcj7KSsE/SUbBIxD5Id6+Ypx+Lp3i0+hqRP2IQyuacdsSev2rKokxT1PZWo/HWTEeNgKQLAKkpymaWGGdZXIIJqRNsErtB+C8rEj279tJ4bhkkmS1pmPrD6mPWZ5gBSGX53zmqBMOrq4yuwjpUC1wMBf67WoR4l+MeHEC5X+VWgPpJ/BCYpH56LbmMwZqsi0OMcY2Bww==; 31:bc+m1hQEvbauXC65ZLwoZ8I71R2CJNIXh+Loii+bvOKG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CRHfRw5zZPgPs7yzzGxmYwpzhM6ls1K7TO6UMnCn0Hz3QjodhYM0fUrWjFQt5D5pwM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(223705240517415); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DB6PR0801MB2037; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB2037; X-Forefront-PRVS: 07334CBCCD X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(6069001)(346002)(376002)(136003)(39850400004)(366004)(396003)(189003)(40434004)(199004)(50466002)(6116002)(53936002)(105586002)(48376002)(6666003)(44832011)(106356001)(476003)(5024004)(5660300001)(2171002)(486006)(97736004)(6486002)(3846002)(386003)(956004)(14444005)(16526019)(6496006)(575784001)(8936002)(4326008)(72206003)(478600001)(81156014)(52116002)(8746002)(25786009)(11346002)(2616005)(51416003)(446003)(305945005)(76176011)(26005)(7736002)(186003)(8676002)(47776003)(76506005)(54906003)(2906002)(50226002)(316002)(66066001)(36756003)(81166006)(68736007)(86362001)(23200700001); DIR:OUT; SFP:1501; SCL:5; SRVR:DB6PR0801MB2037; H:localhost; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0801MB2037; 23:rLJOTPRLJedTRiXZ6pYLmMfkdfbDwhfpHOlnlx1?= =?us-ascii?Q?t1UskhsUQG1Vnd/pUAodV9yhAavn6bvyAPpoKgZlIk/qDo3uJckQSanyI+sV?= =?us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6T2i1lbWei3grpktjoaswBBgH7vasLq/z3euqyhV2umH/w2Mk86Q1ZMSE3e/qnu1+gfIXPmkXzkiIcGlNFVJdHeLfoiv3Wxjrs+KgE14f2ulVbWtqLKIteb X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2018 17:06:09.2758 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23239ab7-1ca6-4b3e-e0ce-08d5e9ac1853 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2037 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180714_130655_925939_8F063905 X-CRM114-Status: GOOD ( 15.94 ) 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: Peter Maydell , kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Christoffer Dall , Eric Auger 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 In preparation for proper group 0 and group 1 support in the vgic, we add a field in the struct irq to store the group of all interrupts. We initialize the group to group 0 when emulating GICv2 and to group 1 when emulating GICv3, just like we treat them today. LPIs are always group 1. We also continue to ignore writes from the guest, preserving existing functionality, for now. Finally, we also add this field to the vgic debug logic to show the group for all interrupts. Signed-off-by: Christoffer Dall --- include/kvm/arm_vgic.h | 1 + virt/kvm/arm/vgic/vgic-debug.c | 8 +++++--- virt/kvm/arm/vgic/vgic-init.c | 19 +++++++++++++++++-- virt/kvm/arm/vgic/vgic-its.c | 1 + 4 files changed, 24 insertions(+), 5 deletions(-) -- 2.7.4 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 7e64c46..c661d0e 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -133,6 +133,7 @@ struct vgic_irq { u8 source; /* GICv2 SGIs only */ u8 active_source; /* GICv2 SGIs only */ u8 priority; + u8 group; /* 0 == group 0, 1 == group 1 */ enum vgic_irq_config config; /* Level or edge */ /* diff --git a/virt/kvm/arm/vgic/vgic-debug.c b/virt/kvm/arm/vgic/vgic-debug.c index c589d4c..d3a403f 100644 --- a/virt/kvm/arm/vgic/vgic-debug.c +++ b/virt/kvm/arm/vgic/vgic-debug.c @@ -148,6 +148,7 @@ static void print_dist_state(struct seq_file *s, struct vgic_dist *dist) seq_printf(s, "P=pending_latch, L=line_level, A=active\n"); seq_printf(s, "E=enabled, H=hw, C=config (level=1, edge=0)\n"); + seq_printf(s, "G=group\n"); } static void print_header(struct seq_file *s, struct vgic_irq *irq, @@ -162,8 +163,8 @@ static void print_header(struct seq_file *s, struct vgic_irq *irq, } seq_printf(s, "\n"); - seq_printf(s, "%s%2d TYP ID TGT_ID PLAEHC HWID TARGET SRC PRI VCPU_ID\n", hdr, id); - seq_printf(s, "---------------------------------------------------------------\n"); + seq_printf(s, "%s%2d TYP ID TGT_ID PLAEHCG HWID TARGET SRC PRI VCPU_ID\n", hdr, id); + seq_printf(s, "----------------------------------------------------------------\n"); } static void print_irq_state(struct seq_file *s, struct vgic_irq *irq, @@ -182,7 +183,7 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq, seq_printf(s, " %s %4d " " %2d " - "%d%d%d%d%d%d " + "%d%d%d%d%d%d%d " "%8d " "%8x " " %2x " @@ -197,6 +198,7 @@ static void print_irq_state(struct seq_file *s, struct vgic_irq *irq, irq->enabled, irq->hw, irq->config == VGIC_CONFIG_LEVEL, + irq->group, irq->hwintid, irq->mpidr, irq->source, diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c index 230c922..a7c19cd 100644 --- a/virt/kvm/arm/vgic/vgic-init.c +++ b/virt/kvm/arm/vgic/vgic-init.c @@ -175,10 +175,13 @@ static int kvm_vgic_dist_init(struct kvm *kvm, unsigned int nr_spis) irq->vcpu = NULL; irq->target_vcpu = vcpu0; kref_init(&irq->refcount); - if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V2) + if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V2) { irq->targets = 0; - else + irq->group = 0; + } else { irq->mpidr = 0; + irq->group = 1; + } } return 0; } @@ -227,6 +230,18 @@ int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu) /* PPIs */ irq->config = VGIC_CONFIG_LEVEL; } + + /* + * GICv3 can only be created via the KVM_DEVICE_CREATE API and + * so we always know the emulation type at this point as it's + * either explicitly configured as GICv3, or explicitly + * configured as GICv2, or not configured yet which also + * implies GICv2. + */ + if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) + irq->group = 1; + else + irq->group = 0; } if (!irqchip_in_kernel(vcpu->kvm)) diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index 4ed79c9..92840c0 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -71,6 +71,7 @@ static struct vgic_irq *vgic_add_lpi(struct kvm *kvm, u32 intid, kref_init(&irq->refcount); irq->intid = intid; irq->target_vcpu = vcpu; + irq->group = 1; spin_lock_irqsave(&dist->lpi_list_lock, flags);