summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/include
AgeCommit message (Collapse)Author
2023-05-06few more typos in the word "register", mainly s/resister/register/.andvar
In one comment I assume that it was meant to be pull-up resistor.
2023-02-07Avoid using (1<<64)-1 for VM_MAX{,USER}_ADDRESS as rounding that up tohgutch
the next page boundary gives 0 and instead make the VA space end one page earlier. Fixes PR sparc64/57219.
2022-01-10sun4v: add function to retrieve hypervisor api versionpalle
2021-11-02In order to prevent _mcount() from being recursively called when built with ↵ryo
COPTS=-O0, sprinkle `__always_inline' to make _mcount() be generated as a single function.
2021-08-25- In kern_mutex.c, if MUTEX_CAS() is not defined, define it in terms ofthorpej
atomic_cas_ulong(). - For arm, ia64, m68k, mips, or1k, riscv, vax: don't define our own MUTEX_CAS(), as they either use atomic_cas_ulong() or equivalent (atomic_cas_uint() on m68k). - For alpha and sparc64, don't define MUTEX_CAS() in terms of their own _lock_cas(), which has its own memory barriers; the call sites in kern_mutex.c already have the appropriate memory barrier calls. Thus, alpha and sparc64 can use default definition. - For sh3, don't define MUTEX_CAS() in terms of its own _lock_cas(); atomic_cas_ulong() is strong-aliased to _lock_cas(), therefore defining our own MUTEX_CAS() is redundant. Per thread: https://mail-index.netbsd.org/tech-kern/2021/07/25/msg027562.html
2021-08-14Improved the performance of kernel profiling on MULTIPROCESSOR, and possible ↵ryo
to get profiling data for each CPU. In the current implementation, locks are acquired at the entrance of the mcount internal function, so the higher the number of cores, the more lock conflict occurs, making profiling performance in a MULTIPROCESSOR environment unusable and slow. Profiling buffers has been changed to be reserved for each CPU, improving profiling performance in MP by several to several dozen times. - Eliminated cpu_simple_lock in mcount internal function, using per-CPU buffers. - Add ci_gmon member to struct cpu_info of each MP arch. - Add kern.profiling.percpu node in sysctl tree. - Add new -c <cpuid> option to kgmon(8) to specify the cpuid, like openbsd. For compatibility, if the -c option is not specified, the entire system can be operated as before, and the -p option will get the total profiling data for all CPUs.
2021-08-08Define preprocessor symbols (__HAVE_OPENFIRMWARE_VARIANT_AAPL andthorpej
__HAVE_OPENFIRMWARE_VARIANT_SUNW) that lets generic OpenFirmware code deal with differences / quirks among implementation variants.
2021-07-03sun4v: add support for hypervisor soft state - from OpenBSDpalle
2021-05-31Include "opt_param.h" (ifdef _KERNEL_OPT) everywhere that MSGBUFSIZE issimonb
referenced since some sources include <machine/param.h>.
2021-04-27sun4v: add missing method to set hypervisor api version + add defintion for ↵palle
the interrupt hypervisor api group (to be used)
2021-04-05Fix build w/o options SUN4V.nakayama
2021-04-03Improve cpu_idle() by allowing a platform specific implementaion (same logic ↵palle
as the sparc implementation) - currently only used by sun4v
2021-02-26Say what 1UL<<39 (MAXDSIZ value) is in the comment.simonb
2020-12-06don't expose register_tchristos
2020-10-06GC unused MAXTSIZ32christos
2020-09-06forward declare struct vm_page, and include uvm_prot.h and uvm_pmap.h.mrg
fixes build, presumeably after uvm.h external rototill.
2020-03-10Don't provide things that don't make sense in userland. We don't providechristos
access to registers crash(8)...
2020-03-10kill extra curproc/curlwp definitions that have no chance of working.christos
2020-01-22Bump UBC defaults on sparc64 & aarch64, which already have a large pager_map.ad
2019-12-29Simplify some macros: if we only ever use them on the local cpu,martin
there is no need to do another pointer derefernence to go via the global address of our cpu info. Pointed out by ad.
2019-12-15Merge from yamt-pagecache:ad
- do gang lookup of pages using radixtree. - remove now unused uvm_object::uo_memq and vm_page::listq.queue.
2019-12-01Fix false sharing problems with cpu_info. Identified with tprof(8).ad
This was a very nice win in my tests on a 48 CPU box. - Reorganise cpu_data slightly according to usage. - Put cpu_onproc into struct cpu_info alongside ci_curlwp (now is ci_onproc). - On x86, put some items in their own cache lines according to usage, like the IPI bitmask and ci_want_resched.
2019-11-29Nix now-unused definitions of MUTEX_GIVE/MUTEX_RECEIVE.riastradh
2019-11-29Nix mb_* on sparc and sparc64.riastradh
2019-11-29Largely eliminate the MD rwlock.h header file.riastradh
This was full of definitions that have been obsolete for over a decade. The file still remains for __HAVE_RW_STUBS but that's all. Used only internally in kern_rwlock.c now, not by <sys/rwlock.h>.
2019-11-23cpu_need_resched():ad
- Remove all code that should be MI, leaving the bare minimum under arch/. - Make the required actions very explicit. - Pass in LWP pointer for convenience. - When a trap is required on another CPU, have the IPI set it locally. - Expunge cpu_did_resched().
2019-11-13Revert workarounds for clang.nakayama
In-tree clang can now handle the "r" asm constraint for 64-bit values properly.
2019-09-28remove local version of mstohz() now that <sys/param.h> provides it.christos
2019-09-23Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all archesskrll
to follow arm and (generic) mips. Reviewed by christos.
2019-05-15From: Tobias Ulmer. Unbreak zfs module build on sparc{,64} by hiding DELAY.christos
ZFS has a conflicting definition of delay() and tries to hide it by defining __HIDE_DELAY.
2019-05-07Switch all users (except ia64) of custom machine/ansi.h to common_ansi.hkamil
Deduplicate the code among ports and poll definitions of types directly from a compiler. This fixes miscompilation of certain programs that instruct compilers to generate code for different types. This bug has been detected with -fshort-wchar in EFI firmware. Proposed and discussed on a mailing list (twice). Itanium uses custom !ELF fallback switch, temporarily leave it as it is.
2019-04-06The real cause for removing asm inline code on clang is that thenakayama
"r" constraint cannot handle 64-bit and is treated as 32-bit. So code that refers to the upper 32-bit (manuf or impl) of the %ver register is removed by optimization. Use 32-bit kernel code as a workaround when referring to the %ver register.
2019-04-06Overhaul the API used to fetch and store individual memory cells inthorpej
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.
2019-04-05Redo previous.nakayama
In the case of store variant, put dummy constraint in output instead of input. Suggested by joerg@ in source-changes-d@
2019-04-05Add dummy constraints to avoid excessive optimization in clang.nakayama
GENERIC kernel compiled with clang now boot at least on my Fire V100.
2019-04-05Put "memory" to asm inline reading privilege registers for clang tonakayama
prevent it from being removed by excessive optimization.
2019-02-08sun4v: initialize %stickcmpr properly when establishing interrupt - fixes ↵palle
issue seen on newer sun4v/SPARC-T5 system where the interrupt never fires.
2019-02-08Introduce getstickcmpr() functionpalle
2019-01-10- move pmap_ctx() macro into pmap.h instead of duplicating it.mrg
- fix description of some mach ddb commands.
2019-01-08remove explicit <machine/param.h> include, code including this already includesjdolecek
<sys/param.h>
2019-01-07move DEV_BSIZE, DEV_BSHIFT out of MD param.h, they are same on all portsjdolecek
also move BLKDEV_IOSIZE, MAXPHYS, but allow override since some ports have different value (powerpc uses NBPG for BLKDEV_IOSIZE, sun2/sun3 have lower MAXPHYS)
2018-12-19Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,maxv
but also as discussed several times in the past.
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended. HOWEVER! Some subsystems have #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation. To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it. I have left a handful of bootloaders that are too annoying to compile-test, and some dead code: cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4)) It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them. Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
2018-08-27Expand to __nothing, not to empty.riastradh
2018-08-27Include some needful header files and forward declarations.riastradh
2018-08-22- Cleanup for dynamic sysctl:msaitoh
- Remove unused *_NAMES macros for sysctl. - Remove unused *_MAXID for sysctls. - Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and use them on all m68k machines.
2018-07-12Remove the kernel PMC code. Sent yesterday on tech-kern@.maxv
This change: * Removes "options PERFCTRS", the associated includes, and the associated ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is good. * Removes the PMC code of ARM XSCALE. * Removes all the pmc.h files. They were all empty, except for ARM XSCALE. * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The definitions are put in sysarch.h. * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control and sys_pmc_get_info syscalls. They are marked as OBSOL in kern, netbsd32 and rump. * Removes the pmc_evid_t and pmc_ctr_t types. * Removes all the associated man pages. The sets are marked as obsolete.
2018-03-29Move the complex logic for dynamically writing branches from ld.elf_sojoerg
into a header for reuse in crt0.o for static ifunc support. Change the existing logic for sparc64 to use the Bicc variant of ba,a as it allows +-8MB displacement compared to the BPcc variant's +-1MB. Teach the sparc variant the same trick for using ba,a and not sethi+jmp when possible.
2018-02-19fix _UC_MACHINE32_FP() -- use 32 bit pointer value so that [15] ismrg
the right offset. do this by using __greg32_t, which is only in the sparc64 version, and these are only useful there, so move them.
2018-01-16implement cpuctl identify for sparc and sparc64.mrg
sparc: - move enum vactype and struct cacheinfo into cpu.h - move the cache flags from cpuinfo.flags into CACHEINFO.c_flags (this allows the new cache_printf_backend() to see them.) remove unused CPUFLG_CACHEIOMMUTABLES and CPUFLG_CACHEDVMA. - align xmpsg to 64 bytes - move cache_print() into cache_print.h so it can be shared with cpuctl. it only depends upon a working printf(). - if found, store the CPU node's "name" into cpu_longname. this changes the default output to show the local CPU not the generic CPU family. eg: cpu0 at mainbus0: mid 8: Ross,RT625 @ 90 MHz, on-chip FPU vs the generic "RT620/625" previously shown. - for each CPU export these things: - name - fpuname - mid - cloc - freq - psr impl and version - mmu impl, version, and number of contexts - cacheinfo structure (which changed for the first time ever with this commit.) sparc64: - add a minimal "cacheinfo" structure to export the i/d/e-cache size and linesize. - store %ver, cpu node "name" and cacheinfo in cpu_info. - set cpu_info ver, name and cacheinfo in cpu_attach(), and export them via sysctl, as well as CPU ID and clock freq cpuctl: - add identifycpu_bind() that returns false on !x86 as their identify routines do not need to run on a particular CPU to obtain its information, and use it to avoid trying to set affinity when not needed. - add sparc and sparc64 cpu identify support using the newly exported values.