Skip to content

Commit 8df747f

Browse files
author
Marc Zyngier
committed
KVM: arm64: nv: Plumb handling of AT S1* traps from EL2
Hooray, we're done. Plug the AT traps into the system instruction table, and let it rip. Signed-off-by: Marc Zyngier <[email protected]>
1 parent d95bb9e commit 8df747f

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2803,6 +2803,36 @@ static const struct sys_reg_desc sys_reg_descs[] = {
28032803
EL2_REG(SP_EL2, NULL, reset_unknown, 0),
28042804
};
28052805

2806+
static bool handle_at_s1e01(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
2807+
const struct sys_reg_desc *r)
2808+
{
2809+
u32 op = sys_insn(p->Op0, p->Op1, p->CRn, p->CRm, p->Op2);
2810+
2811+
__kvm_at_s1e01(vcpu, op, p->regval);
2812+
2813+
return true;
2814+
}
2815+
2816+
static bool handle_at_s1e2(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
2817+
const struct sys_reg_desc *r)
2818+
{
2819+
u32 op = sys_insn(p->Op0, p->Op1, p->CRn, p->CRm, p->Op2);
2820+
2821+
__kvm_at_s1e2(vcpu, op, p->regval);
2822+
2823+
return true;
2824+
}
2825+
2826+
static bool handle_at_s12(struct kvm_vcpu *vcpu, struct sys_reg_params *p,
2827+
const struct sys_reg_desc *r)
2828+
{
2829+
u32 op = sys_insn(p->Op0, p->Op1, p->CRn, p->CRm, p->Op2);
2830+
2831+
__kvm_at_s12(vcpu, op, p->regval);
2832+
2833+
return true;
2834+
}
2835+
28062836
static bool kvm_supported_tlbi_s12_op(struct kvm_vcpu *vpcu, u32 instr)
28072837
{
28082838
struct kvm *kvm = vpcu->kvm;
@@ -3065,6 +3095,14 @@ static struct sys_reg_desc sys_insn_descs[] = {
30653095
{ SYS_DESC(SYS_DC_ISW), access_dcsw },
30663096
{ SYS_DESC(SYS_DC_IGSW), access_dcgsw },
30673097
{ SYS_DESC(SYS_DC_IGDSW), access_dcgsw },
3098+
3099+
SYS_INSN(AT_S1E1R, handle_at_s1e01),
3100+
SYS_INSN(AT_S1E1W, handle_at_s1e01),
3101+
SYS_INSN(AT_S1E0R, handle_at_s1e01),
3102+
SYS_INSN(AT_S1E0W, handle_at_s1e01),
3103+
SYS_INSN(AT_S1E1RP, handle_at_s1e01),
3104+
SYS_INSN(AT_S1E1WP, handle_at_s1e01),
3105+
30683106
{ SYS_DESC(SYS_DC_CSW), access_dcsw },
30693107
{ SYS_DESC(SYS_DC_CGSW), access_dcgsw },
30703108
{ SYS_DESC(SYS_DC_CGDSW), access_dcgsw },
@@ -3144,6 +3182,13 @@ static struct sys_reg_desc sys_insn_descs[] = {
31443182
SYS_INSN(TLBI_VALE1NXS, handle_tlbi_el1),
31453183
SYS_INSN(TLBI_VAALE1NXS, handle_tlbi_el1),
31463184

3185+
SYS_INSN(AT_S1E2R, handle_at_s1e2),
3186+
SYS_INSN(AT_S1E2W, handle_at_s1e2),
3187+
SYS_INSN(AT_S12E1R, handle_at_s12),
3188+
SYS_INSN(AT_S12E1W, handle_at_s12),
3189+
SYS_INSN(AT_S12E0R, handle_at_s12),
3190+
SYS_INSN(AT_S12E0W, handle_at_s12),
3191+
31473192
SYS_INSN(TLBI_IPAS2E1IS, handle_ipas2e1is),
31483193
SYS_INSN(TLBI_RIPAS2E1IS, handle_ripas2e1is),
31493194
SYS_INSN(TLBI_IPAS2LE1IS, handle_ipas2e1is),

0 commit comments

Comments
 (0)