The NetBSD Project

CVS log for src/sys/arch/aarch64/aarch64/fault.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / arch / aarch64 / aarch64

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.26 / (download) - annotate - [select for diffs], Wed Feb 7 04:20:26 2024 UTC (7 weeks, 2 days ago) by msaitoh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored) to selected 1.21 (colored)

Remove ryo@'s mail addresses.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Feb 25 00:40:22 2023 UTC (13 months ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Changes since 1.24: +6 -3 lines
Diff to previous 1.24 (colored) to selected 1.21 (colored)

aarch64: curcpu() audit.

Sprinkle KASSERT (or KDASSERT in hot paths) for kpreempt_disabled()
when we use curcpu() and it's not immediately obvious that the caller
has preemption disabled but closer scrutiny suggests the caller has.

Note unsafe curcpu()s for syscall event counting.  Not sure this is
worth changing.

Possible bugs fixed:

- cpu_irq and cpu_fiq could be preempted while trying to run softints
  on this CPU.

- data_abort_handler might incorrectly think it was invoked in
  interrupt context when it was only preempted and migrated to
  another CPU.

- pmap_fault_fixup might report the wrong CPU logs.

(However, we don't currently run with kpreemption on aarch64, so
these are not yet real bugs fixed except if you patch it to build
with __HAVE_PREEMPTION.)

Revision 1.24 / (download) - annotate - [select for diffs], Wed May 11 14:58:00 2022 UTC (22 months, 2 weeks ago) by andvar
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored) to selected 1.21 (colored)

fix various typos in comments.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Apr 30 07:07:01 2022 UTC (22 months, 4 weeks ago) by skrll
Branch: MAIN
Changes since 1.22: +2 -3 lines
Diff to previous 1.22 (colored) to selected 1.21 (colored)

whitespace

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jan 31 09:16:09 2022 UTC (2 years, 1 month ago) by ryo
Branch: MAIN
Changes since 1.21: +13 -5 lines
Diff to previous 1.21 (colored)

add support Hardware updates to Access flag and Dirty state (FEAT_HAFDBS)

- The DBM bit of the PTE is now used to determine if it is writable, and
  the AF bit is treated entirely as a reference bit. A valid PTE is always
  treated as readable. There can be no valid PTE that is not readable.
- LX_BLKPAG_OS_{READ,WRITE} are used only for debugging purposes,
  and has been superseded by LX_BLKPAG_AF and LX_BLKPAG_DBM.
- Improve comment

The need for reference/modify emulation has been eliminated,
and access/permission faults have been reduced, however,
there has been little change in overall performance.

Revision 1.20.2.1 / (download) - annotate - [select for diffs], Mon Dec 14 14:37:44 2020 UTC (3 years, 3 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.20: +4 -3 lines
Diff to previous 1.20 (colored) next main 1.21 (colored)

Sync w/ HEAD.

Revision 1.21 / (download) - annotate - [selected], Fri Dec 11 18:03:33 2020 UTC (3 years, 3 months ago) by skrll
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.20: +4 -3 lines
Diff to previous 1.20 (colored)

s:aarch64/cpufunc.h:arm/cpufunc.h:

a baby step in the grand arm header unification challenge

Revision 1.20 / (download) - annotate - [select for diffs], Thu Oct 15 22:30:34 2020 UTC (3 years, 5 months ago) by rin
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.19: +5 -7 lines
Diff to previous 1.19 (colored) to selected 1.21 (colored)

For cpu_jump_onfault() in data_abort_handler(), stop returning
hard-coded EFAULT and use return value from uvm_fault() instead.

There are some paths that do not call uvm_fault():

(1) For fatalabort case, use EFAULT as before.
(2) When va range is invalid, use EFAULT instead of EINVAL.

These change fixes bytes_transfer_eof_* tests in
sys/lib/libc/sys/t_ptrace_wait*.

Note that without (2) above, some tests like
sys/lib/libc/sys/t_wait:write_error become newly failing.

I've confirmed that there's no new regression in full ATF run.

OK ryo

Revision 1.19 / (download) - annotate - [select for diffs], Sun Aug 9 07:26:20 2020 UTC (3 years, 7 months ago) by skrll
Branch: MAIN
Changes since 1.18: +6 -9 lines
Diff to previous 1.18 (colored) to selected 1.21 (colored)

Don't use %s in UVMHIST_PRINT.  Remove an unnecessary #ifdef UVMHIST while
I'm here

Revision 1.18 / (download) - annotate - [select for diffs], Thu Aug 6 06:50:39 2020 UTC (3 years, 7 months ago) by ryo
Branch: MAIN
Changes since 1.17: +8 -6 lines
Diff to previous 1.17 (colored) to selected 1.21 (colored)

No need to recover from fault from within a hardware interrupt handler.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Aug 6 06:49:55 2020 UTC (3 years, 7 months ago) by ryo
Branch: MAIN
Changes since 1.16: +5 -12 lines
Diff to previous 1.16 (colored) to selected 1.21 (colored)

revert the changes of http://mail-index.netbsd.org/source-changes/2020/08/03/msg120183.html

This change is overengineered.
bus_space_{peek,poke}_N does not have to be reentrant nor available for interrupt context.

requested by skrll@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Aug 3 05:56:50 2020 UTC (3 years, 7 months ago) by ryo
Branch: MAIN
Changes since 1.15: +12 -5 lines
Diff to previous 1.15 (colored) to selected 1.21 (colored)

Fix a problem in which a fault occured in an interrupt handler during copyin/copyout was erroneously detected as being occured by copyin.

- keep idepth in faultbuf and compare it to avoid unnecessary fault recovery
- make cpu_set_onfault() nestable to use bus_space_{peek,poke}()
  in hardware interrupt handlers during copyin & copyout.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Aug 2 06:58:16 2020 UTC (3 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.14: +18 -2 lines
Diff to previous 1.14 (colored) to selected 1.21 (colored)

Add support for Privileged Access Never (ARMv8.1-PAN).

PAN provides the same functionality as SMAP on x86: it forbids kernel
access to userland pages when PSTATE.PAN=1, and allows such accesses when
PSTATE.PAN=0.

We clear SCTLR_SPAN, to guarantee that PAN=1 each time the kernel is
entered. We catch PAN faults and panic right away without further
processing. In copyin, copyout, etc, we temporarily authorize access to
userland pages.

PAN is a very useful exploit mitigation. Reviewed by ryo@, thanks. Tested
on Qemu. Enabled by default.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jul 8 03:45:13 2020 UTC (3 years, 8 months ago) by ryo
Branch: MAIN
Changes since 1.13: +6 -7 lines
Diff to previous 1.13 (colored) to selected 1.21 (colored)

Determination of A64,A32,T32 for disasm is now done in strrdisasm() instead of the caller.
correctly disassemble by processor state if defined DEBUG_DUMP_ON_USERFAULT or DEBUG_DDB_ON_USERFAULT.

Revision 1.13 / (download) - annotate - [select for diffs], Wed May 13 06:08:51 2020 UTC (3 years, 10 months ago) by ryo
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored) to selected 1.21 (colored)

- move aarch64 addressspace macros from pmap.h to cpufunc.h
- rename ptr_strip_pac() to aarch64_strip_pac()

Revision 1.1.4.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:03:27 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.1.4.1: +10 -5 lines
Diff to previous 1.1.4.1 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored) to selected 1.21 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.12 / (download) - annotate - [select for diffs], Sat Feb 29 21:34:37 2020 UTC (4 years ago) by ryo
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh
Changes since 1.11: +7 -4 lines
Diff to previous 1.11 (colored) to selected 1.21 (colored)

Fix pmap to work correctly with tagged addresses

- when fault, untag from address before passing to uvm/pmap functions
- pmap_extract() checks more strictly and consider the address tag

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Tue Jan 21 11:15:52 2020 UTC (4 years, 2 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored) next main 1.11 (colored) to selected 1.21 (colored)

Pull up following revision(s) (requested by ryo in ticket #618):

	sys/arch/aarch64/aarch64/fault.c: revision 1.11
	sys/arch/aarch64/aarch64/pmap.c: revision 1.61

fix behaviour mmap()/mprotect() when passed only PROT_EXEC.
when mmap()/mprotect() with only PROT_EXEC, syscall will be successful,
but the page actually hadn't been mapped.
it should be mapped with PROT_READ|PROT_EXEC implicitly. (r-x)

Revision 1.10.4.1 / (download) - annotate - [select for diffs], Fri Jan 17 21:47:22 2020 UTC (4 years, 2 months ago) by ad
Branch: ad-namecache
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored) next main 1.11 (colored) to selected 1.21 (colored)

Sync with head.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jan 9 01:38:34 2020 UTC (4 years, 2 months ago) by ryo
Branch: MAIN
CVS Tags: ad-namecache-base3, ad-namecache-base2, ad-namecache-base1
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored) to selected 1.21 (colored)

fix behaviour mmap()/mprotect() when passed only PROT_EXEC.

when mmap()/mprotect() with only PROT_EXEC, syscall will be successful,
but the page actually hadn't been mapped.
it should be mapped with PROT_READ|PROT_EXEC implicitly. (r-x)

Revision 1.1.4.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:05:43 2019 UTC (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.1: +106 -77 lines
Diff to previous 1.1 (colored) to selected 1.21 (colored)

Sync with HEAD

Revision 1.10 / (download) - annotate - [select for diffs], Mon Jun 10 05:56:15 2019 UTC (4 years, 9 months ago) by ryo
Branch: MAIN
CVS Tags: phil-wifi-20191119, netbsd-9-base, netbsd-9-0-RC1, ad-namecache-base
Branch point for: netbsd-9, ad-namecache
Changes since 1.9: +4 -2 lines
Diff to previous 1.9 (colored) to selected 1.21 (colored)

since uvm_faut() will fail if cache maintain instructions (e.g., "dc cvau".
that has ESR.WnR=1 = write access) for a read only page causes a data abort trap,
It shoulde be treat the access type as read access in a data abort with
cache operation (ESR_ISS_DATAABORT_CM=1)

pointed out and tested by mrg@. thanks

Revision 1.9 / (download) - annotate - [select for diffs], Sat Apr 6 03:06:24 2019 UTC (4 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20190609, isaki-audio2-base, isaki-audio2
Changes since 1.8: +2 -4 lines
Diff to previous 1.8 (colored) to selected 1.21 (colored)

Overhaul the API used to fetch and store individual memory cells in
userspace.  The old fetch(9) and store(9) APIs (fubyte(), fuword(),
subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
and ustore(9) APIs that can return proper error codes, etc. and are
implemented consistently across all platforms.  The interrupt-safe
variants are no longer supported (and several of the existing attempts
at fuswintr(), etc. were buggy and not actually interrupt-safe).

Also augmement the ucas(9) API, making it consistently available on
all plaforms, supporting uniprocessor and multiprocessor systems, even
those that do not have CAS or LL/SC primitives.

Welcome to NetBSD 8.99.37.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Mar 26 08:01:21 2019 UTC (5 years ago) by mlelstv
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored) to selected 1.21 (colored)

Switch discriminates between fsc values and should check the masked fsc value,
not the whole register.

Revision 1.1.2.4 / (download) - annotate - [select for diffs], Sat Oct 20 06:58:23 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.1.2.3: +9 -4 lines
Diff to previous 1.1.2.3 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored) to selected 1.21 (colored)

Sync with head

Revision 1.7 / (download) - annotate - [select for diffs], Fri Oct 12 01:28:57 2018 UTC (5 years, 5 months ago) by ryo
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020
Changes since 1.6: +9 -4 lines
Diff to previous 1.6 (colored) to selected 1.21 (colored)

add initial support of COMPAT_NETBSD32 on AArch64.
arm ELF32 EABI binaries could be execute in AArch32 state on AArch64. A32 THUMB mode is not supported yet.

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Sat Jul 28 04:37:25 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.2: +99 -73 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored) to selected 1.21 (colored)

Sync with HEAD

Revision 1.6 / (download) - annotate - [select for diffs], Sat Jul 21 13:23:48 2018 UTC (5 years, 8 months ago) by ryo
Branch: MAIN
CVS Tags: pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728
Changes since 1.5: +55 -62 lines
Diff to previous 1.5 (colored) to selected 1.21 (colored)

return correct signo and code in accordance with return value of uvm_fault.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jul 20 07:12:50 2018 UTC (5 years, 8 months ago) by ryo
Branch: MAIN
Changes since 1.4: +13 -8 lines
Diff to previous 1.4 (colored) to selected 1.21 (colored)

avoid double-fault caused by reading the instruction when panic

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jul 19 18:27:26 2018 UTC (5 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.3: +5 -4 lines
Diff to previous 1.3 (colored) to selected 1.21 (colored)

Implement TRAP_SIGDEBUG for aarch64...
ptraced programs die with:
data_abort_handler, 257: pid 199.1 (a.out): signal 11 (trap 0x82000006) @pc 0, addr 0x0, error=Instruction Abort (EL0)

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jul 17 10:07:49 2018 UTC (5 years, 8 months ago) by ryo
Branch: MAIN
Changes since 1.2: +36 -15 lines
Diff to previous 1.2 (colored) to selected 1.21 (colored)

use panic() instead of some printf to show fault status.
useful for ddb "show panic" command.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 17 00:31:46 2018 UTC (5 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.1: +16 -10 lines
Diff to previous 1.1 (colored) to selected 1.21 (colored)

fix uninitialized, add missing casts

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Sat Apr 7 04:12:10 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1.2.1: +323 -0 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored) to selected 1.21 (colored)

Sync with HEAD.  77 conflicts resolved - all of them $NetBSD$

Revision 1.1.2.1, Sun Apr 1 04:35:03 2018 UTC (5 years, 11 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.1: +0 -323 lines
FILE REMOVED

file fault.c was added on branch pgoyette-compat on 2018-04-07 04:12:10 +0000

Revision 1.1 / (download) - annotate - [select for diffs], Sun Apr 1 04:35:03 2018 UTC (5 years, 11 months ago) by ryo
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407
Branch point for: phil-wifi, pgoyette-compat
Diff to selected 1.21 (colored)

Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)

- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>