aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused define.Konstantin Belousov2011-10-071-1/+0
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=226112
* - Use atomic operations rather than sched_lock for safely assigning pm_activeMarius Strobl2011-10-063-27/+129
| | | | | | | | | | | and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE. Thanks go to Peter Jeremy for additional testing. - Add support for SCHED_ULE to cpu_switch(). Committed from: 201110DevSummit Notes: svn path=/head/; revision=226054
* Actually enable NEW_PCIB by default, missed in r225931.Marius Strobl2011-10-021-1/+1
| | | | Notes: svn path=/head/; revision=225932
* Make sparc64 compatible with NEW_PCIB and enable it:Marius Strobl2011-10-0220-499/+630
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement bus_adjust_resource() methods as far as necessary and in non-PCI bridge drivers as far as feasible without rototilling them. - As NEW_PCIB does a layering violation by activating resources at layers above pci(4) without previously bubbling up their allocation there, move the assignment of bus tags and handles from the bus_alloc_resource() to the bus_activate_resource() methods like at least the other NEW_PCIB enabled architectures do. This is somewhat unfortunate as previously sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY resources should be mapped into KVA, which is only necessary if their going to be accessed via the pointer returned from rman_get_virtual() but not for bus_space(9) as the later always uses physical access on sparc64. Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver also may deliberately not map them in if the firmware already has done so, possibly in a special way. So in order to still allow a driver to decide whether a SYS_RES_MEMORY resource should be mapped into KVA we let it indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as actually documented in the bus_space(9) page. This is implemented by allocating a separate bus tag per SYS_RES_MEMORY resource and passing the resource via the previously unused bus tag cookie so we later on can call rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now also allows to actually indicate that a SYS_RES_MEMORY resource should be mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and BUS_SPACE_MAP_READONLY respectively. - Do some minor cleanup like taking advantage of rman_init_from_resource(), factor out the common part of bus tag allocation into a newly added sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace some homegrown versions with the generic counterparts etc. - While at it, let apb_attach() (which can't use the generic NEW_PCIB code as APB bridges just don't have the base and limit registers implemented) regarding the config space registers cached in pcib_softc and the SYSCTL reporting nodes set up. Notes: svn path=/head/; revision=225931
* Remove obsolete macros.Marius Strobl2011-10-011-6/+0
| | | | Notes: svn path=/head/; revision=225901
* Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve anyMarius Strobl2011-10-011-15/+1
| | | | | | | purpose. Notes: svn path=/head/; revision=225900
* Also allocate space for the PIL counters. Given that no machine actuallyMarius Strobl2011-10-011-4/+4
| | | | | | | uses IV_MAX interrupt vectors this wasn't a problem in practice though. Notes: svn path=/head/; revision=225899
* Re-reading the Schizo errata suggests that it's actually tolerable toMarius Strobl2011-10-011-3/+3
| | | | | | | | | also use the streaming buffer of pre version 5/revision 2.3 hardware as long as we stay away from context flushes (which iommu(4) so far doesn't take advantage of). OpenSolaris does the same. Notes: svn path=/head/; revision=225891
* - Add protective parentheses to macros as far as possible.Marius Strobl2011-10-011-41/+41
| | | | | | | | - Move {r,w,}mb() to the top of this file where they live on most of the other architectures. Notes: svn path=/head/; revision=225890
* In total store which we use for running the kernel and all of the userlandMarius Strobl2011-10-011-8/+9
| | | | | | | | | | | | | | atomic operations behave as if the were followed by a memory barrier so there's no need to include ones in the acquire variants of atomic(9). Removing these results a small performance improvement, specifically this is sufficient to compensate the performance loss seen in the worldstone benchmark seen when using SCHED_ULE instead of SCHED_4BSD. This change is inspired by Linux even more radically doing the equivalent thing some time ago. Thanks go to Peter Jeremy for additional testing. Notes: svn path=/head/; revision=225889
* Add a comment about why contrary to what once would think running all ofMarius Strobl2011-09-301-0/+4
| | | | | | | userland with total store order actually is appropriate. Notes: svn path=/head/; revision=225888
* Use the extended integer condition code when comparing 64-bit values. GivenMarius Strobl2011-09-301-1/+1
| | | | | | | that ATOMIC_INC_LONG currently is unused this happened to not be fatal. Notes: svn path=/head/; revision=225887
* - Right-justify backslashes as suggested by style(9).Marius Strobl2011-09-301-55/+55
| | | | | | | | - Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with the names of the other macros in this file an adjust accordingly. Notes: svn path=/head/; revision=225886
* Remove locking of the vm page queues from several pmaps, which onlyKonstantin Belousov2011-09-281-2/+1
| | | | | | | | | | | | protected the dirty mask updates. The dirty mask updates are handled by atomics after the r225840. Submitted by: alc Tested by: flo (sparc64) MFC after: 2 weeks Notes: svn path=/head/; revision=225841
* It is safe to initialize locks even on early boot (and it is the sameAttilio Rao2011-09-192-8/+1
| | | | | | | | | | | | | | thing all the other architectures already do) thus just initialize kernel_pmap in pmap_bootstrap(). Reported by: alc Reviewed by: alc, marius Tested by: flo, marius Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=225675
* In order to maximize the re-usability of kernel code in user space thisKip Macy2011-09-161-1/+1
| | | | | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz) Notes: svn path=/head/; revision=225617
* Fix a zyd(4) comment typo that was copy+pasted into most kernel config files.Christian Brueffer2011-09-111-1/+1
| | | | | | | | | | PR: 160276 Submitted by: MATSUMIYA Ryo <matsumiya@mma.club.uec.ac.jp> Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=225482
* Inline the syscallenter() and syscallret(). This reduces the time measuredKonstantin Belousov2011-09-111-0/+2
| | | | | | | | | | | by the syscall entry speed microbenchmarks by ~10% on amd64. Submitted by: jhb Approved by: re (bz) MFC after: 2 weeks Notes: svn path=/head/; revision=225474
* Split the vm_page flags PG_WRITEABLE and PG_REFERENCED into atomicKonstantin Belousov2011-09-061-16/+16
| | | | | | | | | | | | | | | | | | | | flags field. Updates to the atomic flags are performed using the atomic ops on the containing word, do not require any vm lock to be held, and are non-blocking. The vm_page_aflag_set(9) and vm_page_aflag_clear(9) functions are provided to modify afalgs. Document the changes to flags field to only require the page lock. Introduce vm_page_reference(9) function to provide a stable KPI and KBI for filesystems like tmpfs and zfs which need to mark a page as referenced. Reviewed by: alc, attilio Tested by: marius, flo (sparc64); andreast (powerpc, powerpc64) Approved by: re (bz) Notes: svn path=/head/; revision=225418
* Since r221218 rman_manage_region(9) actually honors rm_start and rm_endMarius Strobl2011-08-281-2/+2
| | | | | | | | | | | which may cause problems when these contain garbage so zero the range descriptors embedding the rmans when allocating them. Approved by: re (kib) MFC after: 3 days Notes: svn path=/head/; revision=225229
* - Move the PG_UNMANAGED flag from m->flags to m->oflags, renaming the flagKonstantin Belousov2011-08-092-22/+19
| | | | | | | | | | | | | | | | | to VPO_UNMANAGED (and also making the flag protected by the vm object lock, instead of vm page queue lock). - Mark the fake pages with both PG_FICTITIOUS (as it is now) and VPO_UNMANAGED. As a consequence, pmap code now can use use just VPO_UNMANAGED to decide whether the page is unmanaged. Reviewed by: alc Tested by: pho (x86, previous version), marius (sparc64), marcel (arm, ia64, powerpc), ray (mips) Sponsored by: The FreeBSD Foundation Approved by: re (bz) Notes: svn path=/head/; revision=224746
* Change all the sample kernel configurations to useRick Macklem2011-08-071-1/+1
| | | | | | | | | | | | | NFSCL, NFSD instead of NFSCLIENT, NFSSERVER since NFSCL and NFSD are now the defaults. The client change is needed for diskless configurations, so that the root mount works for fstype nfs. Reported by seanbru at yahoo-inc.com for i386/XEN. Approved by: re (hrs) Notes: svn path=/head/; revision=224699
* - Merge from r147740:Marius Strobl2011-08-061-3/+6
| | | | | | | | | | | | | When the last, possibly partially filled buffer is flushed, we didn't reset fragsz to 0 and as such would stop reflecting reality. - Use __FBSDID. - Wrap a too long line. Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=224682
* Remove a shortcut which is invalid with MAXCPU > IDR_CHEETAH_MAX_BN_PAIRS.Marius Strobl2011-08-061-8/+0
| | | | | | | Approved by: re (kib) Notes: svn path=/head/; revision=224681
* Merge from r224217:Marius Strobl2011-07-201-1/+1
| | | | | | | | | Bump MAXCPU to 64. Approved by: re (kib) Notes: svn path=/head/; revision=224232
* On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytesAttilio Rao2011-07-191-2/+2
| | | | | | | | | | | | | storage. Fix the sintrcnt/sintrnames specification. No MFC is previewed for this patch. Reported, reviewed and tested by: marcel Approved by: re (kib) Notes: svn path=/head/; revision=224216
* Add the possibility to specify from kernel configs MAXCPU value.Attilio Rao2011-07-191-0/+2
| | | | | | | | | | | | | This patch is going to help in cases like mips flavours where you want a more granular support on MAXCPU. No MFC is previewed for this patch. Tested by: pluknet Approved by: re (kib) Notes: svn path=/head/; revision=224207
* - Remove the eintrcnt/eintrnames usage and introduce the concept ofAttilio Rao2011-07-182-5/+8
| | | | | | | | | | | | | | | | | | | sintrcnt/sintrnames which are symbols containing the size of the 2 tables. - For amd64/i386 remove the storage of intr* stuff from assembly files. This area can be widely improved by applying the same to other architectures and likely finding an unified approach among them and move the whole code to be MI. More work in this area is expected to happen fairly soon. No MFC is previewed for this patch. Tested by: pluknet Reviewed by: jhb Approved by: re (kib) Notes: svn path=/head/; revision=224187
* Remove NULL assignments which are redundant for static timecounters.Marius Strobl2011-07-121-4/+0
| | | | | | | Submitted by: jkim Notes: svn path=/head/; revision=223962
* - Remove redundant timecounter masking from counter_get_timecount().Marius Strobl2011-07-121-4/+2
| | | | | | | | | | - Zero the timecounter when allocation so we don't need to initialize unused members and remove a now redundant NULL assignment. Submitted by: jkim Notes: svn path=/head/; revision=223961
* - Current testing shows that (ab)using the JBC performance counter in busMarius Strobl2011-07-121-13/+10
| | | | | | | | | | | cycle mode as timecounter just works fine. My best guess is that a firmware update has fixed this, check at run-time whether it advances and use a positive quality if it does. The latter will cause this timecounter to be used instead of the tick counter based one, which just sucks for SMP. - Remove a redundant NULL assignment from the timecounter initialization. Notes: svn path=/head/; revision=223960
* - Add a missing shift in schizo_get_timecount(). This happened to be non-fatalMarius Strobl2011-07-121-3/+3
| | | | | | | | | | as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the second counter in the upper 32 bits this would be required though as the MI timecounter code doesn't support 64-bit counters/counter registers. - Remove a redundant NULL assignment from the timecounter initialization. Notes: svn path=/head/; revision=223959
* Remove the IDR_CHEETAH_MAX_BN_PAIRS limit from cheetah_ipi_selected().Marius Strobl2011-07-051-2/+2
| | | | | | | | | This is just a simple approach. For reasons unknown OpenSolaris uses a more sophisticated one involving IPIing the remaining CPUs in reverse order after the first batch of 32. Notes: svn path=/head/; revision=223806
* It can be useful to know which page still has mappings.Marius Strobl2011-07-051-1/+1
| | | | Notes: svn path=/head/; revision=223801
* - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.cMarius Strobl2011-07-052-6/+6
| | | | | | | | so static'ize them. - Correct a typo. Notes: svn path=/head/; revision=223800
* In pmap_remove_all() assert that the page is neither fictitious norMarius Strobl2011-07-051-0/+2
| | | | | | | | | unmanaged as also done on other architectures. Reviewed by: alc Notes: svn path=/head/; revision=223798
* Call pmap_qremove() before freeing or unwiring the pages, otherwiseMarius Strobl2011-07-051-1/+1
| | | | | | | | | | | there's a window during which a page can be re-used before its previous mapping is removed. Reviewed by: alc MFC after: 1 week Notes: svn path=/head/; revision=223795
* MFCAttilio Rao2011-07-0414-76/+310
|\ | | | | | | Notes: svn path=/projects/largeSMP/; revision=223757
| * UltraSPARC-IV CPUs seem to be affected by a not publicly documentedMarius Strobl2011-07-022-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | erratum causing them to trigger stray vector interrupts accompanied by a state in which they even fault on locked TLB entries. Just retrying the instruction in that case gets the CPU back on track though. OpenSolaris also just ignores a certain number of stray vector interrupts. While at it, implement the stray vector interrupt handling for SPARC64-VI which use these for indicating uncorrectable errors in interrupt packets. Notes: svn path=/head/; revision=223721
| * Don't waste a delay slot.Marius Strobl2011-07-021-2/+2
| | | | | | | | Notes: svn path=/head/; revision=223720
| * - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries fromMarius Strobl2011-07-0210-68/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Notes: svn path=/head/; revision=223719
| * Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 toMarius Strobl2011-07-021-5/+12
| | | | | | | | | | | | | | merge the two. Notes: svn path=/head/; revision=223718
| * Add some checks to ensure that Capsicum is behaving correctly, and add someJonathan Anderson2011-06-301-0/+21
| | | | | | | | | | | | | | | | | | | | more explicit comments about what's going on and what future maintainers need to do when e.g. adding a new operation to a sys_machdep.c. Approved by: mentor(rwatson), re(bz) Notes: svn path=/head/; revision=223692
* | MFCAttilio Rao2011-06-223-10/+13
|\| | | | | | | Notes: svn path=/projects/largeSMP/; revision=223435
| * Fix whitespaceMarius Strobl2011-06-211-5/+5
| | | | | | | | Notes: svn path=/head/; revision=223379
| * On machines where we don't need to lock the kernel TSB into the dTLB andMarius Strobl2011-06-212-2/+2
| | | | | | | | | | | | | | | | thus may basically use the entire 64-bit kernel address space reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory. Notes: svn path=/head/; revision=223378
| * On machines where we don't need to lock the kernel TSB into the dTLB andMarius Strobl2011-06-211-3/+6
| | | | | | | | | | | | | | | | thus may basically use the entire 64-bit kernel address space increase the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX. Notes: svn path=/head/; revision=223377
* | MFCAttilio Rao2011-06-212-6/+4
|\| | | | | | | Notes: svn path=/projects/largeSMP/; revision=223362
| * As astopgap minimize the sched_lock coverage in pmap_activate() in orderMarius Strobl2011-06-201-4/+4
| | | | | | | | | | | | | | to reduce lock contention. Notes: svn path=/head/; revision=223347
| * - Remove MD usage of pc_cpumask and pc_other_cpus. [1]Marius Strobl2011-06-203-16/+15
| | | | | | | | | | | | | | | | | | - Remove CTASSERTs which no longer need to hold since r222813. Submitted by: attilio [1] Notes: svn path=/head/; revision=223346