From nobody Wed Aug 21 08:48:25 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wpg3G1bS8z5TTYh; Wed, 21 Aug 2024 08:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wpg3F6T2jz4c63; Wed, 21 Aug 2024 08:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724230105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6bip2IkajyU1AE16UTQmkkg2feug1X1GBjA7mt1QacI=; b=ssddpmSEi2f+UPsph0bGkN4BztBMwyfE2A/edV6LXWQkBGDby+49AHvh5P/hX9/qdjyEu3 CMqN6pfU6yJJczpiVIg+W+gASO10Lod9dn2vtpoHH6fzl8qsstVL4ftDtE5fvHmsGmI/E2 KPUpgVFbt4YkVBllQiAf4T5eogGp5bfhP1OmZLZUqWlkoVPCXtNWtd5BfynCWjVh/rwiog gn35tq35g7gTcj6qop6Gj7wBDBXWnGxUOwCe2eHKCyvQhUemgcNVHhiypquXFxDn3V/iwM c8SBGv2qrgeVNLb94eRXcjnZ6QEkRjZ+2GyL/O02VMqwtVwaNbNEF9TyJeRhIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724230105; a=rsa-sha256; cv=none; b=pKt4I+VbDDJhgz4nn3eXz913n3CmOThCZ2W2NapL1dO6kD2PH5ipcK6IfYAHutGAq6m29V FSf2P3V/o2/cXgAspRVMhkuQS63T1KJushu8YezPDtdY7Q8sK2FFM1J5q5QLJhiN1DPHUR IxpZ17MhS3Na+ENwpJiR3F5l20gKts8L8cPcxTv/Tdm4t9eiWccWi1Wq5ncqHwHvSzwBj6 nt2Mv5yRhvd6XluSJJRkEsIoQihvAfAtjAIPIiYT1A607nkhqNOuISWH4J/aZPQnAS2j6h 2PEXNqoeGmrOu9fVMbAcAgi20WAwAd/uJhYdnIr1KADW4Fdgf2hOgfbN6xilvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724230105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6bip2IkajyU1AE16UTQmkkg2feug1X1GBjA7mt1QacI=; b=bB0Z75i0HpINRJjChHcUvxEaqbXbfZ/7LyYr2mGMSx+ExTx49O2iU+yWqzgeNy4v49WNHG PMchRi7n0tszwWhz+PpRzQ1un9Wh2OufhkHlDO4E3U8wbym1B0fM3ZgBwX+5L2/BsRV2Oi 6lHArBU5LcBTsI1k2Q9OhW+ILtMPxhcWTbxjLrcqEEWrfI0JVpbOM3NicB5AdMggXNxXO1 NpdLUYU6Tm1vifLGgnv+qV9+olHnFbfdJMMps4pINWYcmlyzN8Xt2V0gS4EJMMGkqevLnw QJfCEukzkeLvE7dHA+gXgsePTKCdM7hp60oqR5cbe5UGdqFFWqvXRedRWjBVoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wpg3F57qnzct5; Wed, 21 Aug 2024 08:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47L8mPmR091794; Wed, 21 Aug 2024 08:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47L8mPg2091791; Wed, 21 Aug 2024 08:48:25 GMT (envelope-from git) Date: Wed, 21 Aug 2024 08:48:25 GMT Message-Id: <202408210848.47L8mPg2091791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: db6e3260a8b9 - main - arm64: Remove the E2H check from has_hyp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db6e3260a8b9257aa4f1991867e46973e4f0dce8 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=db6e3260a8b9257aa4f1991867e46973e4f0dce8 commit db6e3260a8b9257aa4f1991867e46973e4f0dce8 Author: Andrew Turner AuthorDate: 2024-08-19 12:46:05 +0000 Commit: Andrew Turner CommitDate: 2024-08-21 08:46:59 +0000 arm64: Remove the E2H check from has_hyp This was added to not use the physical timer when E2H was set. As we now use the correct timer in this case we can remove this extra check. Tested by: kevans Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46086 --- sys/arm64/arm64/genassym.c | 1 - sys/arm64/arm64/locore.S | 1 - sys/arm64/arm64/machdep.c | 9 +-------- sys/arm64/include/machdep.h | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/sys/arm64/arm64/genassym.c b/sys/arm64/arm64/genassym.c index c4f52ae61a77..a4db825e976c 100644 --- a/sys/arm64/arm64/genassym.c +++ b/sys/arm64/arm64/genassym.c @@ -42,7 +42,6 @@ ASSYM(BP_MODULEP, offsetof(struct arm64_bootparams, modulep)); ASSYM(BP_KERN_STACK, offsetof(struct arm64_bootparams, kern_stack)); ASSYM(BP_KERN_TTBR0, offsetof(struct arm64_bootparams, kern_ttbr0)); ASSYM(BP_BOOT_EL, offsetof(struct arm64_bootparams, boot_el)); -ASSYM(BP_HCR_EL2, offsetof(struct arm64_bootparams, hcr_el2)); ASSYM(PCPU_SIZE, sizeof(struct pcpu)); ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 4252ea3f59f8..ab1fea0c4716 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -134,7 +134,6 @@ virtdone: str x25, [x0, #BP_KERN_STACK] str x27, [x0, #BP_KERN_TTBR0] str x23, [x0, #BP_BOOT_EL] - str x4, [x0, #BP_HCR_EL2] #ifdef KASAN /* Save bootparams */ diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 090ea2c10853..c73c6d205c1a 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -131,7 +131,6 @@ static struct trapframe proc0_tf; int early_boot = 1; int cold = 1; static int boot_el; -static uint64_t hcr_el2; struct kva_md_info kmi; @@ -207,12 +206,7 @@ pan_enable(void) bool has_hyp(void) { - - /* - * XXX The E2H check is wrong, but it's close enough for now. Needs to - * be re-evaluated once we're running regularly in EL2. - */ - return (boot_el == CURRENTEL_EL_EL2 && (hcr_el2 & HCR_E2H) == 0); + return (boot_el == CURRENTEL_EL_EL2); } bool @@ -905,7 +899,6 @@ initarm(struct arm64_bootparams *abp) TSRAW(&thread0, TS_ENTER, __func__, NULL); boot_el = abp->boot_el; - hcr_el2 = abp->hcr_el2; /* Parse loader or FDT boot parametes. Determine last used address. */ lastaddr = parse_boot_param(abp); diff --git a/sys/arm64/include/machdep.h b/sys/arm64/include/machdep.h index 2f2960ae39f2..4fa80219da42 100644 --- a/sys/arm64/include/machdep.h +++ b/sys/arm64/include/machdep.h @@ -33,7 +33,6 @@ struct arm64_bootparams { vm_offset_t modulep; vm_offset_t kern_stack; vm_paddr_t kern_ttbr0; - uint64_t hcr_el2; int boot_el; /* EL the kernel booted from */ int pad; };