Browse Source
This patch disables trapping to EL3 when the FEAT_FGT2 specific trap registers are accessed by setting the SCR_EL3.FGTEn2 bit Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I6d2b614affb9067b2bc3d7bf0ae7d169d031592apull/1996/merge
Arvind Ram Prakash
5 months ago
14 changed files with 142 additions and 2 deletions
@ -0,0 +1,20 @@ |
|||
/*
|
|||
* Copyright (c) 2024, Arm Limited. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
#ifndef FGT2_H |
|||
#define FGT2_H |
|||
|
|||
#include <context.h> |
|||
|
|||
#if ENABLE_FEAT_FGT2 |
|||
void fgt2_enable(cpu_context_t *ctx); |
|||
#else |
|||
static inline void fgt2_enable(cpu_context_t *ctx) |
|||
{ |
|||
} |
|||
#endif /* ENABLE_FEAT_FGT2 */ |
|||
|
|||
#endif /* FGT2_H */ |
@ -0,0 +1,27 @@ |
|||
/*
|
|||
* Copyright (c) 2024, Arm Limited. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
#include <arch.h> |
|||
#include <arch_features.h> |
|||
#include <arch_helpers.h> |
|||
#include <lib/extensions/fgt2.h> |
|||
|
|||
void fgt2_enable(cpu_context_t *context) |
|||
{ |
|||
u_register_t reg; |
|||
el3_state_t *state; |
|||
|
|||
state = get_el3state_ctx(context); |
|||
|
|||
/* Set the FGTEN2 bit in SCR_EL3 to enable access to HFGITR2_EL2,
|
|||
* HFGRTR2_EL2, HFGWTR_EL2, HDFGRTR2_EL2, and HDFGWTR2_EL2. |
|||
*/ |
|||
|
|||
reg = read_ctx_reg(state, CTX_SCR_EL3); |
|||
reg |= SCR_FGTEN2_BIT; |
|||
write_ctx_reg(state, CTX_SCR_EL3, reg); |
|||
} |
|||
|
Loading…
Reference in new issue