From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@google.com>,
Will Deacon <will@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.13 097/113] arm64: initialize all of CNTHCTL_EL2
Date: Wed, 1 Sep 2021 14:28:52 +0200 [thread overview]
Message-ID: <20210901122305.187252773@linuxfoundation.org> (raw)
In-Reply-To: <20210901122301.984263453@linuxfoundation.org>
From: Mark Rutland <mark.rutland@arm.com>
[ Upstream commit bde8fff82e4a4b0f000dbf4d5eadab2079be0b56 ]
In __init_el2_timers we initialize CNTHCTL_EL2.{EL1PCEN,EL1PCTEN} with a
RMW sequence, leaving all other bits UNKNOWN.
In general, we should initialize all bits in a register rather than
using an RMW sequence, since most bits are UNKNOWN out of reset, and as
new bits are added to the reigster their reset value might not result in
expected behaviour.
In the case of CNTHCTL_EL2, FEAT_ECV added a number of new control bits
in previously RES0 bits, which reset to UNKNOWN values, and may cause
issues for EL1 and EL0:
* CNTHCTL_EL2.ECV enables the CNTPOFF_EL2 offset (which itself resets to
an UNKNOWN value) at EL0 and EL1. Since the offset could reset to
distinct values across CPUs, when the control bit resets to 1 this
could break timekeeping generally.
* CNTHCTL_EL2.{EL1TVT,EL1TVCT} trap EL0 and EL1 accesses to the EL1
virtual timer/counter registers to EL2. When reset to 1, this could
cause unexpected traps to EL2.
Initializing these bits to zero avoids these problems, and all other
bits in CNTHCTL_EL2 other than EL1PCEN and EL1PCTEN can safely be reset
to zero.
This patch ensures we initialize CNTHCTL_EL2 accordingly, only setting
EL1PCEN and EL1PCTEN, and setting all other bits to zero.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oupton@google.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Oliver Upton <oupton@google.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210818161535.52786-1-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/include/asm/el2_setup.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h
index 21fa330f498d..b83fb24954b7 100644
--- a/arch/arm64/include/asm/el2_setup.h
+++ b/arch/arm64/include/asm/el2_setup.h
@@ -33,8 +33,7 @@
* EL2.
*/
.macro __init_el2_timers
- mrs x0, cnthctl_el2
- orr x0, x0, #3 // Enable EL1 physical timers
+ mov x0, #3 // Enable EL1 physical timers
msr cnthctl_el2, x0
msr cntvoff_el2, xzr // Clear virtual offset
.endm
--
2.30.2
next prev parent reply other threads:[~2021-09-01 12:53 UTC|newest]
Thread overview: 120+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-01 12:27 [PATCH 5.13 000/113] 5.13.14-rc1 review Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 001/113] net: qrtr: fix another OOB Read in qrtr_endpoint_post Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 002/113] bpf: Fix ringbuf helper function compatibility Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 003/113] ASoC: rt5682: Adjust headset volume button threshold Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 004/113] ASoC: component: Remove misplaced prefix handling in pin control functions Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 005/113] platform/x86: Add and use a dual_accel_detect() helper Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 006/113] ARC: Fix CONFIG_STACKDEPOT Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 007/113] netfilter: ipset: Limit the maximal range of consecutive elements to add/delete Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 008/113] netfilter: conntrack: collect all entries in one cycle Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 009/113] once: Fix panic when module unload Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 010/113] io_uring: rsrc ref lock needs to be IRQ safe Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 011/113] blk-iocost: fix lockdep warning on blkcg->lock Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 012/113] ovl: fix uninitialized pointer read in ovl_lookup_real_one() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 013/113] net: mscc: Fix non-GPL export of regmap APIs Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 014/113] can: usb: esd_usb2: esd_usb2_rx_event(): fix the interchange of the CAN RX and TX error counters Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 015/113] ceph: correctly handle releasing an embedded cap flush Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 016/113] dt-bindings: sifive-l2-cache: Fix select matching Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 017/113] riscv: Ensure the value of FP registers in the core dump file is up to date Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 018/113] powerpc: Re-enable ARCH_ENABLE_SPLIT_PMD_PTLOCK Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 019/113] mm/memory_hotplug: fix potential permanent lru cache disable Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 020/113] Revert "btrfs: compression: dont try to compress if we dont have enough pages" Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 021/113] net: stmmac: fix kernel panic due to NULL pointer dereference of xsk_pool Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 022/113] net: stmmac: fix kernel panic due to NULL pointer dereference of buf->xdp Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 023/113] drm/i915: Fix syncmap memory leak Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 024/113] drm/i915/dp: Drop redundant debug print Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 025/113] drm/amdgpu: Cancel delayed work when GFXOFF is disabled Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 026/113] drm/amdgpu: use the preferred pin domain after the check Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 027/113] drm/amdgpu: Fix build with missing pm_suspend_target_state module export Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 028/113] Revert "USB: serial: ch341: fix character loss at high transfer rates" Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 029/113] USB: serial: option: add new VID/PID to support Fibocom FG150 Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 030/113] usb: renesas-xhci: Prefer firmware loading on unknown ROM state Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 031/113] usb: typec: tcpm: Raise vdm_sm_running flag only when VDM SM is running Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 032/113] usb: dwc3: gadget: Fix dwc3_calc_trbs_left() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 033/113] usb: dwc3: gadget: Stop EP0 transfers during pullup disable Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 034/113] scsi: core: Fix hang of freezing queue between blocking and running device Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 035/113] RDMA/mlx5: Fix crash when unbind multiport slave Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 036/113] RDMA/uverbs: Track dmabuf memory regions Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 037/113] RDMA/bnxt_re: Add missing spin lock initialization Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 038/113] IB/hfi1: Fix possible null-pointer dereference in _extend_sdma_tx_descs() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 039/113] RDMA/bnxt_re: Remove unpaired rtnl unlock in bnxt_re_dev_init() Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 040/113] RDMA/rxe: Fix memory allocation while in a spin lock Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 041/113] ice: do not abort devlink info if board identifier cant be found Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 042/113] net: usb: pegasus: fixes of set_register(s) return value evaluation; Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 043/113] igc: fix page fault when thunderbolt is unplugged Greg Kroah-Hartman
2021-09-01 12:27 ` [PATCH 5.13 044/113] igc: Use num_tx_queues when iterating over tx_ring queue Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 045/113] e1000e: Fix the max snoop/no-snoop latency for 10M Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 046/113] e1000e: Do not take care about recovery NVM checksum Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 047/113] RDMA/efa: Free IRQ vectors on error flow Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 048/113] ip_gre: add validation for csum_start Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 049/113] xgene-v2: Fix a resource leak in the error handling path of xge_probe() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 050/113] net: marvell: fix MVNETA_TX_IN_PRGRS bit number Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 051/113] ucounts: Increase ucounts reference counter before the security hook Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 052/113] net/sched: ets: fix crash when flipping from strict to quantum Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 053/113] SUNRPC: Fix XPT_BUSY flag leakage in svc_handle_xprt() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 054/113] ipv6: use siphash in rt6_exception_hash() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 055/113] ipv4: use siphash instead of Jenkins in fnhe_hashfun() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 056/113] cxgb4: dont touch blocked freelist bitmap after free Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 057/113] net: dsa: hellcreek: Fix incorrect setting of GCL Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 058/113] net: dsa: hellcreek: Adjust schedule look ahead window Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 059/113] rtnetlink: Return correct error on changing device netns Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 060/113] net: hns3: clear hardware resource when loading driver Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 061/113] net: hns3: add waiting time before cmdq memory is released Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 062/113] net: hns3: fix speed unknown issue in bond 4 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 063/113] net: hns3: fix duplicate node in VLAN list Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 064/113] net: hns3: fix get wrong pfc_en when query PFC configuration Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 065/113] media: ipu3-cio2: Drop reference on error path in cio2_bridge_connect_sensor() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 066/113] Revert "mmc: sdhci-iproc: Set SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN on BCM2711" Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 067/113] net: stmmac: add mutex lock to protect est parameters Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 068/113] net: stmmac: fix kernel panic due to NULL pointer dereference of plat->est Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 069/113] usb: gadget: u_audio: fix race condition on endpoint stop Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 070/113] perf/x86/intel/uncore: Fix integer overflow on 23 bit left shift of a u32 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 071/113] sched: Fix get_push_task() vs migrate_disable() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 072/113] clk: renesas: rcar-usb2-clock-sel: Fix kernel NULL pointer dereference Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 073/113] iwlwifi: pnvm: accept multiple HW-type TLVs Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 074/113] iwlwifi: add new SoF with JF devices Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 075/113] iwlwifi: add new so-jf devices Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 076/113] opp: remove WARN when no valid OPPs remain Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 077/113] cpufreq: blocklist Qualcomm sm8150 in cpufreq-dt-platdev Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 078/113] virtio: Improve vq->broken access to avoid any compiler optimization Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 079/113] virtio_pci: Support surprise removal of virtio pci device Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 080/113] virtio_vdpa: reject invalid vq indices Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 081/113] vringh: Use wiov->used to check for read/write desc order Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 082/113] tools/virtio: fix build Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 083/113] platform/x86: asus-nb-wmi: Allow configuring SW_TABLET_MODE method with a module option Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 084/113] platform/x86: asus-nb-wmi: Add tablet_mode_sw=lid-flip quirk for the TP200s Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 085/113] qed: qed ll2 race condition fixes Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 086/113] qed: Fix null-pointer dereference in qed_rdma_create_qp() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 087/113] Revert "drm/amd/pm: fix workload mismatch on vega10" Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 088/113] drm/amd/pm: change the workload type for some cards Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 089/113] blk-mq: dont grab rqs refcount in blk_mq_check_expired() Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 090/113] drm: Copy drm_wait_vblank to user before returning Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 091/113] platform/x86: gigabyte-wmi: add support for X570 GAMING X Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 092/113] drm/nouveau: recognise GA107 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 093/113] drm/nouveau/disp: power down unused DP links during init Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 094/113] drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 095/113] platform/x86: gigabyte-wmi: add support for B450M S2H V2 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 096/113] net/rds: dma_map_sg is entitled to merge entries Greg Kroah-Hartman
2021-09-01 12:28 ` Greg Kroah-Hartman [this message]
2021-09-01 12:28 ` [PATCH 5.13 098/113] pipe: avoid unnecessary EPOLLET wakeups under normal loads Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 099/113] pipe: do FASYNC notifications for every pipe IO, not just state changes Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 100/113] tipc: call tipc_wait_for_connect only when dlen is not 0 Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 101/113] vt_kdsetmode: extend console locking Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 102/113] Bluetooth: btusb: check conditions before enabling USB ALT 3 for WBS Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 103/113] net: dsa: mt7530: fix VLAN traffic leaks again Greg Kroah-Hartman
2021-09-01 12:28 ` [PATCH 5.13 104/113] arm64: dts: qcom: msm8994-angler: Fix gpio-reserved-ranges 85-88 Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 105/113] btrfs: fix NULL pointer dereference when deleting device by invalid id Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 106/113] Revert "floppy: reintroduce O_NDELAY fix" Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 107/113] fscrypt: add fscrypt_symlink_getattr() for computing st_size Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 108/113] ext4: report correct st_size for encrypted symlinks Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 109/113] f2fs: " Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 110/113] ubifs: " Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 111/113] Revert "parisc: Add assembly implementations for memset, strlen, strcpy, strncpy and strcat" Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 112/113] net: dont unconditionally copy_from_user a struct ifreq for socket ioctls Greg Kroah-Hartman
2021-09-01 12:29 ` [PATCH 5.13 113/113] audit: move put_tree() to avoid trim_trees refcount underflow and UAF Greg Kroah-Hartman
2021-09-01 14:52 ` [PATCH 5.13 000/113] 5.13.14-rc1 review Fox Chen
2021-09-01 16:25 ` Florian Fainelli
2021-09-01 21:19 ` Shuah Khan
2021-09-02 6:30 ` Naresh Kamboju
2021-09-02 21:31 ` Justin Forbes
2021-09-02 21:51 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210901122305.187252773@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oupton@google.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox