Hi experts,
I tried to allocate a physical memory address in Linux Kernel, and
pass the memory address to tf-a using smc call. As I asked in previous
mails
(https://lists.trustedfirmware.org/archives/list/tf-a@lists.trustedfirmware.…),
tf-a can not access the physical memory address directly, so I try to
use the `mmap_add_dynamic_region_alloc_va` function in `xlat_table_v2`
Library, and map the physical memory in tf-a.
After calling the function, It does return a new virtual memory
address, but I still failed to access the address, is there any details
I have missed? Here is the code:
```
NOTICE("phys_addr: 0x%lx, virt_addr: 0x%lx\n", phys_addr, virt_addr);
int rc = mmap_add_dynamic_region_alloc_va(phys_addr, ptr_virt_addr,
size, MT_NS | MT_RW_DATA);
if (rc) {
WARN("Failed to map memory at 0x%lx: %d\n", phys_addr, rc);
return;
}
NOTICE("virt_addr_el3: 0x%lx\n", virt_addr_el3);
NOTICE("virt_addr_el3[0] = 0x%x\n", *((uint32_t *)virt_addr_el3));
```
Here is the output:
```
NOTICE: phys_addr: 0x40f0000, virt_addr: 0xffff0000040f0000
NOTICE: mm.base_va: 0
NOTICE: mm.base_va: 100000000
NOTICE: virt_addr_el3: 0x100000000
[ 38.540464] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 38.546584] rcu: 4-...0: (1 ticks this GP)
idle=4224/1/0x4000000000000000 softirq=125/125 fqs=2625
[ 38.555651] (detected by 0, t=5252 jiffies, g=-779, q=16 ncpus=8)
[ 38.561843] Task dump for CPU 4:
[ 38.565075] task:main state:R running task stack:0
pid:195 ppid:181 flags:0x00000002
[ 38.575015] Call trace:
[ 38.577464] __switch_to+0xe4/0x160
[ 38.580975] 0x42
```
I would be grateful for any advice or suggestions you may have.
Sincerely,
Feifan
This event has been canceled with a note:
"Hi, Cancelling as no topic this week. Thanks & Regards, Olivier. "
TF-A Tech Forum
Thursday Sep 5, 2024 ⋅ 5pm – 6pm
Central European Time - Paris
We run an open technical forum call for anyone to participate and it is not
restricted to Trusted Firmware project members. It will operate under the
guidance of the TF TSC. Feel free to forward this invite to colleagues.
Invites are via the TF-A mailing list and also published on the Trusted
Firmware website. Details are here:
https://www.trustedfirmware.org/meetings/tf-a-technical-forum/Trusted
Firmware is inviting you to a scheduled Zoom meeting.Join Zoom
Meetinghttps://linaro-org.zoom.us/my/trustedfirmware?pwd=VktXcm5MNUUyVVM4R0k3ZUtvdU84QT09
One tap mobile+16465588656,,9159704974# US (New
York)+16699009128,,9159704974# US (San Jose)Dial by your location +1
646 558 8656 US (New York) +1 669 900 9128 US (San Jose) 877
853 5247 US Toll-free 888 788 0099 US Toll-freeMeeting ID: 915 970
4974Find your local number: https://zoom.us/u/ad27hc6t7h
Guests
tf-a(a)lists.trustedfirmware.org
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event. To
stop receiving future updates for this event, decline this event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding