From nobody Sat Dec 28 06:37:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1733501062; cv=none; d=zohomail.com; s=zohoarc; b=NaAtrdzOASyP+cmVLO0P8g6YqUUcBJMWjA3dfFQFur58h9UM9PGh3MJzwBCUtpb1S6E6OFYi5CmA0CQY43ugVY6m3I6o7eEkpbtbTiXl82X3GgXQYn9Djgtf0L69lFkyU41m3kimI6MlLZSEW7hxAXu+0VpxuKJI+FfzElCWo0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733501062; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lSUUCyFArbxy+0GSSuSuEHiOsnV3phawKrAnzeeaAVQ=; b=VsnsJMcuvx3bCk+vOOowOh3d6fX60h0GZn3uVaQJVfxZd18i+qZW5i5/NBHbr6+wV7VKB7U8Z7dl5vGvn0XY8Lj/TcMuwOQGu+HA5CNlBSTzW5+HvnHVSjPSR2zCvkhUrhYZ21NTGmMETeVBu/1hZnMRR8DlcnmxBkBsh8/ChrY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1733501062650948.7923800169813; Fri, 6 Dec 2024 08:04:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJan8-0007iM-BZ; Fri, 06 Dec 2024 11:02:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJan2-0007fu-9R for qemu-devel@nongnu.org; Fri, 06 Dec 2024 11:02:49 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJamx-0006Uj-V1 for qemu-devel@nongnu.org; Fri, 06 Dec 2024 11:02:47 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-434a0fd9778so22086345e9.0 for ; Fri, 06 Dec 2024 08:02:42 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d526b14csm99454085e9.2.2024.12.06.08.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 08:02:40 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A7D845F9FB; Fri, 6 Dec 2024 16:02:39 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733500961; x=1734105761; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lSUUCyFArbxy+0GSSuSuEHiOsnV3phawKrAnzeeaAVQ=; b=SYIjXB8OZa//AgRVRBubs0gtK6U9W73UEFwJm0SCbEdou080SJ6c4HqO0a8B9mssql brz/Jg8PbJio6DlN0bDkyfOZH6gSxdfpk9yIecaSfwUGf4Ad1lZpzoiMIjAk7vJGQ5cE Ypc+Kwn9p1WhnVUkJRwIUMWQlGys7v0uGjt+HEddEDQL5Q2ppOxQ+OtCIK85ZY1rIxAc a0MAJJZQsFdbKWF2rCoy5wr1xWTRTvJYdoKswXMBSVSPElZJ0Pu/J3dTqWr2JLkggmrI cQZw+66GgVb2C6ulKpoOD79qMWrGFE1R01zYHnWssqh/h44LtEFg9OEBcpOwaRDwMsxK 6Ijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733500961; x=1734105761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lSUUCyFArbxy+0GSSuSuEHiOsnV3phawKrAnzeeaAVQ=; b=AtPNEXgNaTRr+KBnIoQEOn7NlYDcTcGvpSlgCXSUeI1EpLJ4ESgsKUZBvUWsvc4ZCr AfzX6y1WVwpS8F9FagKvYyZFmex4LNfMlMYAwhgMZQeHdKy8kMt9zAEaoV3luPCe9mRw e3GfxrBohCPPdKfJrN3CZjO50FLS+0SFCKypF0gx/eNBu6OMGsIwJpnCkyJjOQ5e/lSH 2SC4OUkbedfKcFH5AxRJvAvqaxhz3U2/UnMus2timo7RMVBvFKH2tblEKX/DQzZkANDA TaFhj4oT3Hi2Z+gG66946WlwIaQVrykUbeNAfNo+IyKrbVnyGzjZPoESeo3r7iotoHOJ hE0Q== X-Gm-Message-State: AOJu0YxZpPtX02S+TH1PqnXQuBlpDaRK8jypm5orO+yN2ELcdqqUFKA/ WlbGzURC4rusO8NfO2Rrjv0PdnHmaeKYypE/e1iIB/vQPTOmYRVaDACUXpUKX/I= X-Gm-Gg: ASbGncuahLepbtyhyN6sWnUCkVJ/V2fPpv/1DbxWWbEESis2tLvQYVpD473OqCgkfi7 iN7KKpHL8q5QV6BhrCm4FCrjc9be4g9IZ92ln1QBj6T/hyocY4Vvk1jPmIBepnFGp7TxTgdphvn oxNgndDtSeeMtDm0SU3jUdN1ndNlZtQt7v10duWAZk2rPxAHdOzJb9Cb0olNMYqaeASaUiKujjN LUjM89SMMTCYMobEa4Zu13AusHWEH4WPog3zO0hbf40UZTe X-Google-Smtp-Source: AGHT+IFu1+0XA3JOMBRbQIpJxWtdJcJ0NwKyjD6Vh9Obf0jdsV7qG9uCVlXzXqKgjkjrDsTb79MgAQ== X-Received: by 2002:a05:600c:1c8a:b0:434:a4a9:5d57 with SMTP id 5b1f17b1804b1-434ddeb8cf6mr29723485e9.19.1733500961331; Fri, 06 Dec 2024 08:02:41 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Marcin Juszkiewicz , Leif Lindholm , Peter Maydell , Radoslaw Biernacki , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-stable@nongnu.org, Andrei Homescu , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Subject: [PATCH 3/3] target/arm: implement SEL2 physical and virtual timers Date: Fri, 6 Dec 2024 16:02:39 +0000 Message-Id: <20241206160239.3229094-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241206160239.3229094-1-alex.bennee@linaro.org> References: <20241206160239.3229094-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1733501064072116600 When FEAT_SEL2 was implemented the SEL2 timers where missed. This shows up when building the latest Hafnium with SPMC_AT_EL=3D2. The actual implementation utilises the same logic as the rest of the timers so all we need to do is: - define the timers and their access functions - conditionally add the correct system registers - create a new accessfn as the rules are subtly different to the existing secure timer Fixes: e9152ee91c (target/arm: add ARMv8.4-SEL2 system registers) Signed-off-by: Alex Benn=C3=A9e Cc: qemu-stable@nongnu.org Cc: Andrei Homescu Cc: Arve Hj=C3=B8nnev=C3=A5g Cc: R=C3=A9mi Denis-Courmont --- v1 - add better comments to GTIMER descriptions - also define new timers for sbsa-ref - don't conditionally gate qemu_timer creation on the feature - take cntvoff_el2 int account for SEC_VEL2 in gt_recalc/g_tval_[read|wri= te] --- include/hw/arm/bsa.h | 2 + target/arm/cpu.h | 2 + target/arm/gtimer.h | 4 +- hw/arm/sbsa-ref.c | 2 + hw/arm/virt.c | 2 + target/arm/cpu.c | 4 ++ target/arm/helper.c | 158 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 173 insertions(+), 1 deletion(-) diff --git a/include/hw/arm/bsa.h b/include/hw/arm/bsa.h index 8eaab603c0..b4ecca1b1c 100644 --- a/include/hw/arm/bsa.h +++ b/include/hw/arm/bsa.h @@ -22,6 +22,8 @@ #define QEMU_ARM_BSA_H =20 /* These are architectural INTID values */ +#define ARCH_TIMER_S_VIRT_EL2_IRQ 19 +#define ARCH_TIMER_S_EL2_IRQ 20 #define VIRTUAL_PMU_IRQ 23 #define ARCH_GIC_MAINT_IRQ 25 #define ARCH_TIMER_NS_EL2_IRQ 26 diff --git a/target/arm/cpu.h b/target/arm/cpu.h index d86e641280..10b5354d6f 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1139,6 +1139,8 @@ void arm_gt_vtimer_cb(void *opaque); void arm_gt_htimer_cb(void *opaque); void arm_gt_stimer_cb(void *opaque); void arm_gt_hvtimer_cb(void *opaque); +void arm_gt_sel2timer_cb(void *opaque); +void arm_gt_sel2vtimer_cb(void *opaque); =20 unsigned int gt_cntfrq_period_ns(ARMCPU *cpu); void gt_rme_post_el_change(ARMCPU *cpu, void *opaque); diff --git a/target/arm/gtimer.h b/target/arm/gtimer.h index de016e6da3..f8f7425a5f 100644 --- a/target/arm/gtimer.h +++ b/target/arm/gtimer.h @@ -15,7 +15,9 @@ enum { GTIMER_HYP =3D 2, /* EL2 physical timer */ GTIMER_SEC =3D 3, /* EL3 physical timer */ GTIMER_HYPVIRT =3D 4, /* EL2 virtual timer */ -#define NUM_GTIMERS 5 + GTIMER_SEC_PEL2 =3D 5, /* Secure EL2 physical timer */ + GTIMER_SEC_VEL2 =3D 6, /* Secure EL2 virtual timer */ +#define NUM_GTIMERS 7 }; =20 #endif diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index e3195d5449..5dc36b3cee 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -484,6 +484,8 @@ static void create_gic(SBSAMachineState *sms, MemoryReg= ion *mem) [GTIMER_HYP] =3D ARCH_TIMER_NS_EL2_IRQ, [GTIMER_SEC] =3D ARCH_TIMER_S_EL1_IRQ, [GTIMER_HYPVIRT] =3D ARCH_TIMER_NS_EL2_VIRT_IRQ, + [GTIMER_SEC_PEL2] =3D ARCH_TIMER_S_EL2_IRQ, + [GTIMER_SEC_VEL2] =3D ARCH_TIMER_S_VIRT_EL2_IRQ, }; =20 for (irq =3D 0; irq < ARRAY_SIZE(timer_irq); irq++) { diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1a381e9a2b..451d154459 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -873,6 +873,8 @@ static void create_gic(VirtMachineState *vms, MemoryReg= ion *mem) [GTIMER_HYP] =3D ARCH_TIMER_NS_EL2_IRQ, [GTIMER_SEC] =3D ARCH_TIMER_S_EL1_IRQ, [GTIMER_HYPVIRT] =3D ARCH_TIMER_NS_EL2_VIRT_IRQ, + [GTIMER_SEC_PEL2] =3D ARCH_TIMER_S_EL2_IRQ, + [GTIMER_SEC_VEL2] =3D ARCH_TIMER_S_VIRT_EL2_IRQ, }; =20 for (unsigned irq =3D 0; irq < ARRAY_SIZE(timer_irq); irq++) { diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 6938161b95..d15916c436 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2078,6 +2078,10 @@ static void arm_cpu_realizefn(DeviceState *dev, Erro= r **errp) arm_gt_stimer_cb, cpu); cpu->gt_timer[GTIMER_HYPVIRT] =3D timer_new(QEMU_CLOCK_VIRTUAL, sc= ale, arm_gt_hvtimer_cb, cpu); + cpu->gt_timer[GTIMER_SEC_PEL2] =3D timer_new(QEMU_CLOCK_VIRTUAL, s= cale, + arm_gt_sel2timer_cb, cp= u); + cpu->gt_timer[GTIMER_SEC_VEL2] =3D timer_new(QEMU_CLOCK_VIRTUAL, s= cale, + arm_gt_sel2vtimer_cb, c= pu); } #endif =20 diff --git a/target/arm/helper.c b/target/arm/helper.c index cd147b717a..f82503304e 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2668,6 +2668,41 @@ static CPAccessResult gt_stimer_access(CPUARMState *= env, } } =20 +static CPAccessResult gt_sel2timer_access(CPUARMState *env, + const ARMCPRegInfo *ri, + bool isread) +{ + /* + * The AArch64 register view of the secure EL2 timers are mostly + * accessible from EL3 and EL2 although can also be trapped to EL2 + * from EL1 depending on nested virt config. + */ + switch (arm_current_el(env)) { + case 0: + return CP_ACCESS_TRAP; + case 1: + if (!arm_is_secure(env)) { + return CP_ACCESS_TRAP; + } else if (arm_hcr_el2_eff(env) & HCR_NV) { + return CP_ACCESS_TRAP_EL2; + } + return CP_ACCESS_TRAP; + case 2: + if (!arm_is_secure(env)) { + return CP_ACCESS_TRAP; + } + return CP_ACCESS_OK; + case 3: + if (env->cp15.scr_el3 & SCR_EEL2) { + return CP_ACCESS_OK; + } else { + return CP_ACCESS_TRAP; + } + default: + g_assert_not_reached(); + } +} + uint64_t gt_get_countervalue(CPUARMState *env) { ARMCPU *cpu =3D env_archcpu(env); @@ -2744,6 +2779,7 @@ static void gt_recalc_timer(ARMCPU *cpu, int timeridx) switch (timeridx) { case GTIMER_VIRT: case GTIMER_HYPVIRT: + case GTIMER_SEC_VEL2: offset =3D cpu->env.cp15.cntvoff_el2; break; default: @@ -2858,6 +2894,7 @@ static uint64_t gt_tval_read(CPUARMState *env, const = ARMCPRegInfo *ri, switch (timeridx) { case GTIMER_VIRT: case GTIMER_HYPVIRT: + case GTIMER_SEC_VEL2: offset =3D gt_virt_cnt_offset(env); break; case GTIMER_PHYS: @@ -2878,6 +2915,7 @@ static void gt_tval_write(CPUARMState *env, const ARM= CPRegInfo *ri, switch (timeridx) { case GTIMER_VIRT: case GTIMER_HYPVIRT: + case GTIMER_SEC_VEL2: offset =3D gt_virt_cnt_offset(env); break; case GTIMER_PHYS: @@ -3186,6 +3224,62 @@ static void gt_sec_ctl_write(CPUARMState *env, const= ARMCPRegInfo *ri, gt_ctl_write(env, ri, GTIMER_SEC, value); } =20 +static void gt_sec_pel2_timer_reset(CPUARMState *env, const ARMCPRegInfo *= ri) +{ + gt_timer_reset(env, ri, GTIMER_SEC_PEL2); +} + +static void gt_sec_pel2_cval_write(CPUARMState *env, const ARMCPRegInfo *r= i, + uint64_t value) +{ + gt_cval_write(env, ri, GTIMER_SEC_PEL2, value); +} + +static uint64_t gt_sec_pel2_tval_read(CPUARMState *env, const ARMCPRegInfo= *ri) +{ + return gt_tval_read(env, ri, GTIMER_SEC_PEL2); +} + +static void gt_sec_pel2_tval_write(CPUARMState *env, const ARMCPRegInfo *r= i, + uint64_t value) +{ + gt_tval_write(env, ri, GTIMER_SEC_PEL2, value); +} + +static void gt_sec_pel2_ctl_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + gt_ctl_write(env, ri, GTIMER_SEC_PEL2, value); +} + +static void gt_sec_vel2_timer_reset(CPUARMState *env, const ARMCPRegInfo *= ri) +{ + gt_timer_reset(env, ri, GTIMER_SEC_VEL2); +} + +static void gt_sec_vel2_cval_write(CPUARMState *env, const ARMCPRegInfo *r= i, + uint64_t value) +{ + gt_cval_write(env, ri, GTIMER_SEC_VEL2, value); +} + +static uint64_t gt_sec_vel2_tval_read(CPUARMState *env, const ARMCPRegInfo= *ri) +{ + return gt_tval_read(env, ri, GTIMER_SEC_VEL2); +} + +static void gt_sec_vel2_tval_write(CPUARMState *env, const ARMCPRegInfo *r= i, + uint64_t value) +{ + gt_tval_write(env, ri, GTIMER_SEC_VEL2, value); +} + +static void gt_sec_vel2_ctl_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + gt_ctl_write(env, ri, GTIMER_SEC_VEL2, value); +} + static void gt_hv_timer_reset(CPUARMState *env, const ARMCPRegInfo *ri) { gt_timer_reset(env, ri, GTIMER_HYPVIRT); @@ -3242,6 +3336,20 @@ void arm_gt_stimer_cb(void *opaque) gt_recalc_timer(cpu, GTIMER_SEC); } =20 +void arm_gt_sel2timer_cb(void *opaque) +{ + ARMCPU *cpu =3D opaque; + + gt_recalc_timer(cpu, GTIMER_SEC_PEL2); +} + +void arm_gt_sel2vtimer_cb(void *opaque) +{ + ARMCPU *cpu =3D opaque; + + gt_recalc_timer(cpu, GTIMER_SEC_VEL2); +} + void arm_gt_hvtimer_cb(void *opaque) { ARMCPU *cpu =3D opaque; @@ -6624,6 +6732,56 @@ static const ARMCPRegInfo el2_sec_cp_reginfo[] =3D { .access =3D PL2_RW, .accessfn =3D sel2_access, .nv2_redirect_offset =3D 0x48, .fieldoffset =3D offsetof(CPUARMState, cp15.vstcr_el2) }, +#ifndef CONFIG_USER_ONLY + /* Secure EL2 Physical Timer */ + { .name =3D "CNTHPS_TVAL_EL2", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 5, .opc2 =3D 0, + .type =3D ARM_CP_NO_RAW | ARM_CP_IO, .access =3D PL2_RW, + .accessfn =3D gt_sel2timer_access, + .readfn =3D gt_sec_pel2_tval_read, + .writefn =3D gt_sec_pel2_tval_write, + .resetfn =3D gt_sec_pel2_timer_reset, + }, + { .name =3D "CNTHPS_CTL_EL2", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 5, .opc2 =3D 1, + .type =3D ARM_CP_IO, .access =3D PL2_RW, + .accessfn =3D gt_sel2timer_access, + .fieldoffset =3D offsetof(CPUARMState, cp15.c14_timer[GTIMER_SEC_PEL= 2].ctl), + .resetvalue =3D 0, + .writefn =3D gt_sec_pel2_ctl_write, .raw_writefn =3D raw_write, + }, + { .name =3D "CNTHPS_CVAL_EL2", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 5, .opc2 =3D 2, + .type =3D ARM_CP_IO, .access =3D PL2_RW, + .accessfn =3D gt_sel2timer_access, + .fieldoffset =3D offsetof(CPUARMState, cp15.c14_timer[GTIMER_SEC_PEL= 2].cval), + .writefn =3D gt_sec_pel2_cval_write, .raw_writefn =3D raw_write, + }, + /* Secure EL2 Virtual Timer */ + { .name =3D "CNTHVS_TVAL_EL2", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 4, .opc2 =3D 0, + .type =3D ARM_CP_NO_RAW | ARM_CP_IO, .access =3D PL2_RW, + .accessfn =3D gt_sel2timer_access, + .readfn =3D gt_sec_vel2_tval_read, + .writefn =3D gt_sec_vel2_tval_write, + .resetfn =3D gt_sec_vel2_timer_reset, + }, + { .name =3D "CNTHVS_CTL_EL2", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 4, .opc2 =3D 1, + .type =3D ARM_CP_IO, .access =3D PL2_RW, + .accessfn =3D gt_sel2timer_access, + .fieldoffset =3D offsetof(CPUARMState, cp15.c14_timer[GTIMER_SEC_VEL= 2].ctl), + .resetvalue =3D 0, + .writefn =3D gt_sec_vel2_ctl_write, .raw_writefn =3D raw_write, + }, + { .name =3D "CNTHVS_CVAL_EL2", .state =3D ARM_CP_STATE_AA64, + .opc0 =3D 3, .opc1 =3D 4, .crn =3D 14, .crm =3D 4, .opc2 =3D 2, + .type =3D ARM_CP_IO, .access =3D PL2_RW, + .accessfn =3D gt_sel2timer_access, + .fieldoffset =3D offsetof(CPUARMState, cp15.c14_timer[GTIMER_SEC_VEL= 2].cval), + .writefn =3D gt_sec_vel2_cval_write, .raw_writefn =3D raw_write, + }, +#endif }; =20 static CPAccessResult nsacr_access(CPUARMState *env, const ARMCPRegInfo *r= i, --=20 2.39.5