mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
ARM: ITS: Deny hardware domain access to ITS
This patch extends the gicv3_iomem_deny_access functionality by adding support for ITS region as well. Add function gicv3_its_deny_access. Signed-off-by: Manish Jaggi <mjaggi@cavium.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
1 parent
1421ddad4a
commit
66158be465
3 files changed
+35
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include <xen/acpi.h>
|
||||
#include <xen/lib.h>
|
||||
#include <xen/delay.h>
|
||||
#include <xen/iocap.h>
|
||||
#include <xen/libfdt/libfdt.h>
|
||||
#include <xen/mm.h>
|
||||
#include <xen/rbtree.h>
|
||||
@@ -905,6 +906,27 @@ struct pending_irq *gicv3_assign_guest_event(struct domain *d,
|
||||
return pirq;
|
||||
}
|
||||
|
||||
int gicv3_its_deny_access(const struct domain *d)
|
||||
{
|
||||
int rc = 0;
|
||||
unsigned long mfn, nr;
|
||||
const struct host_its *its_data;
|
||||
|
||||
list_for_each_entry( its_data, &host_its_list, entry )
|
||||
{
|
||||
mfn = paddr_to_pfn(its_data->addr);
|
||||
nr = PFN_UP(its_data->size);
|
||||
rc = iomem_deny_access(d, mfn, mfn + nr);
|
||||
if ( rc )
|
||||
{
|
||||
printk("iomem_deny_access failed for %lx:%lx \r\n", mfn, nr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the respective guest DT nodes from a list of host ITSes.
|
||||
* This copies the reg property, so the guest sees the ITS at the same address
|
||||
|
||||
@@ -1308,6 +1308,10 @@ static int gicv3_iomem_deny_access(const struct domain *d)
|
||||
if ( rc )
|
||||
return rc;
|
||||
|
||||
rc = gicv3_its_deny_access(d);
|
||||
if ( rc )
|
||||
return rc;
|
||||
|
||||
for ( i = 0; i < gicv3.rdist_count; i++ )
|
||||
{
|
||||
mfn = gicv3.rdist_regions[i].base >> PAGE_SHIFT;
|
||||
|
||||
@@ -139,6 +139,10 @@ void gicv3_its_dt_init(const struct dt_device_node *node);
|
||||
#ifdef CONFIG_ACPI
|
||||
void gicv3_its_acpi_init(void);
|
||||
#endif
|
||||
|
||||
/* Deny iomem access for its */
|
||||
int gicv3_its_deny_access(const struct domain *d);
|
||||
|
||||
bool gicv3_its_host_has_its(void);
|
||||
|
||||
unsigned int vgic_v3_its_count(const struct domain *d);
|
||||
@@ -206,6 +210,11 @@ static inline void gicv3_its_acpi_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int gicv3_its_deny_access(const struct domain *d)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool gicv3_its_host_has_its(void)
|
||||
{
|
||||
return false;
|
||||
|
||||