Commit Graph

2296 Commits

Author SHA1 Message Date
Nathan Whitehorn
e5fadf2a31 On 64-bit PowerPC, use more native forms of the PPC 970 HID restore
sequences, like are used to read the HIDs. This is both easier to read
and avoids a miscompilation by GCC in certain circumstances. Also avoid
double restoration of HID4 and HID5.

MFC after:	2 weeks
2015-01-21 02:57:54 +00:00
Nathan Whitehorn
e1e25f45a4 There does not seem to be any reason to acquire GIANT here. Follow amd64
in removing it.

MFC after:	1 month
2015-01-20 16:21:59 +00:00
Nathan Whitehorn
b9d056f3d6 Remove space in the FDT reservation map from the available memory regions
in ofw_mem_regions(). This function is actually MI and should move to
dev/ofw at some point in the near future so that ARM and MIPS can use the
same code.
2015-01-20 05:44:21 +00:00
Nathan Whitehorn
3dcd1c9585 Zero BSS explicitly if not started by loader(8). Add a check for the magic
values that ePAPR-compliant loaders (like skiboot) put in the register
loader uses for the metadata pointer to avoid confusing them.
2015-01-20 05:28:03 +00:00
Nathan Whitehorn
98cd7a6655 Add some initial infrastructure for relocating the kernel in place.
MFC after:	2 months
Differential revision:	D1554
2015-01-19 17:58:01 +00:00
Nathan Whitehorn
c5e8bb4f2e Provide a tunable (machdep.moea64_bpvo_pool_size) to set the bootstrap
PVO pool size. The default errs on the exceedingly large side, so absent
any intelligent automatic tuning, at least let the user set it to save
RAM on memory-constrained systems.

MFC after:	2 weeks
2015-01-19 05:14:07 +00:00
Nathan Whitehorn
9cecb88ce3 Use TOC to look up all kernel globals on powerpc64 instead of doing the
non-relocatable lis @ha, ori @l dance and hoping they are below 4 GB.

MFC after:	2 months
2015-01-18 20:00:33 +00:00
Nathan Whitehorn
bb80825435 Refactor PowerPC (especially AIM) init sequence to be less baroque.
MFC after:	2 months
2015-01-18 18:32:43 +00:00
Nathan Whitehorn
348a26e6c7 Make netbooting work again by disabling BOOTP_NFSV3. Investigate why this
causes bad RPC errors later.
2015-01-16 17:41:21 +00:00
Navdeep Parhar
ca7fe84a61 Plug cxgbe(4) back into !powerpc && !arm builds, instead of building it
on amd64 only.
2015-01-16 01:39:24 +00:00
Justin Hibbits
64b83a0576 Add Altivec/VMX register support to ptrace.
MFC after:	2 weeks
Relnotes:	yes
2015-01-14 07:01:21 +00:00
Nathan Whitehorn
bf27800837 Do not remap Open Firmware mappings covered by the direct map. It's
pointless and wastes resources.

MFC after:	1 week
2015-01-14 02:18:29 +00:00
Justin Hibbits
615df4c159 Increase default MAXTSIZ to allow execution of larger binaries.
This allows executing static clang built with -O0.

The value is configurable by a sysctl, so if one needs to clamp it down, they
still can.

Discussed with:	nwhitehorn,emaste
2015-01-10 06:54:10 +00:00
Mark Johnston
bdb9ab0dd9 Factor out duplicated code from dumpsys() on each architecture into generic
code in sys/kern/kern_dump.c. Most dumpsys() implementations are nearly
identical and simply redefine a number of constants and helper subroutines;
a generic implementation will make it easier to implement features around
kernel core dumps. This change does not alter any minidump code and should
have no functional impact.

PR:		193873
Differential Revision:	https://reviews.freebsd.org/D904
Submitted by:	Conrad Meyer <conrad.meyer@isilon.com>
Reviewed by:	jhibbits (earlier version)
Sponsored by:	EMC / Isilon Storage Division
2015-01-07 01:01:39 +00:00
John Baldwin
3e32dff52c Remove "New" label from NFSCL/NFSD now that they are the only NFS
client/server.  While here, remove duplicate NFSCL from sys/conf/NOTES.

Approved by:	rmacklem
2015-01-06 16:15:57 +00:00
Nathan Whitehorn
08b96b9ff5 Restore use of ofw_bus_intr_to_rl() in the pseries vdevice driver after fixing
ofw_bus_intr_to_rl() to match the spec for unspecified interrupt-parent
properties.
2015-01-05 21:39:35 +00:00
Hans Petter Selasky
b217d18412 Add 64-bit DMA support in the XHCI controller driver.
- Fix some comments and whitespace while at it.

MFC after:	1 month
Submitted by:	marius@
2015-01-05 20:22:18 +00:00
Nathan Whitehorn
efabbd4c02 Revert r272109 locally, which is not quite equivalent in how it deals with
missing interrupt-parent properties. A better solution will come later,
but this restores pseries in QEMU for the time being.
2015-01-05 18:15:16 +00:00
Nathan Whitehorn
fd520b6e21 Use FDT properties to identify a PS3 if present. 2015-01-05 01:05:35 +00:00
Nathan Whitehorn
f1d2752f31 Make PS3 work with the userspace kboot loader. loader.ps3 will disappear
from the tree in the near future.

Done at:	Hackathon
2015-01-05 00:50:16 +00:00
Justin Hibbits
41ddc6ea3d Truncate DB_SMALL_VALUE_MAX to a much lower value.
Unlike the other architectures, the PowerPC kernel is loaded under the 2GB
boundary.

MFC after:	2 weeks
2015-01-04 01:45:26 +00:00
Justin Hibbits
971e8cb1c0 Resort and resize the altivec registers in the pcb. vrsave and vscr are both
32-bit registers via the PowerPC spec.

X-MFC-with:	r276634
MFC after:	2 weeks
2015-01-03 21:08:27 +00:00
Justin Hibbits
7bde2664d6 Dump VMX registers into the userland coredump.
Reviewed by:	nwhitehorn
MFC after:	2 weeks
2015-01-03 21:06:06 +00:00
Nathan Whitehorn
6e127b87c4 Remove last vestige of Apple-specific memory parsing removed in r258807. 2015-01-02 22:34:03 +00:00
Nathan Whitehorn
44d29d4762 Allow booting with both a real Open Firmware tree and a flattened version of
the Open Firmware, as provided by petitboot, for example. Note that this is
not quite complete, since RTAS instantiation still depends on callable
firmware.

MFC after:	2 weeks
2015-01-01 22:26:12 +00:00
Mark Johnston
cafe874475 Restore the trap type argument to the DTrace trap hook, removed in r268600.
It's redundant at the moment since it can be obtained from the trapframe
on the architectures where DTrace is supported, but this won't be the case
with ARM.
2014-12-23 15:38:19 +00:00
Rui Paulo
5cead939e9 Move ofw_cpu.c to sys/dev/ofw so that it can be used by other
architectures.

Differential Revision:	https://reviews.freebsd.org/D1307
Reviewed by:	jhibbits
2014-12-14 22:41:08 +00:00
Andreas Tobler
a00b2ba8fe Fix kernel build for booke. 2014-12-10 20:23:19 +00:00
Andreas Tobler
85859dfe8f Fix build for powerpc(32|64) kernels. 2014-12-10 18:13:14 +00:00
George V. Neville-Neil
bd19924f6b This configuration file removes several debugging options, including
WITNESS and INVARIANTS checking, which are known to have significant
performance impact on running systems.  When benchmarking new features
this kernel should be used instead of the standard GENERIC.
This kernel configuration should never appear outside of the HEAD
of the FreeBSD tree.
2014-12-02 19:55:43 +00:00
Justin Hibbits
a8920f67f3 Add support for dtrace:fbt on modules for PowerPC
Summary:
Revert the initial FBT-with-KDB changes for trap_subr*.S, and instead use the
db_trap filter function to handle dtrace trap filtering.  With this, the MMU is
enabled by the support code, simplifying the codepath altogether.

Test Plan: Tested on my G4 PowerBook

Reviewers: #powerpc, nwhitehorn

Reviewed By: nwhitehorn

Differential Revision: https://reviews.freebsd.org/D1207

MFC after:	3 weeks
2014-11-29 20:54:33 +00:00
Ed Maste
294246bb7d Revert r274772: it is not valid on MIPS
Reported by:	sbruno
2014-11-25 03:50:31 +00:00
Justin Hibbits
69e45c755c Fix the powerpc64 build.
Pointy-hat to:	me
X-MFC-with:	r274735
2014-11-21 02:45:39 +00:00
Ed Maste
688fd61ae8 Use canonical __PIC__ flag
It is automatically set when -fPIC is passed to the compiler.

Reviewed by:	dim, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1179
2014-11-21 02:05:48 +00:00
Justin Hibbits
eaed5fd136 cpudep_ap_early_bootstrap() takes no arguments, so no need to give it one.
MFC after:	3 weeks
2014-11-20 06:32:47 +00:00
Justin Hibbits
8f92db287e Use db_printsym() instead of our own in backtraces
Summary:
Currently if there are problems finding a symbol, backtrace ends up printing
something like:

0xdeadbeef: at +0x12345

Which is pretty useless.  This on its own should be fixed (retrieving symbols),
but aside from that, using db_printsym() is a better solution anyway.  If it
can't find a valid symbol it prints the actual address, and it has the added
benefit that if it can find the symbol, it might be able to print the file and
line as well.

Test Plan: Tested on my G4 PowerBook

Reviewers: #powerpc, nwhitehorn

Reviewed By: nwhitehorn

Differential Revision: https://reviews.freebsd.org/D1173

MFC after:	3 weeks
2014-11-20 03:47:04 +00:00
Justin Hibbits
a1afe0bf8e Add support for Power Button PMU events on non-ADB macs, such as aluminum
PowerBooks.

MFC after:	2 weeks
Relnotes:	yes
2014-11-20 03:23:33 +00:00
Luiz Otavio O Souza
667357dc9b Moves all the duplicate code to a single function.
Verify for invalid modes and unwanted flags before pass the new flags to
driver.
2014-11-18 17:22:08 +00:00
Alexander V. Chernikov
603eaf792b Renove faith(4) and faithd(8) from base. It looks like industry
have chosen different (and more traditional) stateless/statuful
NAT64 as translation mechanism. Last non-trivial commits to both
faith(4) and faithd(8) happened more than 12 years ago, so I assume
it is time to drop RFC3142 in FreeBSD.

No objections from:	net@
2014-11-09 21:33:01 +00:00
Konstantin Belousov
2361c6d135 Add type qualifier volatile to the base (userspace) address argument
of fuword(9) and suword(9).  This makes the functions type-compatible
with volatile objects and does not require devolatile force, e.g. in
kern_umtx.c.

Requested by:	bde
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2014-10-31 17:43:21 +00:00
Luiz Otavio O Souza
8839e0e9f3 Make the GPIO children attach to the first unit available and not only to
unit 0.

It seems that this 'simplification' was copied to all GPIO drivers in tree.

This fix a bug where a GPIO controller could fail to attach its children
(gpioc and gpiobus) if another GPIO driver attach first.
2014-10-28 18:33:59 +00:00
Konstantin Belousov
4f3dc90023 Add fueword(9) and casueword(9) functions. They are like fuword(9)
and casuword(9), but do not mix value read and indication of fault.

I know (or remember) enough assembly to handle x86 and powerpc.  For
arm, mips and sparc64, implement fueword() and casueword() as wrappers
around fuword() and casuword(), which means that the functions cannot
distinguish between -1 and fault.

On architectures where fueword() and casueword() are native, implement
fuword() and casuword() using fueword() and casuword(), to reduce
assembly code duplication.

Sponsored by:	The FreeBSD Foundation
Tested by:	pho
MFC after:	2 weeks (ia64 needs treating)
2014-10-28 15:22:13 +00:00
Justin Hibbits
e01bff72b4 Add CAPABILITIES and CAPABILITY_MODE to powerpc GENERIC64, missed with the addition to
GENERIC

MFC after:	3 weeks
2014-10-28 01:34:01 +00:00
John Baldwin
7d313e7bdb Add COMPAT_FREEBSD9 and COMPAT_FREEBSD10 options to wrap code that
provides compatability for FreeBSD 9.x and 10.x binaries.  Enable
these options in kernel configs that enable other COMPAT_FREEBSD<n>
options.
2014-10-24 19:58:24 +00:00
Hans Petter Selasky
71aea8c84b Use the UAUTO SYSCTL type for exporting the bounce zone alignment,
because the variable size depends on the build type.

Reported by:	kib @
MFC after:	3 days
2014-10-21 21:04:44 +00:00
Hans Petter Selasky
f0188618f2 Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified.

- Wrong or missing "access" specifier. The "access" specifier
sometimes included the SYSCTL type, which it should not, except for
procedural SYSCTL nodes.

- Logical OR where binary OR was expected.

- Properly assert the "access" argument passed to all SYSCTL macros,
using the CTASSERT macro. This applies to both static- and dynamically
created SYSCTLs.

- Properly assert the the data type for both static and dynamic
SYSCTLs. In the case of static SYSCTLs we only assert that the data
pointed to by the SYSCTL data pointer has the correct size, hence
there is no easy way to assert types in the C language outside a
C-function.

- Rewrote some code which doesn't pass a constant "access" specifier
when creating dynamic SYSCTL nodes, which is now a requirement.

- Updated "EXAMPLES" section in SYSCTL manual page.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-21 07:31:21 +00:00
Davide Italiano
2be111bf7d Follow up to r225617. In order to maximize the re-usability of kernel code
in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv().
This fixes a namespace collision with libc symbols.

Submitted by:   kmacy
Tested by:      make universe
2014-10-16 18:04:43 +00:00
Justin Hibbits
e9152038d3 Move the adm1030 driver to the proper location, and rename it.
For compatibility, 'device windtunnel' is still supported, but one should use
'device adm1030' instead, and this has been updated in GENERIC and NOTES.
2014-10-16 01:32:22 +00:00
Justin Hibbits
3cd55688ba Add a sysctl to allow disabling the monitoring thread.
Summary:
If a user uses powerd, or doesn't want to use the cycles monitoring, they can
now suspend the monitoring thread.

While here, reorganize the added prototypes to match existing groupings.

Reviewers: nwhitehorn, #powerpc, rpaulo

Reviewed By: #powerpc, rpaulo

Differential Revision: https://reviews.freebsd.org/D944
X-MFC-with:	r273009

MFC after:	3 weeks
2014-10-15 02:31:14 +00:00
Justin Hibbits
d49c6f029c Add an AC line monitor so power_profile can work
Summary:
Add a polling loop (1Hz) to monitor the battery and AC status, to notify devd
like ACPI does for power monitoring.  This allows /etc/rc.d/power_profile to
work on PowerPC laptops

Test Plan:
Tested on a Titanium PowerBook, configuring economy_cpu_freq and
performance_cpu_freq, disabling powerd.

Reviewers: #powerpc, nwhitehorn

Reviewed By: nwhitehorn

Subscribers: rpaulo

Differential Revision: https://reviews.freebsd.org/D937
2014-10-12 19:12:48 +00:00