From patchwork Wed Jul 4 09:38:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10506339 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 2021C603D7 for ; Wed, 4 Jul 2018 09:40:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F273D285D8 for ; Wed, 4 Jul 2018 09:40:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4AEA28DD5; Wed, 4 Jul 2018 09:40:42 +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 C8244285D8 for ; Wed, 4 Jul 2018 09:40:41 +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=S0vBCetPvlI7M7 TgcYo2L1nfSawXmtRszZEWdTfceDHeQfYvgNHD+gpXVIumENlJNuRW3vyd8bXxqUB4KtJjxdI/gJW beUc7sQz1IudcMXbx0GMh4qRQ+QQwRqWcW3GPkwNupWzK9cWNF7IA95WRJmRRqXxEf02P4Pj/jynn /fy7L1fBs6mJ0on7V2+wMx6KoX9Qoq/YIeofztZkK9iKswH6KmaH1Qj7ZnYwL/ZiZb1UrLrRR8ewk HA6fPNIM4MX2PpnAHQ4sfWCsLX5lLbLRp3y2nFQVQxvnpPgJUzfFvX56C923vcO2ZFZYKWsi49BL4 gp5nw2K1+GJnjfuP+5bg==; 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 1faeH3-0002EU-1i; Wed, 04 Jul 2018 09:40:33 +0000 Received: from mail-ve1eur03hn0219.outbound.protection.outlook.com ([104.47.9.219] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1faeFS-0000Vm-F3 for linux-arm-kernel@lists.infradead.org; Wed, 04 Jul 2018 09:39:06 +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=ci2n6qAiO7zoUS3Yhw0CGcoG8zZUqNudp7Wc2VZrk2aGCTORdR2oy4om+D+w1B7iY28wt8YmWPRlYLl/KADCpftzHVrHdcjeEkmJXjFycq2CdHpVIIazpzvTttIHyVDcfTdArR2KdEyryGhtnA2gpmFKZPOmpLwMnuNOx/E9MDg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christoffer.Dall@arm.com; Received: from localhost (217.140.96.140) by HE1PR0801MB2041.eurprd08.prod.outlook.com (2603:10a6:3:50::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Wed, 4 Jul 2018 09:38:41 +0000 From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/6] KVM: arm/arm64: vgic: Add group field to struct irq Date: Wed, 4 Jul 2018 11:38:18 +0200 Message-Id: <1530697100-22419-5-git-send-email-christoffer.dall@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530697100-22419-1-git-send-email-christoffer.dall@arm.com> References: <1530697100-22419-1-git-send-email-christoffer.dall@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM5P194CA0009.EURP194.PROD.OUTLOOK.COM (2603:10a6:203:8f::19) To HE1PR0801MB2041.eurprd08.prod.outlook.com (2603:10a6:3:50::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 478fc193-fcbb-438c-ae85-08d5e191ed79 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:HE1PR0801MB2041; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB2041; 3:o/hVj/G2AUTW7fyTQTif0aKj/haVAV145aDxBE4XhjaoAehAOnhOKPU6xAIeRBeowwh+acClS8GDaElYLipzS2GAOx8/qXf5ga+Fj4M+x93TMgXufRRt2kz6J1utR/0JbPIv48epiCrILTGmNoaFWR4YmzVYpta1roSfC+dgeC5KdyZe+Gy5SH88jlX7B3pAnRhoSj6xLJfdQ8ja9OlAf7IX6YltjBgjoxQN1kVTKORSZC4TRzi43WUxy70K+szu; 25:BxAz+xYRo95KpUo1BZNXn46yCakUxdlu5YCWrqZ+mHtgS8O13tWHXblcO1BK2JD4FNURrxzkfN+gbNxSxilbC/8r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; 4:VcOObBBV7xk2GG4uOcBLYOe73TBqW4DKHM7wMBQBK11nRkRUKEN8GcivkTX9gz0AI52UEjIQfJ5tUSaIcNnWjI2FT+ZUK4LK94A/fwm3QJUhPnjLkTdQAKO/CfAxW6kjnn5PbxHwJg9ssDpe0LR2Ab9MAjJeP4uSBIzDVttZjZFSE598C9YaDEPujQ0GQpt8OzcaUoyjL0VsQau/fzCVqkUq1fiUUawgVUX8wDybSlMt/5DVc7f3UZTn5KBQi7cnGu48T01rQgKmkucF3rSF6xwDorGg8QsjpAb538bR5yRNYxYXowKUXa8X0PLfwZyvFC0Zx5WHDrB+d1pen9o4Uxxym6Mh1+tfnmSnjMU5Hak= 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)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:HE1PR0801MB2041; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB2041; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:SPM; SFS:(10009020)(6069001)(39860400002)(396003)(136003)(366004)(346002)(376002)(40434004)(189003)(199004)(48376002)(52116002)(76176011)(478600001)(51416003)(6496006)(7736002)(305945005)(81166006)(5660300001)(36756003)(72206003)(68736007)(2906002)(54906003)(8676002)(8936002)(50466002)(81156014)(50226002)(8746002)(6486002)(316002)(106356001)(6666003)(3846002)(6116002)(76506005)(2171002)(11346002)(446003)(105586002)(16526019)(86362001)(956004)(476003)(186003)(2616005)(5024004)(47776003)(14444005)(66066001)(25786009)(53936002)(575784001)(44832011)(26005)(97736004)(486006)(4326008)(386003)(23200700001); DIR:OUT; SFP:1501; SCL:5; SRVR:HE1PR0801MB2041; 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; HE1PR0801MB2041; 23:dM6kOQq44+roxKcOZmIqXBeyvaoG2JbYlT8BnkB?= =?us-ascii?Q?lYIGpIZqg/nPZuOfplzLTvgW/I0azd9MxOmAJ5jJwDyrmAhLF0y4ypbzxBDI?= =?us-ascii?Q?/BOgK/JEyQCHOTarVa5AeIeQjBopQQBKEtUIcEeuz+Z5WSeGP4eh0WvIA7Hn?= =?us-ascii?Q?aIHPBmQ/p8j/wL3Z0OptB1WOXmjVDOQDhUlwPCfh83sQA+GtGk7qb5Mc/Kon?= =?us-ascii?Q?NCLYtpurQORX9R0Q7dIddoKpFE5j+xG9Z4XnzA5mfZcGJ7PIBrwCLOg+ylb0?= =?us-ascii?Q?JBHMH4HUWQkSRDlevP8DKTYjINU2SPHpjbc61zYvhGTCvcUhKMB3u0OH20bg?= =?us-ascii?Q?ovYulkFNqqOIL7Vf4rhcCyE5cHBVyoOq8Q/OEI2qG9vkTJulS/Yx/vx/+sz2?= =?us-ascii?Q?uvnOkzJTkwzvPch4QnM1IKzoLq7em5VhXPb9E4ZMNcg2lDxgOpuqyzhEAUqb?= =?us-ascii?Q?YKnLD5UZleDBaR1HKCpPvG+MF0jsBUI992j9lGrKi6fmjpe+d7oIarorirAz?= =?us-ascii?Q?ECZXZwXJ8Mv1aKyY/nQCh5sIsK1lHF5bYR0KlNin5HAU/Ar1xqnfV433koY2?= =?us-ascii?Q?ZaBQLJKARnxJy1nqGu4SqDd1GBSKxn/LvBVehX4rqP54i8XXMJIi1ofVU+5m?= =?us-ascii?Q?CKsH5N9g1D0F+7uP61ifWW7XlUpLQqZvj2G197bwSnKFmVu2EUiqk4p3tf9u?= =?us-ascii?Q?bfsUo2w99JSPOhWvOtbhi14EYWAfwaR+uGnWV31XO7M54Rf14sBK8da5x7Lo?= =?us-ascii?Q?NPOjhoXgs/t0wBOngj+Zr6J++69rB7r3sCuA/ulamFHZ82X3VqBf3MmAtPZi?= =?us-ascii?Q?xi+R78xxizOO+UcZWdsYw/j75A33P5KYG8VFoxmdHJwrvhFlxs9Ft5D+rdX5?= =?us-ascii?Q?VYuqmtgCRVQUc1BiGeIE97lpX/H3Un6xKSA4D746K8CH/DIh9K3Ld6GIAZeW?= =?us-ascii?Q?aC59uvv75dySGRXWVDTe9SHy969Kgcn8x+j3kUHHX5dxxqsIuoPu4AFq6Lxk?= =?us-ascii?Q?OYonPhVnb9Qh2RrJxTG+ywwKTqttvECZEC4mjIiyVqcwXd/5Hk/2DRbLqtKG?= =?us-ascii?Q?W+Uo8PiZ5oF27UdQ2vqcE/jC+GbaILahES35ri9+llxlMA6myYIjX11vTekk?= =?us-ascii?Q?W2icrF0za2KMyzgvAxJEO52ha3UA+FImL+2UaDVsnHa4nAWIUIxxJwsfBXcC?= =?us-ascii?Q?cJMhIlp2SqQEn0OjnpLz8ci7WzHbycDDJkxEcSA0u97sgwBDvb0kQgB+3d3e?= =?us-ascii?Q?KjEvpqwSncgYnqZjye0aif/ilrBHbkQRIJbJ21itS7k/36m5J5cfKKRvWy+e?= =?us-ascii?Q?06ioJ35Wz62H228Esbw9kRbfSedbix/ApIDDOZqRuJ261hIdKfIlHEpyQ8K8?= =?us-ascii?Q?m79e5HzXp8vJV++2p+TLrdfybP7S/geqqvHP+Z6mRALyi6JFy?= X-Microsoft-Antispam-Message-Info: p3b598fHZRywmcXgm18yo6SAwsvwBucu6aTmavHgUvbnzYiqmrCkREcG0JyjpcrW4P/Bhjd0XPSl9nCbr0A+915OAXieu7kSfmXfwZIMWMsIh04wn9ISDNir7ZyIqddThBFcg5m+cMTRfZt2t3u00s2dxNrVZXAMn8DZI1GhqALr0HXdTRpNAfpbnjtJd6pZv7Ywd1NU/3q8YWUJCz4BQteCdH+uJ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/gl9dDX6Xxf8IdnT424YlBA0yuZW6wsVltuZqA7rUZufiToUCbaX4GFIiai+6N46SLCi1tUBbwDLkQ== SpamDiagnosticOutput: 1:22 X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB2041; 7:Go+JVBud1uphNvxyX1B5mwyZunjYF5SFbzGO41YoYeefCXa5kmdajOchz5elLLBZDfoVf8cg7EWtlLKgAK/DCh3MxutB6EbDDNwxM3gm/JNJlsKrWQHkiXFNX0N+cCAU7bgdQVTHw/q+Mj0v46xEJekqNI7gsJDAIfa2fHipk4vXZmF9nQZ4vaiKaby0LWSCPpRc0OWlTpi9zRSqHwJVVthvPtYrbyQqgLWaL4UY0QSBm2XZEQEsxyj9v39Fbx5n X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 09:38:41.1223 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 478fc193-fcbb-438c-ae85-08d5e191ed79 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2041 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180704_023855_506162_BD3A1655 X-CRM114-Status: GOOD ( 16.62 ) 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);