| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Convert the oea64 mmu code to rwlocks.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D54936
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Some IVAR indices are special in that they have global meaning across
multiple buses where as other IVARs are always private to the local bus.
Try to document this a bit and add constants for the various ranges to
avoid future conflicts.
This is a no-op, but IVAR indices are now generally defined as enums
as that makes it easier to define them in terms of ranges.
Reviewed by: imp, royger, andrew
Differential Revision: https://reviews.freebsd.org/D54159
|
| |
|
|
|
|
|
|
| |
After discussion with jhibbits@, we pulled out what is supported here
and how it's supported.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55093
|
| |
|
|
|
|
|
|
| |
It's time to flip these on and see if anything happens in -HEAD.
It can be turned back off before 16.0-RELEASE if there are problems.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D55071
|
| |
|
|
|
|
|
| |
kgdb only uses the marked fields from dumppcb for initial frame
reconstruction.
This reverts commit 8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3.
|
| |
|
|
|
|
|
|
|
|
| |
There are programs that depend on this structure (e.g. kernel debuggers)
that breaks when the ABI changes.
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55149
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The FreeBSD radix implementation piggybacks on the physical memory
allocation function from the HPT implementation, but did not share
the same state information for number of physical memory ranges.
This led to a situation where the HPT physical memory allocator
would attempt to shift the physical memory ranges in the shared
range table, but would use the wrong number of entries, thus
overwriting the large segment of low memory that should have been
available for e.g. 32-bit DMA.
Incorrect physical memory map:
real memory = 33997058048 (32422 MB)
available KVA = 34359619583 (32767 MB)
Physical memory chunk(s):
0x0000000000003000 - 0x0000000000002fff, 0 bytes (0 pages)
0x000000000000e000 - 0x000000000000ffff, 8192 bytes (2 pages)
0x0000000000094000 - 0x0000000000ffffff, 16171008 bytes (3948 pages)
0x0000000100000000 - 0x00000007a2042fff, 28487987200 bytes (6955075 pages)
0x00000007d0006000 - 0x00000007fc72dfff, 745701376 bytes (182056 pages)
0x00000007fdc00000 - 0x00000007ff79ffff, 28966912 bytes (7072 pages)
0x00000007ff7d1000 - 0x00000007ff7effff, 126976 bytes (31 pages)
avail memory = 29190103040 (27837 MB)
FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs
Correct physical memory map:
real memory = 33997058048 (32422 MB)
available KVA = 34359619583 (32767 MB)
Physical memory chunk(s):
0x0000000000003000 - 0x0000000000002fff, 0 bytes (0 pages)
0x000000000000e000 - 0x000000000000ffff, 8192 bytes (2 pages)
0x0000000000094000 - 0x0000000000ffffff, 16171008 bytes (3948 pages)
0x0000000002000000 - 0x000000000284ffff, 8716288 bytes (2128 pages)
0x0000000004627000 - 0x000000002fffffff, 731746304 bytes (178649 pages)
0x0000000034040000 - 0x00000000efffffff, 3153854464 bytes (769984 pages)
0x0000000100000000 - 0x00000007982ecfff, 28323008512 bytes (6914797 pages)
0x00000007cc20a000 - 0x00000007fc72dfff, 810696704 bytes (197924 pages)
0x00000007fdc00000 - 0x00000007ff79ffff, 28966912 bytes (7072 pages)
0x00000007ff7d1000 - 0x00000007ff7effff, 126976 bytes (31 pages)
avail memory = 32984436736 (31456 MB)
FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
Sponsored-by: Raptor Computing Systems, LLC
|
| |
|
|
|
|
|
|
|
|
|
| |
The only use of `tlbie %rN, 0` is now explicit and covered in the block
above. Since there's no need for an explicit `tlbie %rN, 0` now, drop
this convoluted piece and let the compiler decide.
While here, a trivial optimization of the old-style tlbie block, by
clearing tlbie_lock and returning, instead of going to the end which
checks again if the lock is needed. Since it's already known to be
needed, there's no need to check again.
|
| |
|
|
|
|
| |
Reviewed by: jhibbits, adrian
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54814
|
| |
|
|
|
|
|
|
| |
There are no plans to allow multiple sizes of HPT superpages, so just use a
constant for it.
MFC after: 3 weeks
Fixes: 1bc75d77e9 ("powerpc/pmap/oea64: Make PV_LOCK superpage sized")
|
| |
|
|
|
|
|
|
|
| |
HPT superpages are 16MB, not 2MB. Taking 8 locks to lock a super page
almost defeats the purpose of using the super page. Expanding the
PV_LOCK scope to cover 16MB (24 bit shift) reduces this to a single
lock.
MFC after: 3 weeks
|
| |
|
|
|
|
|
|
|
|
| |
Add POWER10 and POWER11 to the list of lockless TLBIE capable CPUs.
According to Linux, anything POWER5 and later should be able to do this,
but that hasn't been tested with FreeBSD. POWER10 and POWER11, being
derived after the POWER9, implicitly have this capability per the ISA
spec.
MFC after: 1 week
|
| |
|
|
|
|
| |
- s/transcation/transaction/
MFC after: 5 days
|
| |
|
|
| |
This is causing compilation issues on powerpc:powerpc GENERIC.
|
| |
|
|
|
|
|
|
|
|
| |
It is nop for 4BSD.
Reviewed by: olce
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54831
|
| |
|
|
|
|
|
|
| |
Reviewed by: olce
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D54831
|
| |
|
|
|
|
|
| |
Reviewed by: kib, jhibbits
Effort: CHERI upstreaming
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D54840
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit cc81c44dd806737f98b4fd4094674dd71c8749f3 aimed to consolidate
duplicated code between the Book-E and AIM backends. For
cpu_thread_alloc cpu_thread_alloc and cpu_fork it used the AIM
functions which used a bogus alignment mask (~0x2f). The Book-E
functions used a proper alignment mask (~0x3f). The AIM functions
appear to have been busted since they were first imported in commit
919cb3362fded33aca682a6ac57777f8fff86e36.
To fix, use the Book-E mask which requests 64 byte alignment.
Probably this was harmless in practice since td_kstack is page aligned
and struct pcb is probably a multiple of 32 bytes in size, so the 0x10
bit should have been clear anyway.
Reviewed by: fuz, jhibbits
Fixes: cc81c44dd806 ("Unify ABI-related bits of the Book-E and AIM...")
Effort: CHERI upstreaming
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D54839
|
| |
|
|
|
|
|
|
|
|
|
|
| |
According to POWER8_UM_v1.3_16MAR2016 3.8.3 Translation Lookaside
Buffer (TLB), POWER8 supports lockless TLBIE operations.
Locally Tested:
* IBM POWER8 Revision 2.0, dual socket, 160 threads
Differential Revision: https://reviews.freebsd.org/D54855
Approved by: jhibbits
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no timebase freeze platform routine registered on my dual 2.3GHz
G5 PPC970FX Apple PowerMac.
For platforms without an explicit timebase freeze/unfreeze, we'll have to
make do with what we have - which for now is an explicit hand-crafted
spinlock/rendezvous method.
* For existing platforms, they'll still continue to clock freeze /
rendezvous; albeit with some stronger atomic bits now (from jhibbits@.)
* Instead of the fallback being "no timesync", implement a
best-effort one which does a similar rendezvous barrier between
BSP and APs, but instead of freeze/unfreeze the first instruction
after the CPUs all register they're ready is to set the timebase.
This has resulted in many reboots of my Powermac G5 dual-socket device
correctly starting and running in SMP mode.
Differential Revision: https://reviews.freebsd.org/D54821
Reviewed by: jhibbits
|
| |
|
|
|
|
|
|
|
| |
If an error occurs during attach after ofw_pcib_init() runs, the device
is torn down, leaving the rmans embedded in the softc attached to the
rman list, thus corrupting the rman list. Fix this by undoing
everything that was done by this point.
MFC after: 1 week
|
| |
|
|
|
|
| |
On multithreaded cores (e6500) the CPU ID in the device tree (reg[0]) is
the primary core, which may not match the cpuid, until Book-E threading
is added.
|
| |
|
|
|
|
|
| |
Add atomic_set/clear_short/char for doing 8-bit and 16-bit operations
more efficiently on "newer" architectures (POWER7 and later).
Piggybacks on b31abc95eb.
|
| |
|
|
|
|
| |
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1957
|
| |
|
|
|
|
|
| |
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 4a5a1c17ac43356fae053524187bb16f8fc1ac70)
|
| |
|
|
|
|
|
| |
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 40a49bccf388494f9685a81cfa781050f5f8bb1f)
|
| |
|
|
|
|
|
| |
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1914
(cherry picked from commit 1bfae8b50814697ac12bc8879ad8013e7ffd77b2)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a narrow window where the lock is unlocked but the checking CPU
hasn't flushed things appropriately.
Inside this window the CPU inside cpu_switch() will loop forever thinking
the destination thread is still blocked/locked even though it is not.
This manifests as the system hanging after starting all APs.
I've seen this reliably trigger in qemu-system-ppc64 running power9 pseries
guests; the more CPUs the more likely it triggers at boot.
PR: kern/292167
Differential Revision: https://reviews.freebsd.org/D54478
Reviewed by: jhibbits
MFC after: 1 week
Relnotes: yes
|
| |
|
|
| |
Use MTX_SYSINIT() instead of rolling our own.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Define _ALIGNBYTES using sizeof(void *) (no functional change on any
existing architecture) which will allow it to work with CHERI were we
must align things up to capability alignment.
In _ALIGN, replace integer manipulation which does not preserve pointer
provenance with a type and provenance preserving builtin. This requires
modest changes in code which assumes _ALIGN returns an integer, but
those are relatively rare.
Reviewed by: kib, markj
Effort: CHERI upstreaming
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D53947
|
| |
|
|
|
|
|
|
|
| |
The wrapper functions such as bus_alloc_resource_any() still support
passing the rid by value or pointer, but the underlying implementation
now passes by value.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D53402
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
On powerpc/powerpc64, sig_atomic_t is an int, but was treated as if
it was a long by <machine/_stdint.h>. This was finally caught by the
unit test added with 4a1c752 / D53831.
Reported by: kib
Reviewed by: kib, imp
Approved by: markj (mentor)
Fixes: c3e289e1ce8c9af8d14e9f727632e22b3bf901f9
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54026
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The platform-dependent macros are added to the various
_stdint.h headers, those that are always the same are
added directly to _stdint.h.
We may want to move the definitions for WCHAR_* and
WINT_* out of the platform header files as those are
always the same.
Approved by: markj (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D53830
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For compliance with IOS/IEC 9899:2024 ("C23").
These macros define the width in bits of the basic integer types.
Another new macro, BITINT_MAXWIDTH, is not yet included as I do not
understand what it should be set to. Perhaps it is compiler-specific.
Approved by: markj (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D53825
|
| |
|
|
|
|
|
|
|
|
|
| |
Realtek changed how it styled its name 25 or so years ago, but the old
style persisted in many places. These products use the new styling in
their datasheets.
Signed-off-by: ykla yklaxds@gmail.com
Sponsored by: Chinese FreeBSD Community
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
|
| |
|
|
|
|
|
| |
pmap_zero_page() may be called on uncached pages, so using the cache to
zero uncached pages may trigger a fault.
MFC after: 2 weeks
|
| |
|
|
|
|
| |
Reviewed by: jmg
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D53390
|
| |
|
|
|
|
|
|
|
| |
Last minute change by me (diff reduction), that I didn't build. This
was in the original commit.
Fixes: 8fb1789612 ("intr/powerpc: create openpic_class kobj")
MFC after: 2 weeks
X-MFC-with: 8fb1789612
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Using kobj allows implementing most PIC functions merely by inheriting
from the parent class. As there are multiple OpenPIC implementations,
this ensures all common hooks go through by default.
Note, this adds the suspend/resume functions to other PICs. This should
be harmless as suspend/resume isn't working on the devices anyway.
Reviewed by: jhibbits
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
| |
Spotted while examing this driver. Remove some end of line spaces/tabs.
Replace some spaces which should instead be tabs.
Reviewed by: jhibbits
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
| |
kexec hasn't been ported to these architectures, yet, so appease the
build with dummy headers.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D51625
|
| |
|
|
|
|
|
|
|
| |
No functional change intended.
Reviewed by: kib
MFC after: 10 days
MFC with: 80336636b6b9f7a3bdad007c400e85eae017d2a2
Differential Revision: https://reviews.freebsd.org/D53173
|
| |
|
|
| |
MFC after: 1 week
|
| |
|
|
|
|
|
| |
This makes non-GENERIC kernel configs easier to maintain.
Requested by: glebius
MFC after: 2 days
|
| |
|
|
|
|
|
| |
Reviewed by: jrtc27, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D52626
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the comment introducing the 'wlan_*' devices (AES-CCMP is missing)
after introducing AES-GCMP.
While here, re-order the devices in order of appearance of the related
technologies.
No functional change (intended).
Reviewed by: adrian, emaste
Fixes: 7bf82ea4fdda ("sys: add wlan_gcmp to GENERIC kernels as appropriate")
MFC after: 3 days
MFC to: stable/15
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52444
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While FIDO/U2F keys were already supported by the generic uhid(4) and
hidraw(4) drivers, this driver adds some additional features an does
steps to tighten the security of FIDO/U2F access.
- It automatically loads through devd.
- Automatically enables HQ_NO_READAHEAD for FIDO/U2F devices.
- Implements only miminum set of features.
- Do not requires external devfs configuration to set character device
permissions.
- Names character device as u2f/# to make possible capsicum or any
other pledge()-style sandboxing.
PR: 265528
Differential Revision: https://reviews.freebsd.org/D51612
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Since gpiobus_attach_bus can attach the gpiobus child along with its
children in the same bus pass, the parent controller's reference to
gpiobus might not be set by the time the children need it. Instead,
drivers should use gpiobus_add_bus and explicitly call
bus_attach_children.
Reviewed by: mmel, imp (older version)
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D51578
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
More fallout from a77e1f0f81df.
When the tag has an alignment requirement but a small (remaining)
transfer size, the transfer will be rounded up to exceed its bounds,
resulting in memory corruption.
The issue is observed on powerpc as noted in the pull request:
https://github.com/freebsd/freebsd-src/pull/1415
I also observe the issue locally on riscv hardware, with an 8-byte
transfer having 64-byte alignment.
There is some uncertainty about the purpose/need for the alignment
roundup; both its original intention and present effect. Notably, it is
no longer present at all in arm/arm64 implementations. Possibly, this
roundup can be removed altogether, but this requires more careful
analysis of the edge-cases and history of the property.
For now, simply clamp sgsize to be no larger than the remaining buflen,
as this is certain to be correct within the current scheme and fixes
the affected transfers.
Discussed with: jhb, markj
MFC after: 3 weeks
Fixes: a77e1f0f81df ("busdma: better handling of small segment bouncing")
Sponsored by: The FreeBSD Foundation
Pull Request: https://github.com/freebsd/freebsd-src/pull/1415
Signed-off-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th>
Co-authored-by: Chattrapat Sangmanee <aomsin27@hotmail.co.th>
Differential Revision: https://reviews.freebsd.org/D47807
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multiple issues existed within the powerpc FP/VSX save/restore functionality,
leading to register corruption and loss of register contents in specific
scenarios involving high signal load and use of both floating point and VSX
instructions.
Issue #1
On little endian systems the PCB used the wrong location for the shadowed
FP register within the larger VSX register. This appears to have been an
attempt to correct issue #2 without understanding how the vector load/store
instructions actually operate.
Issue #2
On little endian systems, the VSX state save/restore routines swapped 32-bit
words within the 64-bit aliased double word for the associated floating point
register. This was due to the use of a word-oriented load/store vs. doubleword
oriented load/store.
Issue #3
The FPU was turned off in the PCB but not in hardware, leading to a potential
race condition if the same thread was scheduled immediately after sigreturn.
The triggering codebase for this is Go, which makes heavy use of signals and
and generates an unusual mix of floating point and VSX assembler. As a result,
when combined with th powerpc lazy FPU restore, a condition was repeatedly hit
whereby the thread was interrupted in FP+VSX mode, then restored in FP only
mode, thus reliably triggering the issues above.
Also clean up the associated asm() style issue flagged by GitHub Actions.
Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1756
|