mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
target/arm: Define an IDAU interface
In v8M, the Implementation Defined Attribution Unit (IDAU) is a small piece of hardware typically implemented in the SoC which provides board or SoC specific security attribution information for each address that the CPU performs MPU/SAU checks on. For QEMU, we model this with a QOM interface which is implemented by the board or SoC object and connected to the CPU using a link property. This commit defines the new interface class, adds the link property to the CPU object, and makes the SAU checking code call the IDAU interface if one is present. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180220180325.29818-5-peter.maydell@linaro.org
This commit is contained in:
parent
891f3bc37f
commit
181962fd69
4 changed files with 104 additions and 3 deletions
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "target/arm/idau.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
|
@ -688,6 +689,13 @@ static void arm_cpu_post_init(Object *obj)
|
|||
}
|
||||
}
|
||||
|
||||
if (arm_feature(&cpu->env, ARM_FEATURE_M_SECURITY)) {
|
||||
object_property_add_link(obj, "idau", TYPE_IDAU_INTERFACE, &cpu->idau,
|
||||
qdev_prop_allow_set_link_before_realize,
|
||||
OBJ_PROP_LINK_UNREF_ON_RELEASE,
|
||||
&error_abort);
|
||||
}
|
||||
|
||||
qdev_property_add_static(DEVICE(obj), &arm_cpu_cfgend_property,
|
||||
&error_abort);
|
||||
}
|
||||
|
@ -1821,11 +1829,18 @@ static const TypeInfo arm_cpu_type_info = {
|
|||
.class_init = arm_cpu_class_init,
|
||||
};
|
||||
|
||||
static const TypeInfo idau_interface_type_info = {
|
||||
.name = TYPE_IDAU_INTERFACE,
|
||||
.parent = TYPE_INTERFACE,
|
||||
.class_size = sizeof(IDAUInterfaceClass),
|
||||
};
|
||||
|
||||
static void arm_cpu_register_types(void)
|
||||
{
|
||||
const ARMCPUInfo *info = arm_cpus;
|
||||
|
||||
type_register_static(&arm_cpu_type_info);
|
||||
type_register_static(&idau_interface_type_info);
|
||||
|
||||
while (info->name) {
|
||||
cpu_register(info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue