Commit Graph

45704 Commits

Author SHA1 Message Date
Ying ming d40fad4dcd test: atomic operation : add test case
Add tests with negative parameters to supplement black box tests.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-11-05 11:56:52 -08:00
Paul Sokolovsky c041a673a3 MAINTAINERS: Remove myself from POSIX subsys maintainers.
To not keep the entry empty, move to collaborators.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-11-05 11:20:13 -06:00
Trond Einar Snekvik b20a44ded8 Bluetooth: controller: Silence unused variable warning with non-AE
Places definition of lll under the ADV_EXT #ifdef in lll_adv.c:isr_tx,
to silence build warnings for non-AE builds.

Follow-up from #29753.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-05 11:10:22 -06:00
Jukka Rissanen c678420b6f doc: net: Add info how to capture IEEE 802.15.4 QEMU traffic
Add additional information how to capture IEEE 802.15.4 traffic
to a pcap file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-05 10:14:43 -06:00
Jukka Rissanen 09bb29cdea doc: net: Add info how to run IEEE 802.15.4 between two QEMUs
Add information how to run two QEMUs and have IEEE 802.15.4 link
layer over UART between them. This is useful if one needs to test
basic IEEE 802.15.4 functionality without a IEEE 802.15.4 radio.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-05 10:14:43 -06:00
Alexander Kozhinov 7b3071a57d boards: arm: nucleo_h745zi_q: doc
add new modules description documentation

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-11-05 10:09:42 -06:00
Emil Hammarstrom 389a03777e manifest: sync mbedtls alpn extension
- Adds mbedtls alpn negotiation support

Signed-off-by: Emil Hammarstrom <emil.a.hammarstrom@gmail.com>
2020-11-05 08:58:56 -06:00
Andrew Boie 7de5e5753d userspace: update k_mem_domain_add_partition docs
We no longer require partitions to be within RAM bounds,
MMIO or other mapped memory are fine too.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 7a1a0aac44 x86_64: disable shared_mem test until bugs fixed
re-enabling this test was premature, it still crashes very often
due to two known issues affecting x86 64-bit. Filter out for
every 64-bit x86 platform until those bugs are solved, which
will reduce CI failure noise.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 4c87224818 x86: add qemu_x86_tiny
This build target has all the low-memory options enabled for
memory management: a 4MB address space, 32-bit paging mode,
no KPTI, an empty page pool, and common page tables for
memory domains.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie d2a72273b7 x86: add support for common page tables
We provide an option for low-memory systems to use a single set
of page tables for all threads. This is only supported if
KPTI and SMP are disabled. This configuration saves a considerable
amount of RAM, especially if multiple memory domains are used,
at a cost of context switching overhead.

Some caching techniques are used to reduce the amount of context
switch updates; the page tables aren't updated if switching to
a supervisor thread, and the page table configuration of the last
user thread switched in is cached.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie cd789a7ac7 x86: add logs for tuning page pool size
This will do until we can set up a proper page pool using
all unused ram for paging structures, heaps, and anonymous
mappings.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 8e5114b370 x86: update X86_MMU_PAGE_POOL_PAGES documentation
Help users understand how this should be tuned. Rather than
guessing wildly, set the default to 0. This needs to be tuned
on a per-board, per-application basis anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 0dae74e4a5 boards: x86: tune X86_MMU_PAGE_POOL_PAGES
These are set such that we have enough pages in the pool
for typical driver mappings and to instantiate two more
memory domains, which is what our tests require.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie a15be58019 x86: move page table reservation macros
We don't need this for stacks any more and only use this
for pre-calculating the boot page tables size. Move to C
code, this doesn't need to be in headers anywhere.

Names adjusted for conciseness.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Lauren Murphy 39523f45c5 boards: Add qemu_x86_64_nokpti target
Adds a build target to run tests on qemu_x86_64 with KPTI disabled.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2020-11-05 09:33:40 -05:00
Lauren Murphy 67395d6f07 boards: Add qemu_x86_nokpti target
Adds a build target to run tests on qemu_x86 with KPTI disabled.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 4303d35380 tests: mem_protect: add migration test case
We need to make sure that if we migrate a thread to another
memory domain, the migration process doesn't cause the target
thread to explode. This is mostly a concern on SMP systems;
the thread could be running on another CPU at the same time.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 1367c4a4b7 x86: don't reserve room for page tables in stack
These are handled at the memory domain level now.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie b8242bff64 x86: move page tables to the memory domain level
- z_x86_userspace_enter() for both 32-bit and 64-bit now
  call into C code to clear the stack buffer and set the
  US bits in the page tables for the memory range.

- Page tables are now associated with memory domains,
  instead of having separate page tables per thread.
  A spinlock protects write access to these page tables,
  and read/write access to the list of active page
  tables.

- arch_mem_domain_init() implemented, allocating and
  copying page tables from the boot page tables.

- struct arch_mem_domain defined for x86. It has
  a page table link and also a list node for iterating
  over them.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 86cfd90026 userspace: move mem_domain->arch first
This sub-struct may have alignment requirements, move it to
the first member.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie 745dd6f931 x86: use unused PTE bits when mapping memory
Page table management for x86 is being revised such that there
will not in many cases be a pristine, master set of page tables.
Instead, when mapping memory, use unused PTE bits to store the
original RW, US, and XD settings when the mapping was made.

This will allow memory domains to alter page tables while still
being able to restore the original mapping permissions.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie bd76bdb8ff x86: define some unused PTE bits
These are ignored by the CPU and may be used for OS
accounting.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie d31f62a955 x86: smp: add TLB shootdown logic
This will be needed when we support memory un-mapping, or
the same user mode page tables on multiple CPUs. Neither
are implemented yet.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Andrew Boie eeab568a27 tests: userspace: fix tests that don't hold on MMU
MMU threads within the same memory domain have access to
each other's stacks.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Jeremy LOCHE d943d146c9 boards: nucleo_h743zi: enable ethernet support
Since STM32H7 series now have a working ethernet driver,
nucleo_h743zi ethernet can be enabled.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-11-05 08:30:06 -06:00
Marcin Niestroj fbc487cce3 net: tls: use Maximum Fragment Length (MFL) extension by default
Call mbedtls_ssl_conf_max_frag_len() on created TLS context
configuration, so that Maximum Fragment Length (MFL) will be sent to
peer using RFC 6066 max_fragment_length extension. MFL value is
automatically chosen based on MBEDTLS_SSL_OUT_CONTENT_LEN and
MBEDTLS_SSL_IN_CONTENT_LEN mbed TLS macros.

This extension is mostly useful for TLS client side to tell TLS server
what is the maximum supported receive record length.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-11-05 14:47:24 +02:00
Andrzej Kaczmarek dd5e9c4da1 Bluetooth: controller: Add common def for max AD size on legacy
This def can be used instead of hardcoding "31" everywhere.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-05 12:17:16 +01:00
Andrzej Kaczmarek 5166426940 Bluetooth: controller: Fix timings for non-1M PHY on advertising
We need to use actual phy wherever required to make sure radio delays
are calculated properly. This is especially important for LE Coded
since delays for that phy are significantly higher than on 1M and 2M.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-05 12:17:16 +01:00
Andrzej Kaczmarek 1df5897679 Bluetooth: controller: Verify AD length for legacy adv
We should not allow setting more than 31 bytes of AD on legacy
instances.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-05 12:17:16 +01:00
Andrzej Kaczmarek 5aab391f4b Bluetooth: controller: Update HCI supported cmds with ext adv
Return proper bitmask of supported commands when extended advertising
enabled.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-05 12:17:16 +01:00
Andrzej Kaczmarek f2de6931de Bluetooth: controller: Remove redundant check
ull_adv_data_set() is only used for legacy advertising data (either via
legacy HCI command or as fallback for extended advertising set which
uses legacy PDUs) so there is no need to check for extended advertising.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-05 12:17:16 +01:00
Andrzej Kaczmarek aec809e75e Bluetooth: controller: Remove redundant check
We handle secondary channel only for extended advertising sets, that
means we always have ADV_EXT_IND on primary channel so there is no need
to support non-ext PDUs here.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-05 12:17:16 +01:00
Dominik Ermel 92b0fd652c fs: Document fs_open and fs_seek flags
Descriptions of fs_open flags have been added and descriptions of
whence options to_fs_seek have been moved, to make them visible
in html documentation.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-11-05 12:12:33 +01:00
Trond Einar Snekvik 86c793af3f sys: util: Replace MIN(MAX(a, b), c) with CLAMP
Replaces all existing variants of value clamping with the MIN and MAX
macros with the CLAMP macro.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-05 12:12:17 +01:00
Trond Einar Snekvik ed1f75da74 sys: util: Add clamp macro
Adds CLAMP macro to complement the current min/max macros, as well as a
gcc specific Z_CLAMP macro for single-evaluation expansion.

CLAMP combines the functionality of MIN and MAX, eliminating the
bug-prone usage of MIN(MAX(value, FLOOR), CEIL) found throughout the
codebase in every possible combination.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-05 12:12:17 +01:00
Abhishek Shah 1ecdbacc9d drivers: pcie_ep: iproc: clear pvm interrupts before handling
We should clear the pvm interrupts (snoop and pcie pmon lite interrupt)
at source before handling them.

This will make sure that we do not lose any interrupts that may have
been asserted to interrupt controller during the handling routine.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-11-05 10:18:20 +01:00
Maximilian Bachmann b3c5fe6720 kernel: return error instead of misaligned k_thread object
k_object_alloc(K_OBJ_THREAD) returns a usable struct k_thread pointer.
This pointer is 4 byte aligned. On x86 and x86_64 struct _thread_arch
has a member which requires alignment. Since this is currently not
supported k_object_alloc(K_OBJ_THREAD) now returns an error instead of
a misaligned pointer.

Signed-off-by: Maximilian Bachmann <m.bachmann@acontis.com>
2020-11-04 14:03:43 -08:00
Carlo Caione 7b7c328f7a aarch64: mmu: Enable support for unprivileged EL0
The current MMU code is assuming that both kernel and threads are both
running in EL1, not supporting EL0. Extend the support to EL0 by adding
the missing attribute to mirror the access / execute permissions to EL0.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-11-04 13:58:19 -08:00
Carlo Caione fd559f16a5 aarch64: mmu: Create new header file
The MMU coded is polluted by a lot of preprocessor code. Move that code
to a proper header file.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-11-04 13:58:19 -08:00
Carlo Caione b9a407b65c aarch64: mmu: Move MMU files in a sub-directory
We are probably going to do more work on the MMU side and more files
will be added. Create a new sub-directory to host all the MMU related
files.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-11-04 13:58:19 -08:00
Gerard Marull-Paretas ddd0a97206 boards: arm: nucleo_h743zi: add support for stm32cubeprogrammer runner
Add support for the recently introduced STM32CubeProgrammer runner.
Updated documentation to mention its availability as latest official
OpenOCD releases do not support H7 series.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-11-04 14:47:35 -06:00
Gerard Marull-Paretas e066a00d5e runners: stm32cubeprogrammer: add tests
Add tests for the stm32cubeprogrammer runner.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-11-04 14:47:35 -06:00
Gerard Marull-Paretas f98dd24993 runners: add support for stm32cubeprogrammer
Add support for the official ST Microelectronics programming tool (CLI
version).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-11-04 14:47:35 -06:00
Kumar Gala fabf40398f ci: github: Update for deprecation of add-path
Github has deprecated add-path, so update the workflows that use it to
the new method of setting the PATH.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-11-04 14:45:08 -06:00
Erwan Gouriou afd899ee6f boards: nucleo_g4*: Remove USB support
There is no user USB port available on these boards.
Remove support and remove files when no more needed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-11-04 12:21:30 -06:00
Eduardo Montoya dc56ace3da net: openthread: fix maximum number of children range
This commit corrects the maximum allowed amount of children to
match Thread specification.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2020-11-04 18:08:48 +02:00
Eduardo Montoya 8399a6067d net: openthread: allow to configure platform info
This commit adds the option to configure the platform information
string of OpenThread.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2020-11-04 18:08:48 +02:00
Peter Bigot 96bd6f79b9 shell: fix declarations for external device arrays
The objects should be const-qualified for consistency with other uses,
including declarations in headers.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-04 12:14:45 +01:00
Jukka Rissanen c31148b04c net: tcp2: Update seq when peer closes connection
If the peer ACKs data when it closes the connection, update
our sequence number accordinly. The connection would eventually
be terminated but this will avoid extra resends by the peer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-04 11:17:47 +02:00