From: Chris Patterson <cjp256@gmail.com>
To: xen-devel@lists.xen.org
Cc: Chris Patterson <pattersonc@ainfosec.com>,
julien.grall@arm.com, sstabellini@kernel.org,
temkink@ainfosec.com
Subject: [PATCH 5/6] xen/arm: Add function to query IRQ 'ownership'
Date: Thu, 6 Apr 2017 15:47:53 -0400 [thread overview]
Message-ID: <1491508074-31647-6-git-send-email-cjp256@gmail.com> (raw)
In-Reply-To: <1491508074-31647-1-git-send-email-cjp256@gmail.com>
From: "Chris Patterson" <pattersonc@ainfosec.com>
The addition of new IRQ-related platform hooks now allow platforms to
perform platform-specific interrupt logic, such as allowing virtualization
of platform-specific interrupt controller hardware.
This commit adds the ability for the platform to identify the domain
a given IRQ is routed to, allowing platform logic to deny access to
registers associated with a given IRQ unless the requesting domain
'owns' the IRQ. This will be used on Tegra platforms, where the hardware
domain needs access to its legacy interrupt controller, but should not
be able to control registers that correspond to other domains' IRQs, or
sections associated with IRQs routed to Xen.
Authored-by: Kyle Temkin <temkink@ainfosec.com>
Signed-off-by: Kyle Temkin <temkink@ainfosec.com>
Signed-off-by: Chris Patterson <pattersonc@ainfosec.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
changes since rfc:
- formatting & code style cleanup
---
xen/arch/arm/irq.c | 10 ++++++++++
xen/include/asm-arm/irq.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 0b4eaa9..51bce58 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -143,6 +143,16 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
return irq_get_guest_info(desc)->d;
}
+domid_t irq_get_domain_id(struct irq_desc *desc)
+{
+ /* If this domain isn't routed to a guest, return DOMID_XEN. */
+ if ( !test_bit(_IRQ_GUEST, &desc->status) )
+ return DOMID_XEN;
+
+ /* Otherise, get the guest domain's information. */
+ return irq_get_domain(desc)->domain_id;
+}
+
void irq_set_affinity(struct irq_desc *desc, const cpumask_t *cpu_mask)
{
if ( desc != NULL )
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index 4849f16..d0fd6db 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -44,6 +44,8 @@ int route_irq_to_guest(struct domain *d, unsigned int virq,
unsigned int irq, const char *devname);
int release_guest_irq(struct domain *d, unsigned int irq);
+domid_t irq_get_domain_id(struct irq_desc *desc);
+
void arch_move_irqs(struct vcpu *v);
#define arch_evtchn_bind_pirq(d, pirq) ((void)((d) + (pirq)))
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-04-06 19:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 19:47 [PATCH 0/6] Initial Tegra platform support Chris Patterson
2017-04-06 19:47 ` [PATCH 1/6] xen/arm: platforms: Add earlyprintk and serial support for Tegra boards Chris Patterson
2017-04-13 23:09 ` Stefano Stabellini
2017-04-18 7:49 ` Julien Grall
2017-04-19 20:37 ` Chris Patterson
2017-04-06 19:47 ` [PATCH 2/6] xen/arm: domain_build: Inherit GIC's interrupt-parent from host device tree Chris Patterson
2017-04-18 8:01 ` Julien Grall
2017-04-19 20:09 ` Christopher Patterson
2017-04-06 19:47 ` [PATCH 3/6] xen/arm: Allow platforms to hook IRQ routing Chris Patterson
2017-04-13 23:26 ` Stefano Stabellini
2017-04-06 19:47 ` [PATCH 4/6] xen/arm: platforms: Add Tegra platform to support basic " Chris Patterson
2017-04-13 23:46 ` Stefano Stabellini
2017-04-17 15:03 ` Chris Patterson
2017-04-18 7:58 ` Julien Grall
2017-07-06 22:00 ` Chris Patterson
2017-07-07 16:25 ` Julien Grall
2017-07-07 18:08 ` Chris Patterson
2017-07-26 16:49 ` Julien Grall
2017-04-18 8:26 ` Julien Grall
2017-07-06 23:12 ` Chris Patterson
2017-07-07 16:30 ` Julien Grall
2017-07-07 18:53 ` Chris Patterson
2017-07-24 19:38 ` Chris Patterson
2017-07-26 16:10 ` Julien Grall
2017-04-06 19:47 ` Chris Patterson [this message]
2017-04-18 8:27 ` [PATCH 5/6] xen/arm: Add function to query IRQ 'ownership' Julien Grall
2017-04-06 19:47 ` [PATCH 6/6] xen/arm: platforms/tegra: Ensure the hwdom can only affect its own interrupts Chris Patterson
2017-04-13 23:54 ` Stefano Stabellini
2017-04-18 8:39 ` Julien Grall
2017-07-06 23:13 ` Chris Patterson
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=1491508074-31647-6-git-send-email-cjp256@gmail.com \
--to=cjp256@gmail.com \
--cc=julien.grall@arm.com \
--cc=pattersonc@ainfosec.com \
--cc=sstabellini@kernel.org \
--cc=temkink@ainfosec.com \
--cc=xen-devel@lists.xen.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).