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

Fixed FPU/SIMD accessibility for EL1 execution #100

Open
wants to merge 3,955 commits into
base: master
Choose a base branch
from

Conversation

giorgiocicero
Copy link

This patch fixes the configuration of CPACR_EL1 (Architectural Feature Access Control Register) that controls the SIMD/FPU access in case of EL1 execution (enabled with the EL1_NONSECURE and HYP_GUEST macros set to 1 and EL3 macro set to 0 within bspconfig.h). This patch covers both standalone and FreeRTOS BSP.

I am using FreeRTOS executing at EL1 as Guest upon a bare-metal hypervisor. As far as I understood, the SIMD/FPU is allowed only in case of FreeRTOS BSP, while any instruction associated with Advanced SIMD and Floating-point execution shall be trapped in case of standalone BSP.

The FPEN field ([21:20]) of the CPACR_EL1 was erroneously set since the shifting value was 0x20 and there is no guard for distinguishing between standalone and FreeRTOS BSP.

The changes are:

  • enable trapping any instruction in EL0/1 that uses registers associated with Advanced SIMD and FP execution for standalone BSP by clearing FPEN field of CPACR_EL1 register
  • disable trapping any instruction in EL0/1 that uses registers associated with Advanced SIMD and FP execution for FreeRTOS BSP by setting FPEN field of CPACR_EL1 register

[email protected] and others added 30 commits June 5, 2019 17:17
DDRMC_MAIN, NOC_NIR and DDRMC_NOC block values are modified to ensure
that they are in sync with CDO v2 spec. CDO v1 spec has been modified as
well.

Signed-off-by: Vikram Sreenivasa Batchali <[email protected]>
Acked-by: Mounika Grace Akula <[email protected]>

Acked-by: Mounika Grace Akula <[email protected]>
Signed-off-by: Mubin Usman Sayyed <[email protected]>

Acked-for-series: Anirudha Sarangi <[email protected]>
Pass subsystem id instead of index

Signed-off-by: Jolly Shah <[email protected]>

Acked-for-series: Rajan Vaja <[email protected]>
Use subsystem id passed by PLM for CDO commands

Signed-off-by: Jolly Shah <[email protected]>

Acked-for-series: Rajan Vaja <[email protected]>
Added routines within pre-processor directives to for GTYE5 flow.
Removed ERR_IRQ from the driver.

Signed-off-by: Eric Bong <[email protected]>
Acked-by: Gilbert Magnaye <[email protected]>

Acked-by: Gilbert Magnaye <[email protected]>
This patch updates the index.html and readme.txt files
with the information related to newly supported example
drivers

Signed-off-by: Anurag Kumar Vulisha <[email protected]>
Updated xwdttb_selftest_example.c & xwdttb_winwdt_example.c files with versal support.
Added xwdttb_gwdt_selftest_example.c & xwdttb_gwdt_example.c examples for Versal.

Signed-off-by: Srinivas Neeli <[email protected]>

Acked-for-series: Srinivas Goud <[email protected]>
Existing R5 freertos port does not have support for hard float.

Signed-off-by: Anirudha Sarangi <[email protected]>
This patch fix MISRA-C mandatory violations in below files.
69D
Variable used before assignment
MISRA-C:2012/AMD1/ADD2: R.9.1

Signed-off-by: Sivaji Boddupilli <[email protected]>
Acked-by: Vikram Sreenivasa Batchali <[email protected]>

Acked-by: Vikram Sreenivasa Batchali <[email protected]>
By default this was taking lower page only, but for soft reset usecases,
the DDR initialization was failing due to incorrect SPD data being
read from EEPROM. This patch fixes the same.

Signed-off-by: Manish Narani <[email protected]>
Acked-by: Vikram Sreenivasa Batchali <[email protected]>

Acked-by: Vikram Sreenivasa Batchali <[email protected]>
BYTE_ORDER is defined in microblaze compiler header so we get a warning
when it's redefined in lwip arch/cpu.h. To address it add a check before
redefining it. Fixes below compiler warning.

../../../include/arch/cpu.h:41: warning: "BYTE_ORDER" redefined
In file included from /include/sys/types.h:67,
                 from /include/stdio.h:61,
                 from contrib/ports/xilinx/netif/xemacliteif.c:47:
<install_path>/microblaze-xilinx-elf/include/machine/endian.h:20: note:
this is the location of the previous definition

Signed-off-by: Radhey Shyam Pandey <[email protected]>

Acked-for-series: Harini Katakam <[email protected]>
Remove unused variables and also make IP address parameter constant in
line with the output function type definition. Fixes below gcc warnings-

xemacliteif.c: In function 'configure_IEEE_phy_speed_emaclite':
xemacliteif.c:769:6: warning: unused variable 'phylinkspeed' [-Wunused-variable]
  u16 phylinkspeed;
      ^~~~~~~~~~~~
xemacliteif.c:768:6: warning: unused variable 'status' [-Wunused-variable]
  u16 status;
      ^~~~~~
xemacliteif.c: In function 'xemacliteif_init':
xemacliteif.c:842:16: warning: assignment to 'netif_output_fn' {aka 'signed char
(*)(struct netif *, struct pbuf *, const struct ip4_addr *)'} from incompatible
 pointer type 'err_t (*)(struct netif *, struct pbuf *, ip_addr_t *)' {aka
 'signed char (*)(struct netif *, struct pbuf *, struct ip4_addr *)'}
 [-Wincompatible-pointer-types]
  netif->output = xemacliteif_output;

Signed-off-by: Radhey Shyam Pandey <[email protected]>

Acked-for-series: Harini Katakam <[email protected]>
For freertos configuration, when the multiple packets arrive at the same
time binary semaphore sem_rx_data_available is incremented/signaled only
once. So to ensure that all packets are received before next semaphore
event loop through low_level_input().

Signed-off-by: Radhey Shyam Pandey <[email protected]>

Acked-for-series: Harini Katakam <[email protected]>
Return 0 when NOC_TYPE1_NCR bit is set to 0, else return 1;

Signed-off-by: Vikram Sreenivasa Batchali <[email protected]>
Acked-by: Mounika Grace Akula <[email protected]>

Acked-by: Mounika Grace Akula <[email protected]>
This patch fix MISRA-C violations in below files.
69D
Variable used before assignment
MISRA-C:2012/AMD1/ADD2: R.9.1

Signed-off-by: Sivaji Boddupilli <[email protected]>
Acked-by: Vikram Sreenivasa Batchali <[email protected]>

Acked-by: Vikram Sreenivasa Batchali <[email protected]>
This patch fix MISRA-C mandatory violations in below files.
69D
Variable used before assignment
MISRA-C:2012/AMD1/ADD2: R.9.1

Signed-off-by: Sivaji Boddupilli <[email protected]>
Acked-by: Vikram Sreenivasa Batchali <[email protected]>

Acked-by: Vikram Sreenivasa Batchali <[email protected]>
This patch adds the support for modified versal IP names
for canfd, spips, ospipsv, qspipsu, uartsbsa, iicps.

Signed-off-by: Naga Sureshkumar Relli <[email protected]>

Acked-for-series: Srinivas Goud <[email protected]>

Acked-for-series: Srinivas Goud <[email protected]>
Add support for versal IP name.

Signed-off-by: Nava kishore Manne <[email protected]>
Acked-by: Appana Durga Kedareswara rao <[email protected]>

Acked-by: Appana Durga Kedareswara rao <[email protected]>
Add support for versal IP name.

Signed-off-by: Nava kishore Manne <[email protected]>
Acked-by: Appana Durga Kedareswara rao <[email protected]>

Acked-by: Appana Durga Kedareswara rao <[email protected]>
The macro returns the ALARM flag needed for a
particular supply

Signed-off-by: Anand Ashok Dumbre <[email protected]>

Acked-for-series: Conall O'Griofa <[email protected]>
Added API to be able to set a particular supply to
a New Data interrupt

Signed-off-by: Anand Ashok Dumbre <[email protected]>

Acked-for-series: Conall O'Griofa <[email protected]>
Added extern C to all header files to enable compilation in C++

Signed-off-by: Nicole Baze <[email protected]>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <[email protected]>

Acked-by: Jyotheeswar Reddy Mutthareddyvari <[email protected]>
Added extern C to resolve compilation errors occuring for C++

Signed-off-by: Nicole Baze <[email protected]>
Acked-by: Jyotheeswar Reddy Mutthareddyvari <[email protected]>

Acked-by: Jyotheeswar Reddy Mutthareddyvari <[email protected]>
Signed-off-by: Ben Levinsky <[email protected]>

Acked-for-series: Wendy Liang <[email protected]>
…U id

Use different shared memory based on RPU id.

Signed-off-by: Ben Levinsky <[email protected]>

Acked-for-series: Wendy Liang <[email protected]>
… on RPU id

Use different shared memory based on RPU id.

Signed-off-by: Ben Levinsky <[email protected]>

Acked-for-series: Wendy Liang <[email protected]>
Use different shared memory based on RPU id.

Signed-off-by: Ben Levinsky <[email protected]>

Acked-for-series: Wendy Liang <[email protected]>
Added length validations in XilSKey_Efuse_ValidateKey()
functions

Signed-off-by: Archana Obannagari <[email protected]>
Acked-by: VNSL Durga Challa <[email protected]>

Acked-by: VNSL Durga Challa <[email protected]>
Signed-off-by: Eric Bong <[email protected]>
Acked-by: Yunhai Qiao <[email protected]>

Acked-by: Yunhai Qiao <[email protected]>
As part of refactoring hardware offsets are placed
into the corresponding platform folders.
Splited common xsecure_hw.h file into xsecure_sha_hw.h,
xsecure_aes_hw.h and xsecure_rsa_hw.h.
Also common functionalities like SSS configurations and
hardware read and write APIs are placed in utils

Signed-off-by: VNSL Durga Challa <[email protected]>

Acked-for-series: Mohan Dhanawade <[email protected]>
mnarani and others added 20 commits June 5, 2019 21:33
Eye Tests have memory range to be tested of 1MB. So this was not a
problem for split between Lower and Upper DDR testing together. This
patch handles the case when User might select the Start Address just
before the end of the lower DDR Range.

Signed-off-by: Manish Narani <[email protected]>
Acked-By: Srinivas Goud <[email protected]>

Acked-By: Srinivas Goud <[email protected]>
…an 32 bit value.

Signed-off-by: Eric Bong <[email protected]>
Acked-by: Yunhai Qiao <[email protected]>

Acked-by: Yunhai Qiao <[email protected]>
…ot works. Fix Made in application files to retrain RX properly

Signed-off-by: Shruti Gupta <[email protected]>

Acked by: Kapil Usgaonkar<[email protected]>
…o PSV

This patch updates the PS IP definition macros available in the
xparameters_ps.h file from PSU to PSV.

Signed-off-by: Appana Durga Kedareswara rao <[email protected]>

Acked-for-series: Anirudha Sarangi <[email protected]>
Existing implementation fetches subsystem_id from IPI mask only if
current subsystem_id is set as INVALID_SUBSYTEMID. The CDO sets
subsystem_id during start to process other CDO commands in LibPM.
So after CDO load, every command from IPI is treated for current
subsystem_id not from IPI mask which is wrong.

As a solution of above, CDO needs to invalidate the subsystem_id
at the end of CDO, but set_current_subsystem() API doesn't allow
INVALID_SUBSYTEMID to set.

Allow INVALID_SUBSYTEMID to be set from CDO through
set_current_subsystem() API.

Signed-off-by: Ravi Patel <[email protected]>
Acked-by: Jolly Shah <[email protected]>

Acked-by: Jolly Shah <[email protected]>
Added frequently used functions in common area, so that other
modules can make use of it.

Signed-off-by: Mohan Marutirao Dhanawade <[email protected]>

Acked-for-series: Appana Durga Kedareswara rao <[email protected]>
This patch fixes psu->psv as per xparameters.h

Signed-off-by: VNSL Durga Challa <[email protected]>
Acked-by: Sarat Chand Savitala <[email protected]>

Acked-by: Sarat Chand Savitala <[email protected]>
armclang archiver needs "-" prefix for archiver flags.
Update xilpm makefile accordingly.

Signed-off-by: Ravi Patel <[email protected]>
Acked-by:  Mubin Sayyed <[email protected]>

Acked-by:  Mubin Sayyed <[email protected]>
… and update for MST application

Signed-off-by: Kapil Usgaonkar <[email protected]>

Acked by : Pankaj Kumbhare <[email protected]>
Updated xgpiops_polled_example.c file with versal support.

Signed-off-by: Srinivas Neeli <[email protected]>

Acked-for-series: Anirudha Sarangi <[email protected]>
updated GPIO Makefile for IAR compiler.

Signed-off-by: Srinivas Neeli <[email protected]>

Acked-for-series: Anirudha Sarangi <[email protected]>
armcc compiler was not accepting declaring typedef variable in for
statement. So moved typedef variable definition at start of the function.

Signed-off-by: Mohan Marutirao Dhanawade <[email protected]>

BRANCH:2019.1
CR-1030701
Acked-by: Srikanth Vemula <[email protected]>

Acked-by: Srikanth Vemula <[email protected]>
This patch renames the library instance name from xilmbox to xilmailbox.

Signed-off-by: Appana Durga Kedareswara rao <[email protected]>
Acked-by: Nava kishore Manne <[email protected]>
This patch removes Xilinx copyright and license text from FatFS source
files.

Signed-off-by: Manish Narani <[email protected]>
Signed-off-by: Shireesha Kothakonda <[email protected]>
In case of execution as Guest on hypervisor (EL1_NONSECURE == 1):
 - enable trapping of SIMD/FPU registers for standalone BSP by clearing FPEN field of CPACR_EL1 register
 - disable trapping of SIMD/FPU registers for FreeRTOS BSP by setting FPEN field of CPACR_EL1 register
@mubinsyed
Copy link
Contributor

Hi @giorgiocicero,

Thanks for the patch.
We have identified this bug recently and fixed it locally. It would be available in 2020.1 release.

Regards,
Mubin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants