• Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
    C
  • License
    Other
  • Created almost 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AArch32 and AArch64 Runtime Code Generation Library

VIXL: ARMv8 Runtime Code Generation Library

Contents:

  • Overview
  • Licence
  • Requirements
  • Known limitations
  • Bug reports
  • Usage

Overview

VIXL contains three components.

  1. Programmatic assemblers to generate A64, A32 or T32 code at runtime. The assemblers abstract some of the constraints of each ISA; for example, most instructions support any immediate.
  2. Disassemblers that can print any instruction emitted by the assemblers.
  3. A simulator that can simulate any instruction emitted by the A64 assembler. The simulator allows generated code to be run on another architecture without the need for a full ISA model.

The VIXL git repository can be found on GitHub.

Build and Test Status

  • Build Status Simulator
  • Build Status Native
  • Build Status MacOS

Licence

This software is covered by the licence described in the LICENCE file.

Contributions, as pull requests or via other means, are accepted under the terms of the same LICENCE.

Requirements

To build VIXL the following software is required:

  1. Python 3.5+
  2. SCons 2.0
  3. GCC 4.8+ or Clang 4.0+

A 64-bit host machine is required, implementing an LP64 data model. VIXL has been tested using GCC on AArch64 Debian, GCC and Clang on amd64 Ubuntu systems.

To run the linter and code formatting stages of the tests, the following software is also required:

  1. Git
  2. Google's cpplint.py
  3. clang-format 11+
  4. clang-tidy 11+

Refer to the 'Usage' section for details.

Note that in Ubuntu 18.04, clang-tidy-4.0 will only work if the clang-4.0 package is also installed.

Supported Arm Architecture Features

Feature VIXL CPUFeatures Flag Notes
BTI kBTI Per-page enabling not supported
DotProd kDotProduct
FCMA kFcma
FHM kFHM
FP16 kFPHalf, kNEONHalf
FRINTTS kFrintToFixedSizedInt
FlagM kFlagM
FlagM2 kAXFlag
I8MM kI8MM
JSCVT kJSCVT
LOR kLORegions
LRCPC kRCpc
LRCPC2 kRCpcImm
LSE kAtomics
PAuth kPAuth, kPAuthGeneric Not ERETAA, ERETAB
RAS kRAS
RDM kRDM
SVE kSVE
SVE2 kSVE2
SVEBitPerm kSVEBitPerm
SVEF32MM kSVEF32MM
SVEF64MM kSVEF64MM
SVEI8MM kSVEI8MM

Enable generating code for an architecture feature by combining a flag with the MacroAssembler's defaults. For example, to generate code for SVE, use masm.GetCPUFeatures()->Combine(CPUFeatures::kSVE);.

See the cpu features header file for more information.

Known Limitations

VIXL was developed for JavaScript engines so a number of features from A64 were deemed unnecessary:

  • Limited rounding mode support for floating point.
  • Limited support for synchronisation instructions.
  • Limited support for system instructions.
  • A few miscellaneous integer and floating point instructions are missing.

The VIXL simulator supports only those instructions that the VIXL assembler can generate. The doc directory contains a list of supported A64 instructions.

The VIXL simulator was developed to run on 64-bit amd64 platforms. Whilst it builds and mostly works for 32-bit x86 platforms, there are a number of floating-point operations which do not work correctly, and a number of tests fail as a result.

Debug Builds

Your project's build system must define VIXL_DEBUG (eg. -DVIXL_DEBUG) when using a VIXL library that has been built with debug enabled.

Some classes defined in VIXL header files contain fields that are only present in debug builds, so if VIXL_DEBUG is defined when the library is built, but not defined for the header files included in your project, you will see runtime failures.

Exclusive-Access Instructions

All exclusive-access instructions are supported, but the simulator cannot accurately simulate their behaviour as described in the ARMv8 Architecture Reference Manual.

  • A local monitor is simulated, so simulated exclusive loads and stores execute as expected in a single-threaded environment.
  • The global monitor is simulated by occasionally causing exclusive-access instructions to fail regardless of the local monitor state.
  • Load-acquire, store-release semantics are approximated by issuing a host memory barrier after loads or before stores. The built-in __sync_synchronize() is used for this purpose.

The simulator tries to be strict, and implements the following restrictions that the ARMv8 ARM allows:

  • A pair of load-/store-exclusive instructions will only succeed if they have the same address and access size.
  • Most of the time, cache-maintenance operations or explicit memory accesses will clear the exclusive monitor.
    • To ensure that simulated code does not depend on this behaviour, the exclusive monitor will sometimes be left intact after these instructions.

Instructions affected by these limitations: stxrb, stxrh, stxr, ldxrb, ldxrh, ldxr, stxp, ldxp, stlxrb, stlxrh, stlxr, ldaxrb, ldaxrh, ldaxr, stlxp, ldaxp, stlrb, stlrh, stlr, ldarb, ldarh, ldar, clrex.

Security Considerations

VIXL allows callers to generate any code they want. The generated code is arbitrary, and can therefore call back into any other component in the process. As with any self-modifying code, vulnerabilities in the client or in VIXL itself could lead to arbitrary code generation.

For performance reasons, VIXL's Assembler only performs debug-mode checking of instruction operands (such as immediate field encodability). This can minimise code-generation overheads for advanced compilers that already model instructions accurately, and might consider the Assembler's checks to be redundant. The Assembler should only be used directly where encodability is independently checked, and where fine control over all generated code is required.

The MacroAssembler synthesises multiple-instruction sequences to support some unencodable operand combinations. The MacroAssembler can provide a useful safety check in cases where the Assembler's precision is not required; an unexpected unencodable operand should result in a macro with the correct behaviour, rather than an invalid instruction.

In general, the MacroAssembler handles operands which are likely to vary with user-supplied data, but does not usually handle inputs which are likely to be easily covered by tests. For example, move-immediate arguments are likely to be data-dependent, but register types (e.g. x vs w) are not.

We recommend that all users use the MacroAssembler, using ExactAssemblyScope to invoke the Assembler when specific instruction sequences are required. This approach is recommended even in cases where a compiler can model the instructions precisely, because, subject to the limitations described above, it offers an additional layer of protection against logic bugs in instruction selection.

Bug reports

Bug reports may be made in the Issues section of GitHub, or sent to [email protected]. Please provide any steps required to recreate a bug, along with build environment and host system information.

Usage

Running all Tests

The helper script tools/test.py will build and run every test that is provided with VIXL, in both release and debug mode. It is a useful script for verifying that all of VIXL's dependencies are in place and that VIXL is working as it should.

By default, the tools/test.py script runs a linter to check that the source code conforms with the code style guide, and to detect several common errors that the compiler may not warn about. This is most useful for VIXL developers. The linter has the following dependencies:

  1. Git must be installed, and the VIXL project must be in a valid Git repository, such as one produced using git clone.
  2. cpplint.py, as provided by Google, must be available (and executable) on the PATH.

It is possible to tell tools/test.py to skip the linter stage by passing --nolint. This removes the dependency on cpplint.py and Git. The --nolint option is implied if the VIXL project is a snapshot (with no .git directory).

Additionally, tools/test.py tests code formatting using clang-format-4.0, and performs static analysis using clang-tidy-4.0. If you don't have these tools, disable the test using --noclang-format or --noclang-tidy, respectively.

Also note that the tests for the tracing features depend upon external diff and sed tools. If these tools are not available in PATH, these tests will fail.

Getting Started

We have separate guides for introducing VIXL, depending on what architecture you are targeting. A guide for working with AArch32 can be found here, while the AArch64 guide is here. Example source code is provided in the examples directory. You can build examples with either scons aarch32_examples or scons aarch64_examples from the root directory, or use scons --help to get a detailed list of available build targets.

More Repositories

1

OpenCSD

CoreSight trace stream decoder developed openly
C++
140
star
2

lava

Read only mirror https://gitlab.com/lava/lava
Python
72
star
3

meta-qcom

OpenEmbedded/Yocto Project BSP layer for Qualcomm based platforms
BitBake
62
star
4

squad

Software Quality Dashboard
Python
59
star
5

documentation

43
star
6

uadk

UADK (User space Accelerator Development Kit), is a user space framework for using accelerators. Active branch is 'master'.
C
41
star
7

test-definitions

Test definitions work with and without LAVA
Shell
36
star
8

works-on-woa

Website repository for worksonwoa.com
TypeScript
36
star
9

lava-server

Python
32
star
10

website

This repository stores the content used in our static Jekyll based website. If you need to make a change to the website please submit a PR to this repository with your changes.
HTML
25
star
11

ansible-playbook-for-ohpc

Ansible playbook for OpenHPC
Shell
24
star
12

openstack-exporter

Prometheus openstack exporter written in Golang.
Go
22
star
13

aerology

Inspect Zephyr and TFM applications, post mortem
Rust
18
star
14

msm

Qualcomm mainline status
Python
18
star
15

lava-dispatcher

Merged into a single codebase with lava-server
Python
15
star
16

zephyr_confidential_ai

Confidential AI sample application for Zephyr RTOS
C++
14
star
17

odp-thunderx

Cavium ThunderX implimentation of ODP
C
13
star
18

step

Secure data pipeline proof of concept module for Zephyr RTOS
C
11
star
19

tinyBLAS

A fork of OpenBLAS with Armv8-A SVE (Scalable Vector Extension) support
Fortran
11
star
20

freertos-pkcs11-psa

FreeRTOS PSA PKCS11
C
10
star
21

lite_bootstrap_server

Proof of concept certificate authority and bootstrap server
Go
10
star
22

hcqc

hcqc - HPC compiler quality checker
C
9
star
23

linux-kernel-uadk

linux kernel for UADK (also known as 'warpdrive')
C
8
star
24

meta-ledge

Shell
7
star
25

ecosystemlandscape

JavaScript
7
star
26

Connect

The static Jekyll site for Linaro Connect Event
HTML
7
star
27

squad-client

squad-client is a tool to ease fetching api data from a SQUAD instance
Python
6
star
28

jipdate

Linaro JIRA Update Tool
Python
6
star
29

django-crowd-rest-backend

Fork of https://bitbucket.org/manuelkoch/django-crowd-rest-backend with fixes and improvements.
Python
6
star
30

uadk_engine

OpenSSL engine for uadk.
C
6
star
31

git-gpgcrypt

Transparent git content encryption backed by GPG public key infrastructure
Shell
6
star
32

vmspec-tools

Tools for verifying vmspec compliance
Python
5
star
33

hpc_lab_setup

Jenkins Jobs for HPC Lab
Python
5
star
34

freertos-ota-pal-psa

C
5
star
35

lite-lava-docker-compose

LITE Team LAVA docker dispatcher
Python
5
star
36

poplar-tools

4
star
37

OpenPlatformPkg

Development tree. Check https://git.linaro.org/uefi/OpenPlatformPkg.git for the upstream tree.
C
4
star
38

poplar-linux

Linux Kernel for Poplar
4
star
39

hpc_lustreci

HPC-SIG Lustre CI
Shell
3
star
40

erp-test-automation

Tools and scripts to automate hardware for the purposes of ERP testing.
Python
3
star
41

lkft-website

Linaro's Linux Kernel Functional Testing Website
JavaScript
3
star
42

lava-test-plans

Jinja
3
star
43

pkg-lava-tool

Debian and Ubuntu packaging for the lava-tool component of LAVA
3
star
44

lava-functional-tests

Shell
3
star
45

qemu

This is a fork from Official QEMU source repository. What's added is the support of vSVA: sharing guest application address space with passthrough devices. It's part of UADK (WarpDrive) ecosystem.
C
3
star
46

kir

Shell
2
star
47

hpc_benchmark_analysis

Random scripts to interpret benchmark / profiling results
Python
2
star
48

cloud

An open cloud for development in the ARMv8 server ecosystem (static Jekyll website files)
JavaScript
2
star
49

qa-reports-known-issues

Python
2
star
50

benchmark_harness

Harness to run benchmarks with options for different machines and different compilers
Python
2
star
51

magnum

Python
2
star
52

mr-provisioner-client

Python library to use Mr-Provisioner's API
Python
2
star
53

smartnic

SmartNIC Project
2
star
54

hpc_tensorflowci

HPC-SIG Tensorflow CI
Shell
2
star
55

qa-reports.linaro.org

ansible code for deploying qa-reports.linaro.org
HCL
2
star
56

mcumux

Muxer for mcumgr and debug messages over same port.
Go
2
star
57

lkft-tools

Tools for LKFT developers
Python
2
star
58

test-kernel-public

Repo for public test
C
2
star
59

lite-jailhouse

Example of using Jailhouse as a hypervisor with Zephyr RTOS and QEMU
C
2
star
60

lite-lava

Fork of LAVA repo with LITE changes
Python
2
star
61

lite-cornea

A command line shim to interact with the Iris Debug server of an ARM FVP
Rust
1
star
62

lustretest

Python
1
star
63

pkg-lava-dispatcher

Debian and Ubuntu packaging for the lava-dispatcher component of LAVA
1
star
64

ledge-uboot

C
1
star
65

poplar-l-loader

l-loader for Poplar
1
star
66

lite-flow

LITE Cryptographic Workflow Demonstration
Rust
1
star
67

pkg-lava-coordinator

Debian and Ubuntu packaging for the lava-coordinator component of LAVA
1
star
68

jira-metadata

JIRA metadata schemas used for Linaro JIRA instances
1
star
69

ai_security_courseware

A detailed course to introduce aspects of AI on Security
1
star
70

pkg-lavacli

Debian and Ubuntu packaging for the lavacli component of LAVA
1
star
71

poplar-u-boot

U-Boot for Poplar
1
star
72

rpms-kernel

Kernel Source RPM repository Edit Add topics
1
star
73

linux-canaries

Various Linux kernel branches that fail in specific ways; Used to validate CI services and infrastructure.
1
star
74

ledge-oe-manifest

Shell
1
star
75

aionservers

Aspiring code to enable expanding novel approaches to using ML Frameworks for the broader topic of AI
1
star
76

poplar-arm-trusted-firmware

ATF for Poplar
1
star
77

iotboot

Bootloader for IOT
C
1
star
78

trs

Trusted Reference Stack by Linaro
Makefile
1
star
79

mr-provisioner-kea-dhcp4-role

Ansible role for installing/upgrade a kea-dhcp4 server required for a Mr. Provisioner installation.
1
star
80

ansible-role-mr-provisioner

Provision a host using Mr. Provisioner
Python
1
star
81

hwpack_arndale

Arndale (Exynos 5250) hardware pack
1
star
82

ansible-role-erp-get-build

Download an Enterprise Reference Platform (ERP) release
1
star
83

lavasoftware

Repository for the https://lavasoftware.org/ static website.
SCSS
1
star
84

squadplugins

Python
1
star
85

zephyr-ivshmem

IVSHMEM dual test bed sample app for Zephyr RTOS
C
1
star