2021-02-18 02:01:39 +01:00
|
|
|
#
|
|
|
|
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
|
|
|
#
|
|
|
|
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
|
|
|
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
|
|
|
# modifications.
|
|
|
|
#
|
|
|
|
# CONFIG_ARCH_LEDS is not set
|
|
|
|
# CONFIG_NSH_ARGCAT is not set
|
|
|
|
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
2021-09-02 08:13:25 +02:00
|
|
|
CONFIG_ALLOW_BSD_COMPONENTS=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_ARCH="xtensa"
|
|
|
|
CONFIG_ARCH_BOARD="esp32-devkitc"
|
2022-03-10 19:18:20 +01:00
|
|
|
CONFIG_ARCH_BOARD_COMMON=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_ARCH_BOARD_ESP32_DEVKITC=y
|
|
|
|
CONFIG_ARCH_CHIP="esp32"
|
|
|
|
CONFIG_ARCH_CHIP_ESP32=y
|
|
|
|
CONFIG_ARCH_CHIP_ESP32WROVER=y
|
|
|
|
CONFIG_ARCH_INTERRUPTSTACK=2048
|
libc/machine/xtensa: make longjmp safe against context switch
In order to turn longjmp context-switch safe, it's necessary
to disable interrupts before modifying windowbase and windowstart.
Otherwise, after a context switch, windowstart and windowbase
would be different, leading to a wrongly set windowstart bit due to
longjmp writing it based on the windowbase before the context switch.
This corrupts the registers at the next window overflow reaching
that wrongly set bit.
*Background:*
This PR is related to an issue first observed on ESP-IDF
https://github.com/espressif/esp-idf/issues/5229 and it was, then,
checked on NuttX using a test application.
*The test application:*
To check if the problem affects ESP32, ESP32-S2 and ESP32-S3 on
NuttX, it was created an application based on:
https://en.cppreference.com/w/c/program/longjmp
The application creates 16 tasks (`#define NUMBER_OF_TASKS 16`)
that implements the following daemon:
```
static int setjmp_longjmp_daemon(int argc, char *argv[])
{
for (int i = 0; i < NUMBER_OF_TASKS * 2; i++)
{
jmp_buf env;
volatile int count = 0;
if (setjmp(env) != UINT16_MAX)
{
foo(&env, ++count);
}
}
sem_post(&g_sem);
return EXIT_SUCCESS;
}
```
The main function also initializes a semaphore to avoid application
exiting before tasks return successfully:
```
sem_init(&g_sem, 0, -NUMBER_OF_TASKS);
```
Finally, the round-robin interval was lowered to 1ms to raise the
chances of the longjmp being interrupted by a context switch
(`CONFIG_RR_INTERVAL=1).
This setup was able to reproduce the problem prior to this patch
being applied.
2022-11-21 19:04:32 +01:00
|
|
|
CONFIG_ARCH_SETJMP_H=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_ARCH_STACKDUMP=y
|
|
|
|
CONFIG_ARCH_XTENSA=y
|
|
|
|
CONFIG_BOARD_LOOPSPERMSEC=16717
|
|
|
|
CONFIG_BUILTIN=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_CODECS_HASH_MD5=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_DEBUG_ASSERTIONS=y
|
|
|
|
CONFIG_DEBUG_FEATURES=y
|
|
|
|
CONFIG_DEBUG_FULLOPT=y
|
|
|
|
CONFIG_DEBUG_SYMBOLS=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_DEV_URANDOM=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_DRIVERS_IEEE80211=y
|
|
|
|
CONFIG_DRIVERS_WIRELESS=y
|
|
|
|
CONFIG_ESP32_SPIFLASH=y
|
2021-10-22 17:03:16 +02:00
|
|
|
CONFIG_ESP32_SPIFLASH_SPIFFS=y
|
2021-10-24 11:43:51 +02:00
|
|
|
CONFIG_ESP32_STORAGE_MTD_SIZE=0x80000
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_ESP32_UART0=y
|
2022-06-09 10:30:24 +02:00
|
|
|
CONFIG_ESP32_WIFI=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_EXAMPLES_HELLO=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_EXAMPLES_WEBSERVER=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_FS_PROCFS=y
|
|
|
|
CONFIG_HAVE_CXX=y
|
|
|
|
CONFIG_HAVE_CXXINITIALIZE=y
|
|
|
|
CONFIG_IDLETHREAD_STACKSIZE=2048
|
2021-12-23 04:56:43 +01:00
|
|
|
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
|
|
|
CONFIG_INIT_STACKSIZE=3072
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_INTELHEX_BINARY=y
|
|
|
|
CONFIG_IOB_NBUFFERS=128
|
2021-03-10 15:34:44 +01:00
|
|
|
CONFIG_MM_REGIONS=4
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NAME_MAX=48
|
|
|
|
CONFIG_NETDB_DNSCLIENT=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NETDB_DNSCLIENT_NAMESIZE=64
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NETDEV_LATEINIT=y
|
|
|
|
CONFIG_NETDEV_PHY_IOCTL=y
|
|
|
|
CONFIG_NETDEV_WIRELESS_IOCTL=y
|
2023-05-05 21:23:34 +02:00
|
|
|
CONFIG_NETUTILS_CJSON=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NETUTILS_CODECS=y
|
|
|
|
CONFIG_NETUTILS_HTTPD_DIRLIST=y
|
|
|
|
CONFIG_NETUTILS_HTTPD_SENDFILE=y
|
2021-04-21 17:07:22 +02:00
|
|
|
CONFIG_NETUTILS_IPERF=y
|
2022-06-15 14:22:22 +02:00
|
|
|
CONFIG_NETUTILS_NTPCLIENT_STACKSIZE=4096
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NETUTILS_TELNETD=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NETUTILS_WEBCLIENT=y
|
|
|
|
CONFIG_NETUTILS_WEBSERVER=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NET_BROADCAST=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NET_ETH_PKTSIZE=1518
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NET_ICMP=y
|
|
|
|
CONFIG_NET_ICMP_SOCKET=y
|
|
|
|
CONFIG_NET_STATISTICS=y
|
|
|
|
CONFIG_NET_TCP=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NET_TCP_WRITE_BUFFERS=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NET_UDP=y
|
2021-09-02 08:08:05 +02:00
|
|
|
CONFIG_NFS=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NSH_ARCHINIT=y
|
|
|
|
CONFIG_NSH_BUILTIN_APPS=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NSH_CODECS_BUFSIZE=2048
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NSH_FILEIOSIZE=512
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NSH_LINELEN=300
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_NSH_READLINE=y
|
2021-07-13 07:20:45 +02:00
|
|
|
CONFIG_NSH_WGET_BUFF_SIZE=2048
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_PREALLOC_TIMERS=4
|
|
|
|
CONFIG_PTHREAD_MUTEX_TYPES=y
|
|
|
|
CONFIG_RAM_SIZE=114688
|
|
|
|
CONFIG_RAM_START=0x20000000
|
|
|
|
CONFIG_READLINE_CMD_HISTORY=y
|
|
|
|
CONFIG_RR_INTERVAL=200
|
2021-07-30 04:14:17 +02:00
|
|
|
CONFIG_RTC=y
|
|
|
|
CONFIG_RTC_ALARM=y
|
|
|
|
CONFIG_RTC_DRIVER=y
|
|
|
|
CONFIG_RTC_NALARMS=2
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_SCHED_LPWORK=y
|
|
|
|
CONFIG_SIG_DEFAULT=y
|
|
|
|
CONFIG_SMP=y
|
|
|
|
CONFIG_SMP_NCPUS=2
|
|
|
|
CONFIG_SPI=y
|
2021-09-02 08:13:41 +02:00
|
|
|
CONFIG_SPIFFS_NAME_MAX=48
|
2021-02-19 00:37:11 +01:00
|
|
|
CONFIG_STACK_COLORATION=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_START_DAY=18
|
|
|
|
CONFIG_START_MONTH=2
|
|
|
|
CONFIG_START_YEAR=2021
|
|
|
|
CONFIG_SYSLOG_TIMESTAMP=y
|
|
|
|
CONFIG_SYSTEM_DHCPC_RENEW=y
|
|
|
|
CONFIG_SYSTEM_NSH=y
|
2021-07-30 04:14:17 +02:00
|
|
|
CONFIG_SYSTEM_NTPC=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_SYSTEM_PING=y
|
|
|
|
CONFIG_SYSTEM_SYSTEM=y
|
|
|
|
CONFIG_SYSTEM_TASKSET=y
|
|
|
|
CONFIG_TESTING_GETPRIME=y
|
|
|
|
CONFIG_TESTING_OSTEST=y
|
|
|
|
CONFIG_TESTING_SMP=y
|
2022-05-24 17:43:38 +02:00
|
|
|
CONFIG_TLS_TASK_NELEM=4
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_UART0_SERIAL_CONSOLE=y
|
|
|
|
CONFIG_WIRELESS=y
|
|
|
|
CONFIG_WIRELESS_WAPI=y
|
|
|
|
CONFIG_WIRELESS_WAPI_CMDTOOL=y
|
2023-05-05 21:23:34 +02:00
|
|
|
CONFIG_WIRELESS_WAPI_INITCONF=y
|
2021-02-18 02:01:39 +01:00
|
|
|
CONFIG_WIRELESS_WAPI_STACKSIZE=4096
|