254517 Commits

Author SHA1 Message Date
christos
d62b6e0709 new files for acpica-20171110 2017-11-12 03:02:15 +00:00
christos
732dc8379f Provide a primitive incrementing counter if we are call since the new
Acpi dispatcher requires us to have one when we are cold (shudder).
2017-11-12 02:59:55 +00:00
christos
b406f703fa ----------------------------------------
10 November 2017. Summary of changes for version 20171110:


1) ACPICA kernel-resident subsystem:

This release implements full support for ACPI 6.2A:
    NFIT - Added a new subtable, "Platform Capabilities Structure"
No other changes to ACPICA were required, since ACPI 6.2A is primarily an
errata release of the specification.

Other ACPI table changes:
    IORT: Added the SMMUv3 Device ID mapping index. Hanjun Guo
    PPTT: Added cache attribute flag definitions to actbl1.h. Jeremy
Linton

Utilities: Modified the string/integer conversion functions to use
internal 64-bit divide support instead of a native divide. On 32-bit
platforms, a 64-bit divide typically requires a library function which
may not be present in the build (kernel or otherwise).

Implemented a targeted error message for timeouts returned from the
Embedded Controller device driver. This is seen frequently enough to
special-case an AE_TIME returned from an EC operation region access:
    "Timeout from EC hardware or EC device driver"

Changed the "ACPI Exception" message prefix to "ACPI Error" so that all
runtime error messages have the identical prefix.


2) iASL Compiler/Disassembler and Tools:

AcpiXtract: Fixed a problem with table header detection within the
acpidump file. Processing a table could be ended early if a 0x40 (@)
appears in the original binary table, resulting in the @ symbol appearing
in the decoded ASCII field at the end of the acpidump text line. The
symbol caused acpixtract to incorrectly think it had reached the end of
the current table and the beginning of a new table.

AcpiXtract: Added an option (-f) to ignore some errors during table
extraction. This initial implementation ignores non-ASCII and non-
printable characters found in the acpidump text file.

TestSuite(ASLTS)/AcpiExec: Fixed and restored the memory usage statistics
for ASLTS. This feature is used to track memory allocations from
different memory caches within the ACPICA code. At the end of an ASLTS
run, these memory statistics are recorded and stored in a log file.

Debugger (user-space version): Implemented a simple "Background" command.
Creates a new thread to execute a control method in the background, while
control returns to the debugger prompt to allow additional commands.
    Syntax: Background <Namepath> [Arguments]

----------------------------------------
29 September 2017. Summary of changes for version 20170929:


1) ACPICA kernel-resident subsystem:

Redesigned and implemented an improved ASL While() loop timeout
mechanism. This mechanism is used to prevent infinite loops in the kernel
AML interpreter caused by either non-responsive hardware or incorrect AML
code. The new implementation uses AcpiOsGetTimer instead of a simple
maximum loop count, and is thus more accurate and constant across
different machines. The default timeout is currently 30 seconds, but this
may be adjusted later.

Renamed the ACPI_AML_INFINITE_LOOP exception to AE_AML_LOOP_TIMEOUT to
better reflect the new implementation of the loop timeout mechanism.

Updated the AcpiGetTimerDuration interface to cleanup the 64-bit support
and to fix an off-by-one error. Jung-uk Kim.

Fixed an EFI build problem by updating the makefiles to for a new file
that was added, utstrsuppt.c


2) iASL Compiler/Disassembler and Tools:

Implemented full support for the PDTT, SDEV, and TPM2 ACPI tables. This
includes support in the table disassembler, compiler, and template
generator.

iASL: Added an exception for an illegal type of recursive method
invocation. If a method creates named objects, the first recursive call
will fail at runtime. This change adds an error detection at compile time
to catch the problem up front. Note: Marking such a method as
"serialized" will not help with this problem, because the same thread can
acquire the method mutex more than once. Example compiler and runtime
output:

    Method (MTH1)
    {
        Name (INT1, 1)
        MTH1 ()
    }

    dsdt.asl     22: MTH1 ()
    Error    6152 -  ^ Illegal recursive call to method
                       that creates named objects (MTH1)

Previous runtime exception:
    ACPI Error: [INT1] Namespace lookup failure,
    AE_ALREADY_EXISTS (20170831/dswload2-465)

iASL: Updated support for External() opcodes to improve namespace
management and error detection. These changes are related to issues seen
with multiple-segment namespace pathnames within External declarations,
such as below:

    External(\_SB.PCI0.GFX0, DeviceObj)
    External(\_SB.PCI0.GFX0.ALSI)

iASL: Implemented support for multi-line error/warning messages. This
enables more detailed and helpful error messages as below, from the
initial deployment for the duplicate names error:

    DSDT.iiii   1692:       Device(PEG2) {
    Error    6074 -                  ^ Name already exists in scope
(PEG2)

        Original name creation/declaration below:
        DSDT.iiii     93:   External(\_SB.PCI0.PEG2, DeviceObj)

AcpiXtract: Added additional flexibility to support differing input hex
dump formats. Specifically, hex dumps that contain partial disassembly
and/or comments within the ACPI table data definition. There exist some
dump utilities seen in the field that create this type of hex dump (such
as Simics). For example:

    DSDT @ 0xdfffd0c0 (10999 bytes)
        Signature DSDT
        Length 10999
        Revision 1
        Checksum 0xf3 (Ok)
        OEM_ID BXPC
        OEM_table_id BXDSDT
        OEM_revision 1
        Creator_id 1280593481
        Creator_revision 537399345
      0000: 44 53 44 54 f7 2a 00 00 01 f3 42 58 50 43 00 00
      ...
      2af0: 5f 4c 30 46 00 a4 01

Test suite: Miscellaneous changes/fixes:
    More cleanup and simplification of makefiles
    Continue compilation of test cases after a compile failure
    Do not perform binary compare unless both files actually exist

iASL: Performed some code/module restructuring. Moved all memory
allocation functions to new modules. Two new files, aslallocate.c and
aslcache.c
2017-11-12 01:38:30 +00:00
mrg
0c98858fbf merge GCC 5.5.0. this does not include updated man/info pages (yet). 2017-11-12 00:36:44 +00:00
mrg
3f4ceed98f initial import of GCC 5.5.0. this fixes a very large number of PRs.
280 are listed here:
    https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=5.5
and this list is likely not complete, and not reproduced here.  the
only specific change in functionality is removal of x86 "pcommit"
instruction (which was apparently never implemented.)
2017-11-11 23:49:21 +00:00
rin
f345b5cb3f Add -h option to factor(6): duplicate factors are printed in
"human-readable" form of x^n.
2017-11-11 23:48:44 +00:00
riastradh
cfbebed12c Add KASSERT to confirm no change in xen intr MP-safety annotations. 2017-11-11 21:05:58 +00:00
riastradh
a8d44f5e28 Restore MP-safety annotations in intr_establish_xname.
In the old API, event_set_handler would assume MP-unsafe for IPL_VM
and MP-safe for all other levels (IPL_SCHED, IPL_HIGH).  The recent
Xen interrupt rototill started passing known_mpsafe=true for _all_
interrupt handlers.  Change it to known_mpsafe=false for the IPL_VM
(= IPL_CLOCK, IPL_NET) ones.
2017-11-11 21:03:01 +00:00
mrg
33448d9f6d bump PAGER_MAP_DEFAULT_SIZE to 512MB. this should allow more
concurrent IOs to be possible, and i'm unable to see pager_map
contention any more.

other larger platforms should probably do this too.

ok chs@.
2017-11-11 20:23:49 +00:00
riastradh
ecf2b7f871 KNF NFC 2017-11-11 19:25:29 +00:00
alnsn
5486dd5a65 Use a more efficient data structure for graph peeling.
New code is about 50% faster on amd64 and it consumes less memory.
2017-11-11 18:05:31 +00:00
riastradh
28931967d6 Free ih when done. 2017-11-11 17:37:03 +00:00
riastradh
46e6a966df Pass xname through Xen intr_establish_xname to event_set_handler. 2017-11-11 17:26:51 +00:00
riastradh
bffa4b4ac2 Back out previous KASSERTMSG for now.
The immediate problem appears to have been elsewhere, in the wrong
interrupt level passed by the Xen-specific intr_establish to
event_set_handler.

We should maybe restore these assertions later, but at least one was
violated before cherry's interrupt rototill anyway.
2017-11-11 17:02:53 +00:00
jdolecek
2eed15f4fa change several of error logs in ahci_intr_port() to use AHCIDEBUG_PRINT()
so they don't show unless debugging; e.g. the AHCI_P_IX_TFES seems to be
triggered normally by ATAPI with 'Media Change' error

adresses 'dmesg spam: ahcisata0 port 1: active 2 is 0x40000001 tfd 0x2051'
thread by Stefan Hertenberger on current-users@
2017-11-11 16:49:13 +00:00
maya
0bb4b5384f don't use auto_ptr with memory allocated by C code
silences alloc-dealloc-mismatch warnings from asan

from joerg
2017-11-11 14:16:06 +00:00
maxv
5d72504c56 Detect collisions from bootspace directly. 2017-11-11 13:50:57 +00:00
maxv
ce4ddbdb65 Modify the layout of the bootspace structure, in such a way that it can
contain several kernel segments of the same type (eg several .text
segments). Some parts are still a bit messy but will be cleaned up soon.

I cannot compile-test this change on i386, but it seems fine enough.

NOTE: you need to rebuild and reinstall a new prekern after this change.
2017-11-11 12:51:05 +00:00
maxv
29dd433d35 Recommit
http://mail-index.netbsd.org/source-changes/2017/11/08/msg089525.html

but use __INITIAL_MXCSR_MASK__ on Xen until someone figures out what's
wrong with the Xen fpu.
2017-11-11 11:00:46 +00:00
bouyer
3a13dce148 Revert http://mail-index.netbsd.org/source-changes/2017/11/08/msg089525.html,
it breaks Xen:
http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/amd64/201711082340Z_anita.txt
2017-11-11 09:10:19 +00:00
riastradh
b9bef0f2c1 Add kasserts to help diagnose xen interrupt level bug.
https://mail-index.netbsd.org/tech-kern/2017/11/09/msg022571.html
2017-11-11 08:23:50 +00:00
riastradh
71a3b17026 #if DIAGNOSTIC panic ---> KASSERTMSG 2017-11-11 08:22:08 +00:00
riastradh
10bbfa07e1 Pass IPL through from intr_establish to event_set_handler.
Don't unconditionally use IPL_CLOCK, which aside from being the wrong
IPL for non-IPL_CLOCK interrupt handlers has the side effect of running
all interrupt handlers without the giant lock, even those that are not
MP-safe.

This is a step toward fixing:

https://mail-index.netbsd.org/tech-kern/2017/11/09/msg022571.html

ok cherry
2017-11-11 07:52:41 +00:00
kamil
e96e0a6e7b Build liblto_plugin.so with safe-ctype.c
This corrects linking attempt with GNU binutils GOLD (linker).

ld.gold: error: /usr/libexec/liblto_plugin.so: \
could not load plugin library: /usr/libexec/liblto_plugin.so: \
Undefined symbol "_sch_istable" (symnum = 12)

Keep the same minor for the previous recent bump.
2017-11-11 07:49:43 +00:00
riastradh
6eff6a32e1 #if DIAGNOSTIC panic ---> KASSERTMSG 2017-11-11 07:46:52 +00:00
riastradh
299156f04c No externs in .c files! 2017-11-11 06:16:52 +00:00
christos
b328643cbf Don't add kevents to closing file descriptors (from riastradh) 2017-11-11 03:58:01 +00:00
matt
3434f4f9d2 Add #define CPU_CORTEDVIRT to reduce copied complex ifdef.
Shrink HYP test
2017-11-10 22:54:20 +00:00
matt
6c151e6567 Add CPU_CORTEXA35 2017-11-10 22:07:30 +00:00
christos
874da4738d Instead of opening the file and using popen(3), pass the file descriptor
to sendmail directory. Idea and code from Todd Miller.
2017-11-10 20:01:11 +00:00
riastradh
6dcdfbc9ce Fix theoretical race in xen_evtchn_trymask.
This now matches ioapic_trymask:

- Caller masks CPU interrupts while the PIC's interrupts are unmasked.
- Trymask masks the PIC's interrupts, and tests whether any were
  pending that we missed because the CPU interrupts are masked.

  ==> If there were any pending, trymask unmasks PIC's interrupts and
      returns false.

  ==> If not, interrupts are masked on the PIC and CPU and there were
      none pending and trymask returns true.

No functional change right now because cpu_intr_redistribute is
currently disabled on Xen.

ok cherry
2017-11-10 19:24:17 +00:00
rin
59b9a29460 Restore the initial state at the end of line.
This matters for stateful encodings like iso-2022-jp.
Fix taken from yamt via nvi2.
2017-11-10 18:08:11 +00:00
kre
d1b3ee239b PR bin/52715
Correct a (relatively harmless) use after free in prompt expansion
processing [detected by asan.]

Relatively harmless: as (while incorrect) the way the data is (was)
used more or less guaranteed that the buffer contents would be
unaltered until well after they are (were) no longer wanted (this
is the expanded prompt string, it is just output (or copied into
libedit internal storage) and forgotten.

This should make no visible difference to anyone (not using asan or
similar.)

XXX pullup -8
2017-11-10 17:31:12 +00:00
christos
7c6c19a729 make the checkok test stricter to avoid races, and use O_REGULAR. 2017-11-10 16:35:54 +00:00
rin
e6cc4be609 Change the behavior of join command in accordance with nvi-m17n, as proposed on
tech-userlevel@; when the last and first chars in joined lines are multi-width,
do not insert a white space.
2017-11-10 14:53:00 +00:00
rin
c027196202 - Fix cursor position when a multiwidth char does not fit within a line.
- Put cursor on the leftmost column of a multiwidth char, instead of
  the rightmost one. Otherwise, some terminal emulators do not focus on
  the entire of the char.

Logic taken from nvi-m17n by itojun.
2017-11-10 14:44:13 +00:00
rin
2f18f6f88c PR bin/52716 fix buffer overrun found by libasan 2017-11-10 14:35:25 +00:00
maxv
ef0cca4ccf Implement memcpy, the builtin version does not work with variable sizes. 2017-11-10 08:52:57 +00:00
maxv
f3ab445a9b Add cpuid and rdseed. 2017-11-10 08:05:38 +00:00
ozaki-r
b9e3a5a1e9 Use psref instead of pserialize because that code is sleepable 2017-11-10 07:25:39 +00:00
ozaki-r
1c27f64d6f Fix a deadlock between a route update and lltable
It happens because rtalloc1 is called from lltable with holding
IF_AFDATA_WLOCK.

If a route update is in action, rtalloc1 would wait for its completion with
holding IF_AFDATA_WLOCK. At the same moment, a softint (e.g., arpintr) may try
to take IF_AFDATA_WLOCK and get stuck on it. Unfortunately the stuck softint
prevents the route update from progressing because the route update calls
psref_target_destroy that needs the softint to complete.

A resource allocation graph of the senario looks like this:
    route update =(psref_target_destroy)=> softint => IF_AFDATA_WLOCK
    =(rt_update_wait)=> route update

Fix the deadlock by pulling rtalloc1 out of the lltable codes inside
IF_AFDATA_WLOCK.

Note that the deadlock happens only if NET_MPSAFE is enabled.
2017-11-10 07:24:28 +00:00
ozaki-r
faf7d24046 Remove redundant KASSERTMSG
The function is static, has just one caller and the caller does the same check.
2017-11-10 07:15:32 +00:00
jmcneill
c9a5fdb236 Allwinner NAND Flash Controller driver. Work in progress. 2017-11-10 00:09:23 +00:00
ryoon
70e5c409c3 Do not emit a meaningless message when lid open/close from valz(4) 2017-11-09 23:51:54 +00:00
riastradh
509483453b Assert KM_SLEEP xor KM_NOSLEEP in all kmem allocation. 2017-11-09 23:20:12 +00:00
christos
17c894d283 Add assertions that either PR_WAITOK or PR_NOWAIT are set. 2017-11-09 22:52:26 +00:00
riastradh
62e8934c32 panic ex nihilo -- PR_NOWAITing for zerot 2017-11-09 22:34:07 +00:00
christos
127c64cbda use PR_NOWAIT instead of 0 2017-11-09 22:22:58 +00:00
christos
b3254cd976 Don't use 0 for PR_NOWAIT 2017-11-09 22:21:27 +00:00
christos
0fddc7f03d use PR_NOWAIT. 2017-11-09 22:20:25 +00:00