andrew [Sat, 29 Mar 2014 14:35:36 +0000 (14:35 +0000)]
VFP fixes/cleanups for ARM11:
* Save the required VFP registers on context switch. If the exception bit
is set we need to save and restore the FPINST register, and if the fp2v
bit is also set we need to save and restore FPINST2.
* Move saving and restoring the floating point control registers to C.
* Clear the fpexc exception and fp2v flags on a floating-point exception.
* Signal a SIGFPE if the fpexc exception flag is set on an undefined
instruction. This is how the ARM core signals to software there is a
floating-point exception.
kib [Sat, 29 Mar 2014 11:56:33 +0000 (11:56 +0000)]
Clear the kernel grab of the FPU state on fork. The pcb_save pointer
is already correctly reset to the FPU user save area, only PCB_KERNFPU
flag might leak from old thread state into the new state.
For creation of the user-mode thread, the change is nop since
corresponding syscall code does not use FPU. On the other hand,
creation of a kernel thread forks from a thread selected arbitrary
from proc0, which might use FPU.
Reported and tested by: Chris Torek <torek@torek.net>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
dim [Sat, 29 Mar 2014 00:25:27 +0000 (00:25 +0000)]
Make clang default to DWARF2 debug info format for FreeBSD 10.x and
earlier. For head, this commit does not change anything, but it is
purely meant to be MFC'd.
ray [Fri, 28 Mar 2014 22:04:27 +0000 (22:04 +0000)]
o Add new vd_driver method to do bitblt with mask, named vd_maskbitbltchr.
o Move vd_bitbltchr vga's driver method to vd_maskbitbltchr.
o Implement new vd_bitbltchr method for vga driver. (It do single write for 8
pixels, have to be a bit faster).
MFC after: 7 days
Sponsored by: The FreeBSD Foundation
kib [Fri, 28 Mar 2014 16:07:27 +0000 (16:07 +0000)]
Several fixes for the PCID implementation:
- When clearing a bit for a cpuid in pmap->pm_save, ensure that the
cpuid is not set in pm_active. The pm_save indicates which CPUs may
have cached translations for given PCID, which implies that a CPU
executing with the given pmap active have the translations
cached. [1]
- In smp_masked_invltlb(), pass pmap to smp_targeted_tlb_shootdown(). [1]
- In invlrng_handler(), check for the special values of pcid (0 and
-1) and do corresponding global or total invalidations before
checking for performing PCID-specific range invalidation with
INVPCID_ADDR. [2]
- In invltlb_pcid_handler(), do not read %cr3 unless needed. [2]
- Do minor style tweaks. [2]
Submitted by: Henrik Gulbrandsen <henrik@gulbra.net> [1]
Other parts sponsored by: The FreeBSD Foundation [2]
Tested by: Henrik Gulbrandsen, pho
MFC after: 1 week
marcel [Fri, 28 Mar 2014 04:14:40 +0000 (04:14 +0000)]
Write verbosity to stderr. The image may be written to stdout.
While here, fix writing to stderr, by not calling errc()
unconditionally, but only when there's an error.
marcel [Thu, 27 Mar 2014 22:48:48 +0000 (22:48 +0000)]
Give vtoc8 a change to work: when setting the physical block size to 4K,
sectors/track to 8 and number or heads to 1, partitions that are block
aligned are also cyclinder aligned. With that trick, fix the vtoc8:
1. Set physcyls, ncyls, altcyls, nheads and nsecs appropriately.
2. Truncate the image size to exactly ncyls * nheads * nsecs * secsz.
3. Properly write the cylinder number as the start of the partition.
4. Oh, and actually calculate the checksum of the label...
marcel [Thu, 27 Mar 2014 22:45:05 +0000 (22:45 +0000)]
1. When calculating block addresses, round to the physical block
size.
2. Replace scheme_first_block() & scheme_next_block() with
scheme_metadata(). When we round to block sizes, we can't
reliably fixup any miscalculations.
3. In scheme_write, calculate ncyls (number of cyclinders), based
on the total size, sectors/track and number of heads.
4. Add verbosity when constructing the partitions. This includes
the starting block address and size in bytes and blocks.
5. Add verbosity about the sectors/track and number of heads.
marcel [Thu, 27 Mar 2014 20:14:40 +0000 (20:14 +0000)]
1. Add -v option to increase vebosity levels
2. Fix copy-paste bug -- acrually check secsz for being a power of 2
3. Check secsz and blksz parameters
4. Print the sector and block size when -v is given
emaste [Thu, 27 Mar 2014 18:23:02 +0000 (18:23 +0000)]
amd64: Parse the EFI memory map if present
With this change (and loader.efi from the projects/uefi branch) we can now
boot under qemu using the OVMF UEFI firmware image with the limitation
that a serial console is required.
(This is largely r246337 from the projects/uefi branch.)
ray [Thu, 27 Mar 2014 14:07:36 +0000 (14:07 +0000)]
Revert r263321.
vt(9) crash on resume fixed, but Xorg still have damaged screen on resume (at
least with i915kms), so better to switch to VT0 before suspend and back on
resume.
emaste [Thu, 27 Mar 2014 13:57:00 +0000 (13:57 +0000)]
Move ia64 efi.h to sys in preparation for amd64 UEFI support
Prototypes specific to ia64 have been left in this file for now, under
__ia64__, rather than moving them to a new header under sys/ia64.
I anticipate that (some of) the corresponding functions will be shared
by the amd64, arm64, i386, and ia64 architectures, and we can adjust
this as EFI support on other than ia64 continues to develop.
ray [Thu, 27 Mar 2014 09:24:09 +0000 (09:24 +0000)]
Fix crash on resume in vt(9).
Statically allocated terminal window have not initialized callout handler, so we
have to initialize it even for existing window if it is console window.
Reported by: gjb and many
Tested by: gjb
MFC after: 7 days
Sponsored by: The FreeBSD Foundation
takawata [Thu, 27 Mar 2014 06:36:38 +0000 (06:36 +0000)]
Strict value checking will cause problem.
Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD.
This behaviour is bug-compatible with Linux-3.13.5.
neel [Wed, 26 Mar 2014 23:34:27 +0000 (23:34 +0000)]
Add an ioctl to suspend a virtual machine (VM_SUSPEND). The ioctl can be called
from any context i.e., it is not required to be called from a vcpu thread. The
ioctl simply sets a state variable 'vm->suspend' to '1' and returns.
The vcpus inspect 'vm->suspend' in the run loop and if it is set to '1' the
vcpu breaks out of the loop with a reason of 'VM_EXITCODE_SUSPENDED'. The
suspend handler waits until all 'vm->active_cpus' have transitioned to
'vm->suspended_cpus' before returning to userspace.
asomers [Wed, 26 Mar 2014 22:46:03 +0000 (22:46 +0000)]
Correct ARP update handling when the routes for network interfaces are
restricted to a single FIB in a multifib system.
Restricting an interface's routes to the FIB to which it is assigned (by
setting net.add_addr_allfibs=0) causes ARP updates to fail with "arpresolve:
can't allocate llinfo for x.x.x.x". This is due to the ARP update code hard
coding it's lookup for existing routing entries to FIB 0.
sys/netinet/in.c:
When dealing with RTM_ADD (add route) requests for an interface, use
the interface's assigned FIB instead of the default (FIB 0).
sys/netinet/if_ether.c:
In arpresolve(), enhance error message generated when an
lla_lookup() fails so that the interface causing the error is
visible in logs.
dim [Wed, 26 Mar 2014 22:30:38 +0000 (22:30 +0000)]
Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially. Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.
This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.
I tested this on a 24-core machine, with make -j48 buildworld (N = 6):
before stddev after stddev
======= ====== ======= ======
real time 1741.1 16.5 959.8 2.7
user time 12468.7 16.4 14393.0 16.8
sys time 1825.0 54.8 2110.6 22.8
(user+sys)/real 8.2 17.1
E.g. the build was approximately 45% faster in real time. On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive. But at least you can now almost max out a machine with
buildworld!
dim [Wed, 26 Mar 2014 19:57:50 +0000 (19:57 +0000)]
Avoid "cc1: warning: is shorter than expected" when using GNU cpp in
combination with dtrace scripts, which have "#!/usr/sbin/dtrace -Cs"
shebang lines. This is because dtrace positions the file pointer after
the shebang line, before passing the file to GNU cpp.
To fix the warning, adjust the size downwards by the current position,
after a bit of sanity checking.
dim [Wed, 26 Mar 2014 19:31:33 +0000 (19:31 +0000)]
Revert r263694, and apply a better fix to squelch unnecessary warnings
from clang about possible keywords being treated as identifiers for the
remainder of the translation unit (a.k.a. -Wkeyword-compat), when using
libstdc++ in combination with -Wsystem-headers. This will not only fix
devd, but any C++ program using libstdc++.
imp [Tue, 25 Mar 2014 22:32:13 +0000 (22:32 +0000)]
Add a '*' to the M modifier string so we match any -gdwarf string (even
though it works w/o it for some reason, contrary to our reading of
make(1)). Also add a comment explaining things a bit better so there's
one less mystery that must be answered with svn blame.
imp [Tue, 25 Mar 2014 22:08:31 +0000 (22:08 +0000)]
Rather than require a makeoptions DEBUG to get debug correct,
add it in kern.mk, but only if we're using clang. While this
option is supported by both clang and gcc, in the future there
may be changes to clang which change the defaults that require
a tweak to build our kernel such that other tools in our tree
will work. Set a good example by forcing -gdwarf-2 only for
clang builds, and only if the user hasn't specified another
dwarf level already. Update UPDATING to reflect the changed
state of affairs. This also keeps us from having to update
all the ARM kernels to add this, and also keeps us from
in the future having to update all the MIPS kernels and is
one less place the user will have to know to do something
special for clang and one less thing developers will need
to do when moving an architecture to clang.
asomers [Tue, 25 Mar 2014 15:03:08 +0000 (15:03 +0000)]
tests/sys/netinet/Makefile
tests/sys/netinet/fibs.sh
Replace fibs:udp_dontroute with fibs:src_addr_selection_by_subnet.
The original test was poorly written; it was actually testing
kern/167947 instead of the desired kern/187553. The root cause of the
bug is that ifa_ifwithnet did not have a fib argument. The new test
more directly targets that behavior.
tests/sys/netinet/udp_dontroute.c
Delete the auxilliary binary used by the old test
marcel [Tue, 25 Mar 2014 04:45:55 +0000 (04:45 +0000)]
First batch of media control:
1. Change -h to -H and change -t to -T. Use -H to specify the number of
heads and -T to specify the track size (number of sectors per track).
2. Add -S and -P. Use -S to specify the logical sector size and -P to
specify the physical sector size.
Default to 512 for both the logical and physical sector size.
Set nheads and nsecs to 1 by default.
marcel [Tue, 25 Mar 2014 02:32:04 +0000 (02:32 +0000)]
Allow schemes to specify a maximum sector size. The minimum is fixed
at 512. This allows checking of the sector size up-front when given
on the command line.
marcel [Tue, 25 Mar 2014 02:15:19 +0000 (02:15 +0000)]
Mostly implement the vtoc8 scheme. The vtoc8 scheme uses cylinders for
the beginning of partitions, which makes it sensitive to geometry.
Again, we'll need to revisit this.
marcel [Tue, 25 Mar 2014 00:29:56 +0000 (00:29 +0000)]
Mostly implement the pc98 scheme. The partition table has no LBA
fields at all, so we're entirely dependent upon CHS addressing.
And CHS addressing is what needs more work.
dim [Mon, 24 Mar 2014 20:30:39 +0000 (20:30 +0000)]
Apply a temporary band-aid for building devd with clang 3.4, libstdc++
and -Wsystem-headers enabled (which is the default for any non-zero
WARNS level, crazily enough!). This is primarily meant to be MFC'd as
soon as possible.