Commit graph

97599 commits

Author SHA1 Message Date
Adrian Chadd 4982d693ac Add support to export the contents of the notification updates from the firmware.
Right now the NIC isn't actually exporting useful data. I'm not quite sure
why this is. :(
2014-03-29 19:53:04 +00:00
Adrian Chadd e6f2713747 Fix ah_powerMode setting.
Reported by:	sbruno
2014-03-29 18:56:11 +00:00
Andrew Turner d4f9011c2e 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.
2014-03-29 14:35:36 +00:00
Andrew Turner 2819cfdf3f Initialise fpscr to a sane value when we create the pcb. This sets NaNs to
be the default NaN and for denormalised numbers to be flushed to zero.
2014-03-29 14:17:04 +00:00
Konstantin Belousov 65f99c74fb 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
2014-03-29 11:56:33 +00:00
Andrew Turner 4797432ff7 Add more flags for the fpexc register from the ARM1176JZF-S Manual 2014-03-29 10:11:19 +00:00
Aleksandr Rybalko 1da9f0d73a 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
2014-03-28 22:04:27 +00:00
Konstantin Belousov 965cc255c9 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
2014-03-28 16:07:27 +00:00
Aleksandr Rybalko d27ad6d0ec Enable to build UEFI framebuffer driver for vt(4).
It can be enabled by "device vt_efifb" in kernel config.

Requested by:	emaste
Sponsored by:	The FreeBSD Foundation
2014-03-28 12:50:39 +00:00
Ed Maste df5dd82a32 Fix missed efi.h header change in r263815
Pointy hat to:	emaste
2014-03-28 11:46:54 +00:00
Takanori Watanabe 95c52f142d Change default logic to CONFORM because this routine is shared
with SCI polarity setting.

Reviewed by: jhb
2014-03-28 02:38:14 +00:00
Ed Maste d1d4f00e9a Update EFI framebuffer handoff from loader
Sponsored by:	The FreeBSD Foundation
2014-03-27 19:43:38 +00:00
Ed Maste c018226f1a 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.)

Sponsored by:	The FreeBSD Foundation
2014-03-27 18:23:02 +00:00
Aleksandr Rybalko fe930c5220 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.

Sponsored by:	The FreeBSD Foundation
2014-03-27 14:07:36 +00:00
Ed Maste 35d75b3087 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.

Sponsored by:	The FreeBSD Foundation
2014-03-27 13:57:00 +00:00
Edward Tomasz Napierala 0f26fd2c61 Remove ctl_mem_pool.{c,h}.
Sponsored by:	The FreeBSD Foundation
2014-03-27 11:10:13 +00:00
Edward Tomasz Napierala 6d9d321647 Rework cfiscsi_datamove_in() to obey expected data transfer length
received from the initiator.

Sponsored by:	The FreeBSD Foundation
2014-03-27 10:15:35 +00:00
Aleksandr Rybalko 231f843f55 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
2014-03-27 09:24:09 +00:00
Takanori Watanabe 337877ca21 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.

References:
http://d.hatena.ne.jp/syuu1228/20140326
http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094

Submitted by: syuu
2014-03-27 06:36:38 +00:00
Takanori Watanabe 7dcf10fe67 To check polarity, check ACPI_MADT_POLARITY_CONFORMS, instead of ACPI_MADT_TRIGGER_CONFORMS.
PR:amd64/188010
Submitted by: syuu
2014-03-27 06:08:07 +00:00
Neel Natu b15a09c05e 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.

Discussed with:	grehan
2014-03-26 23:34:27 +00:00
Alan Somers 743c072a09 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.

tests/sys/netinet/fibs_test.sh
	Clear ATF expected error.

PR:		kern/167947
Submitted by:	Nikolay Denev <ndenev@gmail.com> (previous version)
Reviewed by:	melifaro
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corporation
2014-03-26 22:46:03 +00:00
John Baldwin 6b7797339b Fix build without SMP.
PR:		kern/187854
MFC after:	1 week
2014-03-26 17:40:13 +00:00
Mateusz Guzik 0ab7a1f396 Document a known problem with handling the process intended to receive
SIGIO in /dev/devctl.

Suggested by:	adrian
MFC after:	6 days
2014-03-25 23:30:35 +00:00
Mateusz Guzik 88b7c833d2 Remove long obsolete sysctl hw.bus.devctl_disable.
Suggested by:	imp
Relnotes:	yes
2014-03-25 23:19:45 +00:00
Mateusz Guzik 6abaea7d58 Remove lockless check in devopen, while correct it does not make much sense.
Suggested by:	imp
MFC after:	6 days
2014-03-25 23:13:46 +00:00
Warner Losh ef53f64d9e Define PSL_SRR1_MASK for BOOK-E too so MPC85XX compiles again. 2014-03-25 22:49:33 +00:00
Warner Losh 993c4ac158 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.

Submitted by:	ian@
2014-03-25 22:32:13 +00:00
Warner Losh 3ad1a09169 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.

Reviewed by:	ian@
MFC after:	1 week
2014-03-25 22:08:31 +00:00
Hiren Panchasara 153edc50d7 Correct the comments as support for RFC 1644 has been removed for a long time. 2014-03-25 21:57:50 +00:00
Edward Tomasz Napierala ea86ccce9b Target Transfer Tag is opaque; no need to htonl(3) it.
Sponsored by:	The FreeBSD Foundation
2014-03-25 19:28:40 +00:00
Tycho Nightingale e883c9bb40 Move the atpit device model from userspace into vmm.ko for better
precision and lower latency.

Approved by:	grehan (co-mentor)
2014-03-25 19:20:34 +00:00
Edward Tomasz Napierala 717f4815f3 Move the ic_outstanding_count under #ifdef DIAGNOSTIC.
Sponsored by:	The FreeBSD Foundation
2014-03-25 19:17:22 +00:00
Edward Tomasz Napierala cf23c509ed Fix harmless warning after reconnecting a session and not doing anything
with it.

Sponsored by:	The FreeBSD Foundation
2014-03-25 19:09:52 +00:00
Edward Tomasz Napierala a9f2f291d3 Use newly added extended LUN support in CAM.
Sponsored by:	The FreeBSD Foundation
2014-03-25 19:05:05 +00:00
Edward Tomasz Napierala b1277ad1f7 Use a less unusual syntax in debug printfs.
Sponsored by:	The FreeBSD Foundation
2014-03-25 18:30:57 +00:00
Ganbold Tsagaankhuu fe47fb7b1c Switch to my freebsd.org emal address in copyright.
Approved by:	stas (mentor)
2014-03-25 08:31:47 +00:00
Martin Matuska d318d97fb5 Merge from projects/pf r251993 (glebius@):
De-vnet hash sizes and hash masks.

Submitted by:	Nikos Vassiliadis <nvass gmx.com>
Reviewed by:	trociny

MFC after:	1 month
2014-03-25 06:55:53 +00:00
Mateusz Guzik 37dbba2a44 Make /dev/devctl mpsafe.
MFC after:	1 week
2014-03-25 03:28:58 +00:00
Ganbold Tsagaankhuu 7717df1279 Add code for enabling second CPU core for A20 SoC.
Enable SMP on Cubieboard2.

Approved by:	stas (mentor)
2014-03-25 01:34:39 +00:00
Luiz Otavio O Souza 855feb6867 Adds the ADC driver for TI AM3xxx SoC family.
The ADC has a 12bit resolution and its raw output can be read via sysctl(8)
interface.

The driver allows the setup of ADC clock, samples average and open delay
(the number of clock cycles to wait before start the conversion).

The TSC_ADC module is set in the general purpose mode (no touchscreen
support).

Tested on Beaglebone-black.

Written based on AM335x TRM.

Reviewed by:	rpaulo
Approved by:	adrian (mentor)
Tested by:	me, Brian J. McGovern, Sulev-Madis Silber (ketas)
2014-03-24 20:06:27 +00:00
Maksim Yevmenkin b646225a13 change defaule permissions on /dev/devstat. while i'm here remove
D_NEEDGIANT flag

Submitted by:	jhb
Reviewed by:	jhb, scottl, rwatson, delphij, phk
MFC after:	1 week
2014-03-24 18:13:41 +00:00
Andrew Turner c9ccb0bb6b Move an else case that was missed in r263676 2014-03-24 08:24:32 +00:00
Andrew Turner 24456bdb9c Reorder the pmap macros so "ARM_MMU_V6 + ARM_MMU_V7" is first. As they are
identical this allows us to build for both v6 and v7 together.
2014-03-23 21:08:18 +00:00
Bjoern A. Zeeb e84dc12907 For the moment also disable interrupts on the altera-jtag-uart imitation
and force polling mode.
2014-03-23 20:35:58 +00:00
Andrew Turner 73279d4113 Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.
This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
 * WITH_ARM_EABI
 * WITHOUT_GCC
 * WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
 * WITH_CLANG
 * WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.
2014-03-23 12:49:25 +00:00
Neel Natu d6543c678c Don't lose track of the KTR entries copied from 'ktr_buf_init[]' to the
dynamically allocated 'ktr_buf[]'.

The memcpy arranges 'ktr_buf[]' such that the latest KTR entry is at
'KTR_BOOT_ENTRIES - 1'.
2014-03-22 22:35:57 +00:00
Gleb Smirnoff c1974e298d sfxge: limit software Tx queue size.
Previous implementation limits put queue size only (when Tx lock can't
be acquired), but get queue may grow unboundedly which results in mbuf
pools exhaustion and latency growth.

Submitted by:	Andrew Rybchenko <Andrew.Rybchenko at oktetlabs.ru>
Sponsored by:	Solarflare Communications, Inc.
2014-03-22 18:24:44 +00:00
Andrew Turner 0f6e287159 Simplify how we build MACHINE_ARCH. There are 3 options that may be set
however only arm, armeb, armv6, and soon armv6hf will be used.
2014-03-22 15:59:18 +00:00
Bjoern A. Zeeb da1b85e4b2 For BERI on NetFPGA assume HZ=100 by default.
Remove the uart support in favour of a "jtag-uart" interface imitation
providing a much simpler interface, directly exported to the host,
allowing the toolchain to be shared with BERI on Altera. [1]

Submitted by:	Jong Hun HAN (jong.han cl.cam.ac.uk) [1]
MFC after:	2 weeks
2014-03-22 13:06:32 +00:00