Date   

Re: [RFC] SMP support for RISC-V privilege architecture

Katsuhiro Suzuki
 

Hello Andrew, Kumar,

Thank you for pointing about regression tests.


On 2020/10/07 9:34, Boie, Andrew P wrote:
(*)QEMU RV32 virt pc:
https://github.com/zephyrproject-rtos/zephyr/pull/28749
That PR looks fine. But you definitely will have some work to do to get SMP working on Risc-V, starting with changing the arch to select CONFIG_SWITCH, and then implement arch_start_cpu(), arch_curr_cpu(), etc.
Yes, right.
For sanitycheck, I added another patch to change configs of qemu_rv32_virt
board. It selected CONFIG_USE_SWITCH and related context switch configs.
And set "y" to CONFIG_SMP in board_defconfig.

These SMP patch and additional configs patch are here:
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp_v2

And I created these patches can be added on PR's patch (not conflict):
https://github.com/zephyrproject-rtos/zephyr/pull/28749


But I don't understand Zephyr's SMP mechanism perfectly and don't know
required conditions (Ex. regression tests) if I want to change these area.
There are an assortment of tests with 'smp' in their tags, defined by testcase.yaml.
So you can do:
sanitycheck -p <your target name> -t smp
To quickly run these.
I have tested "sanitycheck -p qemu_rv32_virt -t smp" and fixed some bugs.
Finally, my implementation passed all 3 SMP test sets.

I'll prepare pull request for these patches. Thank you very much!


HTH
Andrew
Best Regards,
Katsuhiro Suzuki


-----Original Message-----
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> On
Behalf Of Katsuhiro Suzuki
Sent: Tuesday, October 6, 2020 1:54 AM
To: zephyr-devel <zephyr-devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] [RFC] SMP support for RISC-V privilege architecture

Hello All,

I'm working on SMP support for RISC-V privilege architecture.
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp

It seems worked well on QEMU RV32 virt pc (*) porting.
(RV64 not tested yet)

But I don't understand Zephyr's SMP mechanism perfectly and don't know
required conditions (Ex. regression tests) if I want to change these area.

I'm welcome comments or review of my patch.



Command line:
qemu-system-riscv32 -nographic -machine virt -net none \
-chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel zephyr/zephyr.elf \
-cpu rv32 -smp cpus=4 -bios none

Best Regards,
Katsuhiro Suzuki



Zephyr Project: Dev Meeting - Thu, 10/08/2020 3:00pm-4:00pm, Please RSVP #cal-reminder

devel@lists.zephyrproject.org Calendar <devel@...>
 

Reminder: Zephyr Project: Dev Meeting

When: Thursday, 8 October 2020, 3:00pm to 4:00pm, (GMT+00:00) UTC

Where:Microsoft Teams Meeting

An RSVP is requested. Click here to RSVP

Organizer: devel@...

Description:

________________________________________________________________________________
+1 321-558-6518 United States, Orlando (Toll)
Conference ID: 483 314 739#
Local numbers | Reset PIN | Learn more about Teams | Meeting options
 
 
________________________________________________________________________________


Zephyr Toolchain Working Group - New Meeting Time proposed

Rasmussen, Torsten
 

Hi,

 

We would like to include Zephyr toolchain into the Toolchain WG Meetings.

Unfortunately that is not possible at current timeslot.

It has therefore be suggested to move the meeting time to Mondays.

 

A doodle poll has been created to allow participant to give feedback on the new proposed timeslot.

https://doodle.com/poll/fiv8xtiikzktsv2m

 

Best regards

 

Torsten T. Rasmussen

 


Dev-Review Meeting Agenda Oct 8

Kumar Gala
 

Here’s the agenda topics for this week:

I’ve asked Marti to run the meeting as I can’t.

* drivers: watchdog: Implement software watchdog suitable for multiple threads [RFC]:
- https://github.com/zephyrproject-rtos/zephyr/pull/28947

* fs: Auto-mount of file systems defined via fixed-partitions of DTS
- https://github.com/zephyrproject-rtos/zephyr/pull/28320

* dt: start exposing dependency ordinals
- https://github.com/zephyrproject-rtos/zephyr/pull/26062

* Any PR/issues w/dev-review tag

https://github.com/zephyrproject-rtos/zephyr/labels/dev-review

* Any topics anyone else has.

- k


Cancelled Event: Zephyr: Toolchain Working Group - Thursday, 8 October 2020 #cal-cancelled

devel@lists.zephyrproject.org Calendar <noreply@...>
 

Cancelled: Zephyr: Toolchain Working Group

This event has been cancelled.

When:
Thursday, 8 October 2020
2:00pm to 3:00pm
(UTC+00:00) UTC

Where:
Microsoft Teams Meeting

Organizer: Maureen Helm

Description:

________________________________________________________________________________
+1 321-558-6518 United States, Orlando (Toll)
Conference ID: 682 738 030#
Local numbers | Reset PIN | Learn more about Teams | Meeting options
 
 
________________________________________________________________________________


Event: Zephyr: Networking Forum #cal-invite

devel@lists.zephyrproject.org Calendar <noreply@...>
 

Zephyr: Networking Forum

When:
Tuesday, 3 November 2020
3:00pm to 4:00pm
(UTC+00:00) UTC
Repeats: Monthly on the first Tuesday

Where:
Microsoft Teams Meeting

Organizer: tsc@...

An RSVP is requested. Click here to RSVP

Description:


________________________________________________________________________________
+1 321-558-6518 United States, Orlando (Toll)
Conference ID: 458 216 365#
Local numbers | Reset PIN | Learn more about Teams | Meeting options
 
 
________________________________________________________________________________


How to parse and read JSON file correctly?

adnan <sabovic1995@...>
 

Hi guys,

I am using the nRF52832 board and I want to parse and read my JSON file. I don't have too much experience working with cJSON and here you will find my simple code where I try to understand how to define things properly. I will appreciate a lot if you can help me with some advice or better if you can suggest me where I made errors.

Best regards,

Adnan.


Re: [RFC] SMP support for RISC-V privilege architecture

Boie, Andrew P
 

(*)QEMU RV32 virt pc:
https://github.com/zephyrproject-rtos/zephyr/pull/28749
That PR looks fine. But you definitely will have some work to do to get SMP working on Risc-V, starting with changing the arch to select CONFIG_SWITCH, and then implement arch_start_cpu(), arch_curr_cpu(), etc.

But I don't understand Zephyr's SMP mechanism perfectly and don't know
required conditions (Ex. regression tests) if I want to change these area.
There are an assortment of tests with 'smp' in their tags, defined by testcase.yaml.

So you can do:

sanitycheck -p <your target name> -t smp

To quickly run these.

HTH
Andrew

-----Original Message-----
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> On
Behalf Of Katsuhiro Suzuki
Sent: Tuesday, October 6, 2020 1:54 AM
To: zephyr-devel <zephyr-devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] [RFC] SMP support for RISC-V privilege architecture

Hello All,

I'm working on SMP support for RISC-V privilege architecture.
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp

It seems worked well on QEMU RV32 virt pc (*) porting.
(RV64 not tested yet)

But I don't understand Zephyr's SMP mechanism perfectly and don't know
required conditions (Ex. regression tests) if I want to change these area.

I'm welcome comments or review of my patch.



Command line:
qemu-system-riscv32 -nographic -machine virt -net none \
-chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel zephyr/zephyr.elf \
-cpu rv32 -smp cpus=4 -bios none

Best Regards,
Katsuhiro Suzuki




Re: [RFC] SMP support for RISC-V privilege architecture

Katsuhiro Suzuki
 

Hello Kumar,

Sorry for multi posting. Zephyr ML has very long delay to deliver my mail...??

Anyway, thanks a lot for your comment.

On 2020/10/06 23:57, Kumar Gala wrote:

On Oct 6, 2020, at 4:04 AM, Katsuhiro Suzuki <katsuhiro@katsuster.net> wrote:

Hello All,

I'm working on SMP support for RISC-V privilege architecture.
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp

It seems worked well on QEMU RV32 virt pc (*) porting.
(RV64 not tested yet)

But I don't understand Zephyr's SMP mechanism perfectly and
don't know required conditions (Ex. regression tests) if I
want to change these area.

I'm welcome comments or review of my patch.

(*)QEMU RV32 virt pc:
https://github.com/zephyrproject-rtos/zephyr/pull/28749

Diffs of config from default:
CONFIG_RISCV_USE_SWITCH=y (added by me)
CONFIG_SMP=y
CONFIG_MP_NUM_CPUS=4

Command line:
qemu-system-riscv32 -nographic -machine virt -net none \
-chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel zephyr/zephyr.elf \
-cpu rv32 -smp cpus=4 -bios none

Best Regards,
Katsuhiro Suzuki
Would probably be good to add a second SMP config for qemu_riscv32 for SMP=y. You can look at the boards/x86/qemu_x86 to see examples of having different configs.
I'll add the config.

BTW, QEMU can choose SMP mode or non-SMP mode by command option.
qemu_x86 Zephyr users never want to use non-SMP mode?

I remember a help of CONFIG_USE_SWTCH said that:
"In uniprocess situations where the
architecture provides both, _arch_switch incurs more somewhat
overhead and may be slower.".

I think RISC-V may cover high-end from low-end, so I try to keep
old style context switch mechanism. On the other hand, it seems
x86_64 port don't implement old style.
Should we keep old one or it depends on each architectures?


As for testing, I’m guessing the main test to make sure runs and passes is tests/kernel/smp.
Andrew, can probably mention other tests or aspects to be aware of.
Thanks! I'll try it and report results.


- k
Best Regards,
Katsuhiro Suzuki


Zephyr Project: APIs - Tue, 10/06/2020 4:00pm-5:00pm, Please RSVP #cal-reminder

devel@lists.zephyrproject.org Calendar <devel@...>
 

Reminder: Zephyr Project: APIs

When: Tuesday, 6 October 2020, 4:00pm to 5:00pm, (GMT+00:00) UTC

Where:Microsoft Teams Meeting

An RSVP is requested. Click here to RSVP

Organizer: devel@...

Description:

Meeting decisions/discussions in their respective PRs, tracked here: https://github.com/zephyrproject-rtos/zephyr/projects/18


________________________________________________________________________________
+1 321-558-6518 United States, Orlando (Toll)
Conference ID: 317 990 129#
Local numbers | Reset PIN | Learn more about Teams | Meeting options
 
 
________________________________________________________________________________


Re: API meeting: agenda

Carles Cufi
 

Hi all,

An additional item for today:

- Cleanup of work queue API doc
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/28824

-----Original Message-----
From: Cufi, Carles
Sent: 06 October 2020 15:39
To: devel@lists.zephyrproject.org; users@lists.zephyrproject.org
Subject: API meeting: agenda

Hi all,

Agenda for today, sorry for the short notice.

- Pinmux and pinctrl API: Decide what the priorities for this are, and how
to get to LTS with it
- Issue: https://github.com/zephyrproject-rtos/zephyr/issues/22748

Since there are no other new items in the Triage column, I would propose
we go through the To Do and In Progress items and make sure they are still
applicable and they have a person assigned who is actively working on
them.

Teams link: https://teams.microsoft.com/l/meetup-
join/19%3ameeting_NWU2MjZlYWEtZDcwMi00MWQzLTgwMjEtNDdkYjQwMjBjMmFj%40threa
d.v2/0?context=%7b%22Tid%22%3a%22af0096d9-700c-411a-b795-
b3dd7122bad2%22%2c%22Oid%22%3a%22841a7c92-7816-4faf-9887-
5e334e88f6d8%22%7d

https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-
Working-Group-Meetings#zephyr-api-discussion
https://github.com/zephyrproject-rtos/zephyr/projects/18
https://docs.google.com/document/d/1lv-
8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit

Regards,

Carles


Re: [RFC] SMP support for RISC-V privilege architecture

Kumar Gala
 

On Oct 6, 2020, at 4:04 AM, Katsuhiro Suzuki <katsuhiro@katsuster.net> wrote:

Hello All,

I'm working on SMP support for RISC-V privilege architecture.
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp

It seems worked well on QEMU RV32 virt pc (*) porting.
(RV64 not tested yet)

But I don't understand Zephyr's SMP mechanism perfectly and
don't know required conditions (Ex. regression tests) if I
want to change these area.

I'm welcome comments or review of my patch.

(*)QEMU RV32 virt pc:
https://github.com/zephyrproject-rtos/zephyr/pull/28749

Diffs of config from default:
CONFIG_RISCV_USE_SWITCH=y (added by me)
CONFIG_SMP=y
CONFIG_MP_NUM_CPUS=4

Command line:
qemu-system-riscv32 -nographic -machine virt -net none \
-chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel zephyr/zephyr.elf \
-cpu rv32 -smp cpus=4 -bios none

Best Regards,
Katsuhiro Suzuki
Would probably be good to add a second SMP config for qemu_riscv32 for SMP=y. You can look at the boards/x86/qemu_x86 to see examples of having different configs.

As for testing, I’m guessing the main test to make sure runs and passes is tests/kernel/smp.

Andrew, can probably mention other tests or aspects to be aware of.

- k


API meeting: agenda

Carles Cufi
 

Hi all,

Agenda for today, sorry for the short notice.

- Pinmux and pinctrl API: Decide what the priorities for this are, and how to get to LTS with it
- Issue: https://github.com/zephyrproject-rtos/zephyr/issues/22748

Since there are no other new items in the Triage column, I would propose we go through the To Do and In Progress items and make sure they are still applicable and they have a person assigned who is actively working on them.

Teams link: https://teams.microsoft.com/l/meetup-join/19%3ameeting_NWU2MjZlYWEtZDcwMi00MWQzLTgwMjEtNDdkYjQwMjBjMmFj%40thread.v2/0?context=%7b%22Tid%22%3a%22af0096d9-700c-411a-b795-b3dd7122bad2%22%2c%22Oid%22%3a%22841a7c92-7816-4faf-9887-5e334e88f6d8%22%7d

https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion
https://github.com/zephyrproject-rtos/zephyr/projects/18
https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit

Regards,

Carles


[RFC] SMP support for RISC-V privilege architecture

Katsuhiro Suzuki
 

Hello All,

I'm working on SMP support for RISC-V privilege architecture.
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp

It seems worked well on QEMU RV32 virt pc (*) porting.
(RV64 not tested yet)

But I don't understand Zephyr's SMP mechanism perfectly and
don't know required conditions (Ex. regression tests) if I
want to change these area.

I'm welcome comments or review of my patch.

(*)QEMU RV32 virt pc:
https://github.com/zephyrproject-rtos/zephyr/pull/28749

Diffs of config from default:
CONFIG_RISCV_USE_SWITCH=y (added by me)
CONFIG_SMP=y
CONFIG_MP_NUM_CPUS=4

Command line:
qemu-system-riscv32 -nographic -machine virt -net none \
-chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel zephyr/zephyr.elf \
-cpu rv32 -smp cpus=4 -bios none

Best Regards,
Katsuhiro Suzuki


[RFC] SMP support for RISC-V privilege architecture

Katsuhiro Suzuki
 

Hello All,

I'm working on SMP support for RISC-V privilege architecture.
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp

It seems worked well on QEMU RV32 virt pc (*) porting.
(RV64 not tested yet)

But I don't understand Zephyr's SMP mechanism perfectly and
don't know required conditions (Ex. regression tests) if I
want to change these area.

I'm welcome comments or review of my patch.

(*)QEMU RV32 virt pc:
https://github.com/zephyrproject-rtos/zephyr/pull/28749

Diffs of config from default:
CONFIG_RISCV_USE_SWITCH=y (added by me)
CONFIG_SMP=y
CONFIG_MP_NUM_CPUS=4

Command line:
qemu-system-riscv32 -nographic -machine virt -net none \
-chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel zephyr/zephyr.elf \
-cpu rv32 -smp cpus=4 -bios none

Best Regards,
Katsuhiro Suzuki


[RFC] SMP support for RISC-V privilege architecture

Katsuhiro Suzuki
 

Hello All,

I'm working on SMP support for RISC-V privilege architecture.
https://github.com/katsuster/zephyr/tree/riscv_virt_pc_smp

It seems worked well on QEMU RV32 virt pc (*) porting.
(RV64 not tested yet)

But I don't understand Zephyr's SMP mechanism perfectly and
don't know required conditions (Ex. regression tests) if I
want to change these area.

I'm welcome comments or review of my patch.

(*)QEMU RV32 virt pc:
https://github.com/zephyrproject-rtos/zephyr/pull/28749

Diffs of config from default:
CONFIG_RISCV_USE_SWITCH=y (added by me)
CONFIG_SMP=y
CONFIG_MP_NUM_CPUS=4

Command line:
qemu-system-riscv32 -nographic -machine virt -net none \
-chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel zephyr/zephyr.elf \
-cpu rv32 -smp cpus=4 -bios none

Best Regards,
Katsuhiro Suzuki


Zephyr SDK 0.12.0-alpha-1 available for testing

Kumar Gala
 

Hi,

Latest version of the SDK can be found here:

https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.12.0-alpha-1

Please download and try things out and report any issues. Please report issues here:

https://github.com/zephyrproject-rtos/sdk-ng/issues

Known issues:

* some xtensa platforms may need updating w/regards to Zephyr & Xtensa HAL
[ https://github.com/zephyrproject-rtos/zephyr/pull/23142 ]

* known issue with arm64 and linking C++ & newlib:
[ https://github.com/zephyrproject-rtos/zephyr/issues/28650 ]

Changes since the last release:

• General:

• Updated to using buildkite for CI
• Updated yocto 3.1.1
• Build aarch64 (arm64) linux host toolchains.
• Moved to using a zephyr fork of crosstool-ng
• Update bossa to 1.9.1+
• cmake: Set HOST_TOOLS_HOME based on OS_PLATFORM
• QEMU:

• Updated to QEMU 5.1.0
• Added icount support for ARC
• OpenOCD:

• Updated to 20200928 snapshot
• newlib:

• Updated to version 3.3
• Updated xtensa to version 3.3 (in sync with all arch's)
• binutils:

• updated to version 2.35.1
• gcc:

• Updated to version 10.2.0
• gdb:

• Updated to version 9.2
• xtensa:

• remove HAL from SDK build


- k


Network forum agenda

Jukka Rissanen
 

Hi all,

There is a network forum meeting tomorrow Tuesday 6 Oct at 8AM PDT /
17.00 CET.

Agenda:

- TCP2 is now the default TCP implementation, legacy TCP implementation
is not yet removed. We can discuss possible issues and how to proceed.

https://github.com/zephyrproject-rtos/zephyr/issues/28587
https://github.com/zephyrproject-rtos/zephyr/pull/28832


- Modem power management support. Two alternative implementations
proposed for generic GSM modem, and one for offloaded modem.

https://github.com/zephyrproject-rtos/zephyr/pull/28475
https://github.com/zephyrproject-rtos/zephyr/pull/27731
https://github.com/zephyrproject-rtos/zephyr/pull/27927


If you have anything else you want to discuss, please let me know.

Link to the Teams meeting:

https://teams.microsoft.com/l/meetup-join/19%3ameeting_NDU5ODRkNzktZDBmNC00MDg5LWI2OWEtNzM0MGZjMDU0Yjgw%40thread.v2/0?context=%7b%22Tid%22%3a%22af0096d9-700c-411a-b795-b3dd7122bad2%22%2c%22Oid%22%3a%22841a7c92-7816-4faf-9887-5e334e88f6d8%22%7d


Cheers,
Jukka


Re: SMP support for ARM architecture

Boie, Andrew P
 

Hi Krzysztof,

 

I'm assuming that you're referring to ARM Cortex-A? A patch recently landed to implement switch instead of swap: https://github.com/zephyrproject-rtos/zephyr/pull/27766. There is a GitHub enhancement for ARM64 SMP support https://github.com/zephyrproject-rtos/zephyr/issues/26952 but nobody is working on it AFAIK.

 

CPU affinity is currently implemented via the k_thread_cpu_mask_* APIs in include/kernel.h. So if you get SMP working on your arch the scheduling infrastructure is there.

 

This is just the first step, to fully implement SMP you'll need per-cpu variables, IPIs, some extra arch_* APIs implemented, etc. We don't have a porting guide for SMP yet, and having not done this myself I'm not quite an expert in this area but I would reach out to Andy Ross for general SMP enabling questions, and for ARM64 stuff I would coordinate with  Carlo Caione who has done much of the work so far.

 

We have SMP working on x86_64, ARC, and Xtensa so reviewing that may also be helpful.

 

HTH

Andrew

 

From: devel@... <devel@...> On Behalf Of Krzysztof Walczak via lists.zephyrproject.org
Sent: Friday, October 2, 2020 5:09 AM
To: devel@...
Subject: [Zephyr-devel] SMP support for ARM architecture

 

Hi,

 

For our multicore ARM based project we would like to use SMP and affinity mechanism in Zephyr. When digging into the code I found that it is not implemented.

Mainly, there is an implementation of arch_switch() missing needed by SMP. Can someone give me any guideline as to what would be required for implementation to have an SMP/afinity mechanism operational in Zephyr on ARM platform.

 

rgds

Krzysztof


Re: RFC: API Change: k_work

Peter A. Bigot
 

This RFC has been withdrawn.  Instead the documentation of the existing API will be updated to describe its behavior more precisely, and ultimately deprecated in favor of a new API and recommended usage that eliminates the problems.  See this and subsequent comments.

381 - 400 of 7748