Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch/rv32i: Don't sort PMP regions when we configure the MPU #2021

Merged
merged 2 commits into from Jul 20, 2020

Conversation

alistair23
Copy link
Contributor

@alistair23 alistair23 commented Jul 13, 2020

Pull Request Overview

Previously we would sort the PMP regions everytime we configured the
MPU. This was wasteful in terms of instructions but also wasted stack
space, probably because we cloned the PMPConfig regions.

This patch changes the sorting to only happen after a change is made to
the regions. This should save the number of times we have to sort,
remove sorting out of the critical path and saves a lot of stack space.

See below for the stack changes:

### Release build ###
## Before this patch ##
80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17hb3b05a589563feedE
0     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17hd6078caa7928d4d8E
592     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h5967285bd6ec5881E

## After this patch ##
80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17hb3b05a589563feedE
16     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17hd6078caa7928d4d8E
80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h5967285bd6ec5881E

### Debug build ###
## Before this patch ##
80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17h272c094b5b64d63bE
96     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$26allocate_app_memory_region17h56b3decc4c649f8cE
32     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17h55a48db93ba6d713E
592     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h32d25c65ffe73910E

## After this patch ##
80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17h272c094b5b64d63bE
96     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$26allocate_app_memory_region17h56b3decc4c649f8cE
32     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17h55a48db93ba6d713E
80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h32d25c65ffe73910E

NOTE: All above numbers already include: #2020

I haven't compared instruction diffs, but I'm assuming we reduce the
number of instructions run on app swap as well.

Testing Strategy

Tested running apps on QEMU OpenTitan.

TODO or Help Wanted

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@bradjc
Copy link
Contributor

bradjc commented Jul 14, 2020

I did try this and this plus #2020, and the arty still seems to stack overflow (i.e. my app doesn't run).

@alistair23
Copy link
Contributor Author

Interesting, can you diff the stack outputs between these patches and the PMP array changes that get it to work?

hudson-ayers
hudson-ayers previously approved these changes Jul 15, 2020
@alphan alphan mentioned this pull request Jul 15, 2020
3 tasks
@bradjc bradjc added the risc-v RISC-V architecture label Jul 16, 2020
@bradjc
Copy link
Contributor

bradjc commented Jul 16, 2020

on master:

/Users/bradjc/.rustup/toolchains/nightly-2020-06-03-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/llvm-readobj --stack-sizes ../../target/riscv32imac-unknown-none-elf/release/arty_e21.elf | ./parse_stack_sizes.py
2272: reset_handler
720: rv32i::pmp::PMPConfigu20asu20kernel::platform::mpu::MPUconfigure_mpu
448: core5slice4sort7recurse
336: kernel::process::Processu20asu20kernel::process::ProcessTypeprint_full_process
288: kernel5debugpanic_cpu_state
256: kernel5sched6Kernelkernel_loop
240: kernel::process::Processu20asu20kernel::process::ProcessTypeprint_memory_map
224: capsules::console::Consoleu20asu20kernel::driver::Driverallow
208: capsules::console::Consoleu20asu20kernel::hil::uart::ReceiveClientreceived_buffer
160: capsules::console::Consoleu20asu20kernel::driver::Drivercommand
144: capsules::button::Buttonu20asu20kernel::hil::gpio::ClientWithValuefired
144: capsules7console7Console4send
144: capsules::console::Consoleu20asu20kernel::hil::uart::TransmitClienttransmitted_buffer
144: core3fmt3num52implu20core::fmt::Debugu20foru20usizefmt
144: core3fmt3num53implu20core::fmt::LowerHexu20foru20i32fmt
144: core3fmt3num53implu20core::fmt::UpperHexu20foru20i32fmt
128: kernel::process::Processu20asu20kernel::process::ProcessTypedequeue_task
128: capsules::alarm::AlarmDriveru20asu20kernel::driver::Drivercommand
128: capsules::alarm::AlarmDriveru20asu20kernel::hil::time::AlarmClientfired
128: mutu20u20asu20core::fmt::Displayfmt
112: kernel::process::Processu20asu20kernel::process::ProcessTypeget_writeable_flash_region
112: kernel::process::Processu20asu20kernel::process::ProcessTypenumber_writeable_flash_regions
112: capsules::gpio::GPIOu20asu20kernel::hil::gpio::ClientWithValuefired
112: core3strslice_error_fail
112: rv32i::pmp::PMPRegionu20asu20core::fmt::Displayfmt
96: kernel::process::Processu20asu20kernel::process::ProcessTyperemove_pending_callbacks
96: capsules::button::Buttonu20asu20kernel::driver::Drivercommand
96: core::option::Optionu20asu20core::fmt::Debugfmt
96: kernel5sched6Kerneldo_process28u7bu7bclosureu7du7dh0f65cc845d46f29E
96: core3fmt5write
96: core::fmt::builders::PadAdapteru20asu20core::fmt::Writewrite_str
96: core3fmt8buildersDebugStruct5field
96: rv32i::pmp::PMPConfigu20asu20kernel::platform::mpu::MPUallocate_region
80: kernel::process::Processu20asu20kernel::process::ProcessTypeset_fault_state
80: capsules::button::Buttonu20asu20kernel::driver::Driversubscribe
80: kernel5sched6Kerneldo_process28u7bu7bclosureu7du7dhf043e332349e89b4E
80: capsules::gpio::GPIOu20asu20kernel::driver::Driversubscribe
80: kernel5debugpanic_banner
80: capsules::alarm::AlarmDriveru20asu20kernel::driver::Driversubscribe
80: capsules5alarm20AlarmDriverreset_active_alarm
80: capsules::console::Consoleu20asu20kernel::driver::Driversubscribe
64: kernel::process::Processu20asu20kernel::process::ProcessTypeenqueue_task
64: capsules7console7Consolesend_continue
64: capsules::virtual_uart::MuxUartu20asu20kernel::hil::uart::ReceiveClientreceived_buffer
64: core9panickingpanic_bounds_check
64: core3fmt3num3imp7fmt_u32
64: core3fmt9Formatterpad_integral
64: core5slice20slice_index_len_fail
64: core5slice22slice_index_order_fail
64: kernel8callback8Callback8schedule
64: kernel::process::ProcessLoadErroru20asu20core::fmt::Debugfmt
48: kernel::process::Processu20asu20kernel::process::ProcessTypebrk
48: kernel5sched6Kerneldo_process28u7bu7bclosureu7du7dhbce9c8790f73a2E
48: kernel5debugpanic_process_info
48: core3fmt5Write9write_fmt
48: mutu20u20asu20core::fmt::Writewrite_fmt
48: core9panicking5panic
48: charu20asu20core::fmt::Debugfmt
48: core::ops::range::Rangedxu20asu20core::fmt::Debugfmt
48: core6optionexpect_failed
48: kernel5debugbegin_debug_fmt
48: core5slice4sortshift_tail
48: core5slice29implu20u5bu5dswap
32: kernel::process::Processu20asu20kernel::process::ProcessTypeadd_mpu_region
32: kernel::process::Processu20asu20kernel::process::ProcessTypesetup_mpu
32: capsules::virtual_alarm::MuxAlarmu20asu20kernel::hil::time::AlarmClientfired
32: u20asu20core::fmt::Debugfmt
32: kernel::grant::Ownedu20asu20core::ops::drop::Dropdrop
32: kernel5grant9Allocatoralloc_unowned
32: kernel5debugpanic_blink_forever
32: kernel5debug7IoWritewrite_ring_buffer
32: rust_begin_unwind
32: capsulesvirtual_uart7MuxUartdo_next_op
32: capsulesvirtual_uart7MuxUartstart_receive
32: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Receivereceive_buffer
32: core9panicking9panic_fmt
32: core3fmt9Formatterpad_integralwrite_prefix
32: core3fmt9Formatter3pad
32: core3fmt9Formatter9write_fmt
32: core5slice29implu20u5bu5dsplit_at
32: kernel::mem::AppPtru20asu20core::ops::drop::Dropdrop
32: kernel3mem2ppSlicelen
32: kernel::process::Stateu20asu20core::fmt::Debugfmt
32: constu20u20asu20core::fmt::Pointerfmt
32: kernel::debug::DebugWriterWrapperu20asu20kernel::debug::IoWritewrite
32: kernel5debugDebugWriterpublish_bytes
32: core5slice4sortchoose_pivot28u7bu7bclosureu7du7dhef46ca3063009e79E
32: core5slice4sortchoose_pivot28u7bu7bclosureu7du7dh4c4d2ea94fcd9cE
32: core5slice4sort8heapsort28u7bu7bclosureu7du7dh7073d8d7e89dE
32: rv32i4clic4Clicnext_pending
16: core3ptrdrop_in_place
16: kernel7processProcessterminate
16: kernel::process::Processu20asu20kernel::process::ProcessTypedebug_syscall_called
16: kernel::process::Processu20asu20kernel::process::ProcessTypeset_process_function
16: kernel::process::Processu20asu20kernel::process::ProcessTypeflash_non_protected_start
16: kernel::process::Processu20asu20kernel::process::ProcessTypesbrk
16: kernel::process::Processu20asu20kernel::process::ProcessTypealloc
16: kernel::process::Processu20asu20kernel::process::ProcessTypeswitch_to
16: kernel6driver6Driver5allow
16: capsules6buttonButtonget_button_state
16: kernel::hil::gpio::InterruptValueWrapperu20asu20kernel::hil::gpio::Clientfired
16: kernel3hil4gpio6Outputwrite_activation
16: capsules::gpio::GPIOu20asu20kernel::driver::Drivercommand
16: kernel5debug5panic
16: kernel5debug5flush
16: core3fmt5Writewrite_char
16: mutu20u20asu20core::fmt::Writewrite_str
16: mutu20u20asu20core::fmt::Writewrite_char
16: capsules::led::LEDu20asu20kernel::driver::Drivercommand
16: arty_e2chip::chip::ArtyExxu20asu20kernel::platform::Chiphas_pending_interrupts
16: capsules::virtual_uart::MuxUartu20asu20kernel::hil::uart::TransmitClienttransmitted_buffer
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::ReceiveClientreceived_buffer
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Transmittransmit_buffer
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Transmittransmit_word
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Receivereceive_abort
16: core3ops8function6FnOnce9call_once
16: core3fmt3num3imp52implu20core::fmt::Displayu20foru20u32fmt
16: u20asu20core::any::Anytype_id
16: core7unicode9printable5check
16: core5slice6memchr6memchr
16: core3fmt8buildersDebugStruct6finish
16: core3fmt8buildersDebugTuple6finish
16: boolu20asu20core::fmt::Displayfmt
16: kernel::debug::DebugWriteru20asu20kernel::hil::uart::TransmitClienttransmitted_buffer
16: kernel::debug::DebugWriterWrapperu20asu20core::fmt::Writewrite_str
16: core5slice4sortchoose_pivot28u7bu7bclosureu7du7dh7aff52524d5E
16: riscv_csr3csr32ReadWriteRiscvCsru32modify
16: sifive4gpio7GpioPinhandle_interrupt
16: sifive::gpio::GpioPinu20asu20kernel::hil::gpio::Configuredeactivate_to_low_power

with #2020 and #2021

/Users/bradjc/.rustup/toolchains/nightly-2020-06-03-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/bin/llvm-readobj --stack-sizes ../../target/riscv32imac-unknown-none-elf/release/arty_e21.elf | ./parse_stack_sizes.py
1888: reset_handler
416: core5slice4sort7recurse
336: kernel::process::Processu20asu20kernel::process::ProcessTypeprint_full_process
288: kernel5debugpanic_cpu_state
256: kernel5sched6Kernelkernel_loop
240: kernel::process::Processu20asu20kernel::process::ProcessTypeprint_memory_map
224: capsules::console::Consoleu20asu20kernel::driver::Driverallow
208: capsules::console::Consoleu20asu20kernel::hil::uart::ReceiveClientreceived_buffer
160: capsules::console::Consoleu20asu20kernel::driver::Drivercommand
144: capsules::button::Buttonu20asu20kernel::hil::gpio::ClientWithValuefired
144: capsules7console7Console4send
144: capsules::console::Consoleu20asu20kernel::hil::uart::TransmitClienttransmitted_buffer
144: core3fmt3num52implu20core::fmt::Debugu20foru20usizefmt
144: core3fmt3num53implu20core::fmt::LowerHexu20foru20i32fmt
144: core3fmt3num52implu20core::fmt::UpperHexu20foru20i8fmt
144: core3fmt3num53implu20core::fmt::UpperHexu20foru20i32fmt
128: kernel::process::Processu20asu20kernel::process::ProcessTypedequeue_task
128: capsules::alarm::AlarmDriveru20asu20kernel::driver::Drivercommand
128: capsules::alarm::AlarmDriveru20asu20kernel::hil::time::AlarmClientfired
128: mutu20u20asu20core::fmt::Displayfmt
112: kernel::process::Processu20asu20kernel::process::ProcessTypeget_writeable_flash_region
112: kernel::process::Processu20asu20kernel::process::ProcessTypenumber_writeable_flash_regions
112: capsules::gpio::GPIOu20asu20kernel::hil::gpio::ClientWithValuefired
112: core3strslice_error_fail
112: rv32i::pmp::PMPRegionu20asu20core::fmt::Displayfmt
96: kernel::process::Processu20asu20kernel::process::ProcessTyperemove_pending_callbacks
96: capsules::button::Buttonu20asu20kernel::driver::Drivercommand
96: core::option::Optionu20asu20core::fmt::Debugfmt
96: kernel5sched6Kerneldo_process28u7bu7bclosureu7du7dh0f65cc845d46f29E
96: core3fmt5write
96: core::fmt::builders::PadAdapteru20asu20core::fmt::Writewrite_str
96: core3fmt8buildersDebugStruct5field
80: kernel::process::Processu20asu20kernel::process::ProcessTypeset_fault_state
80: capsules::button::Buttonu20asu20kernel::driver::Driversubscribe
80: kernel5sched6Kerneldo_process28u7bu7bclosureu7du7dhf043e332349e89b4E
80: capsules::gpio::GPIOu20asu20kernel::driver::Driversubscribe
80: kernel5debugpanic_banner
80: capsules::alarm::AlarmDriveru20asu20kernel::driver::Driversubscribe
80: capsules5alarm20AlarmDriverreset_active_alarm
80: capsules::console::Consoleu20asu20kernel::driver::Driversubscribe
80: rv32i::pmp::PMPConfigu20asu20kernel::platform::mpu::MPUallocate_region
80: rv32i::pmp::PMPConfigu20asu20kernel::platform::mpu::MPUconfigure_mpu
64: kernel::process::Processu20asu20kernel::process::ProcessTypeenqueue_task
64: capsules7console7Consolesend_continue
64: capsules::virtual_uart::MuxUartu20asu20kernel::hil::uart::ReceiveClientreceived_buffer
64: core9panickingpanic_bounds_check
64: core3fmt3num3imp7fmt_u32
64: core3fmt9Formatterpad_integral
64: core5slice20slice_index_len_fail
64: core5slice22slice_index_order_fail
64: kernel8callback8Callback8schedule
64: kernel::process::ProcessLoadErroru20asu20core::fmt::Debugfmt
48: kernel::process::Processu20asu20kernel::process::ProcessTypebrk
48: kernel5sched6Kerneldo_process28u7bu7bclosureu7du7dhbce9c8790f73a2E
48: kernel5debugpanic_process_info
48: core3fmt5Write9write_fmt
48: mutu20u20asu20core::fmt::Writewrite_fmt
48: core9panicking5panic
48: charu20asu20core::fmt::Debugfmt
48: core::ops::range::Rangedxu20asu20core::fmt::Debugfmt
48: core6optionexpect_failed
48: kernel5debugbegin_debug_fmt
32: kernel::process::Processu20asu20kernel::process::ProcessTypeadd_mpu_region
32: kernel::process::Processu20asu20kernel::process::ProcessTypesetup_mpu
32: capsules::virtual_alarm::MuxAlarmu20asu20kernel::hil::time::AlarmClientfired
32: u20asu20core::fmt::Debugfmt
32: kernel::grant::Ownedu20asu20core::ops::drop::Dropdrop
32: kernel5grant9Allocatoralloc_unowned
32: kernel5debugpanic_blink_forever
32: kernel5debug7IoWritewrite_ring_buffer
32: rust_begin_unwind
32: capsulesvirtual_uart7MuxUartdo_next_op
32: capsulesvirtual_uart7MuxUartstart_receive
32: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Receivereceive_buffer
32: core9panicking9panic_fmt
32: core3fmt9Formatterpad_integralwrite_prefix
32: core3fmt9Formatter3pad
32: core3fmt9Formatter9write_fmt
32: core5slice29implu20u5bu5dsplit_at
32: kernel::mem::AppPtru20asu20core::ops::drop::Dropdrop
32: kernel3mem2ppSlicelen
32: kernel::process::Stateu20asu20core::fmt::Debugfmt
32: constu20u20asu20core::fmt::Pointerfmt
32: kernel::debug::DebugWriterWrapperu20asu20kernel::debug::IoWritewrite
32: kernel5debugDebugWriterpublish_bytes
32: core5slice4sortshift_tail
32: core5slice4sortchoose_pivot28u7bu7bclosureu7du7dh8a42af9fd3ab4d73E
32: core5slice4sortchoose_pivot28u7bu7bclosureu7du7dhd55ae3b0eab6c6E
32: core5slice4sort8heapsort28u7bu7bclosureu7du7dh3dda3ab2ef4d0652E
32: rv32i4clic4Clicnext_pending
16: core3ptrdrop_in_place
16: kernel7processProcessterminate
16: kernel::process::Processu20asu20kernel::process::ProcessTypedebug_syscall_called
16: kernel::process::Processu20asu20kernel::process::ProcessTypeset_process_function
16: kernel::process::Processu20asu20kernel::process::ProcessTypeflash_non_protected_start
16: kernel::process::Processu20asu20kernel::process::ProcessTypesbrk
16: kernel::process::Processu20asu20kernel::process::ProcessTypealloc
16: kernel::process::Processu20asu20kernel::process::ProcessTypeswitch_to
16: kernel6driver6Driver5allow
16: capsules6buttonButtonget_button_state
16: kernel::hil::gpio::InterruptValueWrapperu20asu20kernel::hil::gpio::Clientfired
16: kernel3hil4gpio6Outputwrite_activation
16: capsules::gpio::GPIOu20asu20kernel::driver::Drivercommand
16: kernel5debug5panic
16: kernel5debug5flush
16: core3fmt5Writewrite_char
16: mutu20u20asu20core::fmt::Writewrite_str
16: mutu20u20asu20core::fmt::Writewrite_char
16: capsules::led::LEDu20asu20kernel::driver::Drivercommand
16: arty_e2chip::chip::ArtyExxu20asu20kernel::platform::Chiphas_pending_interrupts
16: capsules::virtual_uart::MuxUartu20asu20kernel::hil::uart::TransmitClienttransmitted_buffer
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::ReceiveClientreceived_buffer
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Transmittransmit_buffer
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Transmittransmit_word
16: capsules::virtual_uart::UartDeviceu20asu20kernel::hil::uart::Receivereceive_abort
16: core3ops8function6FnOnce9call_once
16: core3fmt3num3imp52implu20core::fmt::Displayu20foru20u32fmt
16: u20asu20core::any::Anytype_id
16: core7unicode9printable5check
16: core5slice6memchr6memchr
16: core3fmt8buildersDebugStruct6finish
16: core3fmt8buildersDebugTuple6finish
16: boolu20asu20core::fmt::Displayfmt
16: kernel::debug::DebugWriteru20asu20kernel::hil::uart::TransmitClienttransmitted_buffer
16: kernel::debug::DebugWriterWrapperu20asu20core::fmt::Writewrite_str
16: core5slice4sortchoose_pivot28u7bu7bclosureu7du7dh38a4a06e7852bE
16: core5slice29implu20u5bu5dswap
16: riscv_csr3csr32ReadWriteRiscvCsru32modify
16: rv32i3pmp9PMPConfigsort_regions
16: rv32i::pmp::PMPConfigu20asu20kernel::platform::mpu::MPUupdate_app_memory_region
16: sifive4gpio7GpioPinhandle_interrupt
16: sifive::gpio::GpioPinu20asu20kernel::hil::gpio::Configuredeactivate_to_low_power

I confirmed the arty does not work with these patches, or with these plus #2019. However, adding my "I guess?" patch doesn't fix it once adding these patches....

With trace syscalls on, explicitly calling disable_mpu(), and commenting out the mpu lines from sched.rs I can see one syscall print, so the process is running, but then it stops. So I'm a little at a loss.

Copy link
Contributor

@bradjc bradjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch doesn't work. Because we hardcode the location of the APP_MEMORY region, we need that region to always stay in the same place. So we can't store a sorted list of regions.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Previously we would sort the PMP regions everytime we configured the
MPU. This was wasteful in terms of instructions but also wasted stack
space, probably because we cloned the PMPConfig regions.

This patch changes the sorting to only happen after a change is made to
the regions. This should save the number of times we have to sort,
remove sorting out of the critical path and saves a lot of stack space.

See below for the stack changes:

    ### Release build ###
    ## Before this patch ##
    80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17hb3b05a589563feedE
    0     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17hd6078caa7928d4d8E
    592     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h5967285bd6ec5881E

    ## After this patch ##
    80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17hb3b05a589563feedE
    16     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17hd6078caa7928d4d8E
    80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h5967285bd6ec5881E

    ### Debug build ###
    ## Before this patch ##
    80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17h272c094b5b64d63bE
    96     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$26allocate_app_memory_region17h56b3decc4c649f8cE
    32     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17h55a48db93ba6d713E
    592     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h32d25c65ffe73910E

    ## After this patch ##
    80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$15allocate_region17h272c094b5b64d63bE
    96     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$26allocate_app_memory_region17h56b3decc4c649f8cE
    32     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$24update_app_memory_region17h55a48db93ba6d713E
    80     _ZN68_$LT$rv32i..pmp..PMPConfig$u20$as$u20$kernel..platform..mpu..MPU$GT$13configure_mpu17h32d25c65ffe73910E

NOTE: All above numbers already include: tock#2020

I haven't compared instruction diffs, but I'm assuming we reduce the
number of instructions run on app swap as well.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
@alistair23
Copy link
Contributor Author

Ah great catch!

I have updated the PR with a fix for that and actually tested it this time.

Copy link
Contributor

@bradjc bradjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works!

@alistair23
Copy link
Contributor Author

Great!

@bradjc bradjc added the last-call Final review period for a pull request. label Jul 17, 2020
Copy link
Member

@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors bors bot merged commit b99234b into tock:master Jul 20, 2020
@alistair23 alistair23 deleted the alistair/pmp-sort branch July 20, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
last-call Final review period for a pull request. risc-v RISC-V architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants