From patchwork Thu Dec 7 16:14:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 121022 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8556477qgn; Thu, 7 Dec 2017 08:16:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMbx9ZaVH3Xw/SA1o1NT4lj3J6EHiGOf/m8tyMyhOf1J+PCMVae+Wfvw9pYT2Lr/nhJ6AI9y X-Received: by 10.107.128.1 with SMTP id b1mr40838144iod.164.1512663410262; Thu, 07 Dec 2017 08:16:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512663410; cv=none; d=google.com; s=arc-20160816; b=OtUhj63gy6dwrYg8jasU9qctcCOjsAb/A6zXP7YNvoWgzkeDKtjBbRpZvA/uvlnGA9 YZT9ygDSau5vxps+BvPQ5DXh7WwaFtQZN5K6hQDbxGsx2KWtXVwzLyVyPFzfXVuDsCO+ /Af0xUlSdbS6foG6j2obBSQRWETG3A0CSRHDYQDaXOhFs8orQlQcJntjljMJJEWsSNcf 3+rRj/nuYYc6cXJv60LCKEwtQJAiNH/NQqDjxIAlS8fpW8lXgb5u8XKZUjZawLvP9zIH E6hAh2IFB7p2U/qbXNPP/XBpJunD4NkIXAUjutv0TArP72JtWw47VgMxOTz8N7/327sp nY5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=OiCIVngKavbW3VYnLLTH3NrdoPhxEg/+U8nf6A2yfDw=; b=M3pD5MZRV9zxPMg1PoDEuA8/KgQhtBZiWXmBRXBSby9Hnmj9JuCt6xJXOCDkl+Ly7A JdL1DNNFQ+u8Chg0L8SHYpWadOAlKMpWuyv2ZqNtX7F7maJVVm4L9FMhkcWxn/2Lf7QT 81LD5aF1SyMYIc6RpNZG9ARXQBMqcElnXRqmPihc04paH14b9FCvLZbFSOBknAERDoF1 nkwzH7uvHlAcowETcrSbu08rZv4RwQse+0FV8VsRSwctghQWWJKpz7vGgzWu4czvdgTU a2g/pGOAtK6nv0tytHDkl0K17UrZcm0lnonuIxHx5PqgMqHDjWNiujxuUWM9R8CuWnt+ 1jbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iFUbbE5h; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id r79si3610247ior.36.2017.12.07.08.16.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 08:16:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iFUbbE5h; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMyoU-00029e-2e; Thu, 07 Dec 2017 16:14:18 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMyoT-00029I-2h for xen-devel@lists.xenproject.org; Thu, 07 Dec 2017 16:14:17 +0000 X-Inumbo-ID: 9d20ce16-db69-11e7-b4a6-bc764e045a96 Received: from mail-wr0-x230.google.com (unknown [2a00:1450:400c:c0c::230]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9d20ce16-db69-11e7-b4a6-bc764e045a96; Thu, 07 Dec 2017 17:13:51 +0100 (CET) Received: by mail-wr0-x230.google.com with SMTP id g53so8066909wra.2 for ; Thu, 07 Dec 2017 08:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=cp/b7g5kpD7Ez44ZDpDU9mh9xIDKoobR8aMC86fIUCE=; b=iFUbbE5hWvi90IYV7exMj8BHO0dnKrySg5QzKTeXplsiAtS/JbVF4UmBPxuHaI/hht lODv7wmiT4ajCg/mpeSE2bq7MeSDcMVLRQt/iuqxyStmLX3i5TJ7qtcb4zSOvm0TpdKh qbV5m9wn4u8XYPYDPjtFPsEWNYBkivvmNIth4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cp/b7g5kpD7Ez44ZDpDU9mh9xIDKoobR8aMC86fIUCE=; b=QEX60TNIeGOixfeFv+LAOSxrUnLvVsBJciXFtArgSDOn/Co5JPymF08WNhB/254Gcx Ty5l0RbxPLCJGmxwkgxC79uhPJspFgG2EIBbKnVkK8tefM4Ji1hKwDBYMz4YDiqF/33b wAlpX7CBJ1GupDwMB0hGDTg7dspj0zj9tg2rVyVdPyY7ZfTBv1xGBq7Nr1yHhdaAaw/j W+iCwJv9SceBR92FhTnbzIspiQr98IIJY5cF/9hmNq/P8j1UgcyhmbPix/+HMyPL0246 sZavmqFtqcWfy/Y6qq4dnoxAOz3XzHs9EoTOJTjcloSO/ImWThpjDRvLnGlJKoXZOZwr Fb5g== X-Gm-Message-State: AKGB3mIUWXQRK8t/7xuFLQoOqyh1uBZtYYJv4dBN+mKYMlC5GBVoTk1F Y5FeOPoNXMDLL6DeWBqF00CNtw== X-Received: by 10.223.169.68 with SMTP id u62mr18646256wrc.30.1512663254239; Thu, 07 Dec 2017 08:14:14 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id f18sm6090624wrg.66.2017.12.07.08.14.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Dec 2017 08:14:13 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Thu, 7 Dec 2017 16:14:05 +0000 Message-Id: <20171207161415.20380-1-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH v2 00/10] ARM: VGIC/GIC separation cleanups X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi, a reworked version of this series, addressing Stefano's comments. Although I don't fully agree, I decided to drop the patches that Stefano didn't like (3/12, 5/12, 8/12), instead moved the functions in question into the new gic-vgic.c file, where they are out of the way for any new VGIC as well. I also fixed the smaller comments and added the tags so far. Let me know how this looks! Cheers, Andre Changelog: 01, 02, 03: add tags 04: unchanged 05: update to include non-moved functions (caused by the dropped patches) 06: rework to keep vgic info dump in gic-vgic.c 07, 08, 09: add tags 10: use newly introduced INVALID_IRQ ================ By the original VGIC design, Xen differentiates between the actual VGIC emulation on one hand and the GIC hardware accesses on the other. It seems there were some deviations from that scheme (over time?), so at the moment we end up happily accessing VGIC specific data structures like struct pending_irq and struct vgic_irq_rank from pure GIC files like gic.c or even irq.c (try: git grep -l struct\ pending_irq xen/arch/arm). But any future VGIC rework will depend on a clean separation, so this series tries to clean this up. It starts with some rather innocent patches, reaches its peak with the heavy patch 5/10, and calms down in the rest of the series again. After this series there are no more references to VGIC structures from GIC files, at least for non-ITS code. The ITS is a beast own its own (blame the author) and will be addressed later. Andre Przywara (10): ARM: remove unneeded gic.h inclusions ARM: vGIC: fix nr_irq definition ARM: VGIC: move gic_remove_irq_from_queues() ARM: VGIC: streamline gic_restore_pending_irqs() ARM: VGIC: split gic.c to observe hardware/virtual GIC separation ARM: VGIC: split up gic_dump_info() to cover virtual part separately ARM: VGIC: rework events_need_delivery() ARM: VGIC: factor out vgic_connect_hw_irq() ARM: VGIC: factor out vgic_get_hw_irq_desc() ARM: VGIC: rework gicv[23]_update_lr to not use pending_irq xen/arch/arm/Makefile | 1 + xen/arch/arm/domain.c | 2 + xen/arch/arm/domain_build.c | 1 - xen/arch/arm/gic-v2.c | 14 +- xen/arch/arm/gic-v3.c | 12 +- xen/arch/arm/gic-vgic.c | 471 +++++++++++++++++++++++++++++++++++ xen/arch/arm/gic.c | 430 +------------------------------- xen/arch/arm/irq.c | 9 +- xen/arch/arm/p2m.c | 1 - xen/arch/arm/platforms/vexpress.c | 1 - xen/arch/arm/platforms/xgene-storm.c | 1 - xen/arch/arm/time.c | 1 - xen/arch/arm/traps.c | 3 +- xen/arch/arm/vgic-v3-its.c | 4 +- xen/arch/arm/vgic.c | 22 +- xen/arch/arm/vpsci.c | 1 - xen/arch/arm/vtimer.c | 1 - xen/include/asm-arm/event.h | 13 +- xen/include/asm-arm/gic.h | 8 +- xen/include/asm-arm/irq.h | 5 +- xen/include/asm-arm/vgic.h | 7 + 21 files changed, 541 insertions(+), 467 deletions(-) create mode 100644 xen/arch/arm/gic-vgic.c