惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
H
Heimdal Security Blog
Jina AI
Jina AI
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
AWS News Blog
AWS News Blog
C
Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Hacker News
The Hacker News
The Cloudflare Blog
Hugging Face - Blog
Hugging Face - Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
S
Securelist
P
Privacy International News Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
博客园 - 叶小钗
J
Java Code Geeks
V
V2EX
博客园 - Franky
Spread Privacy
Spread Privacy
K
Kaspersky official blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
C
CERT Recently Published Vulnerability Notes
Latest news
Latest news
NISL@THU
NISL@THU
罗磊的独立博客
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
V
Visual Studio Blog

Ubuntu blog

Confidential computing and the new regulatory focus on data in use | Ubuntu A day in the life of an Android developer with Anbox Cloud | Ubuntu Canonical announces the Enterprise Store as part of Ubuntu Pro | Ubuntu Tracing a memory leak bug in PID 1 and contributing an upstream fix: a Linux support story | Ubuntu MAAS installation: bare metal provisioning is easier than ever | Ubuntu Januscape vulnerability CVE-2026-53359 mitigations available | Ubuntu Managing Ubuntu on bare metal at scale | Ubuntu Ubuntu Server: a platform made for enterprise scale | Ubuntu Building an open source chain of trust: new research uncovers key blockers and ways forward | Ubuntu Beyond safety and security: Why automotive open source demands dependability  | Ubuntu DirtyClone Linux kernel local privilege escalation vulnerability fixes available | Ubuntu pedit COW kernel local privilege escalation vulnerability mitigations | Ubuntu Canonical becomes Gold Sponsor of Trifecta Tech Foundation | Ubuntu Challenges designers face in open source (and how to fix them) | Ubuntu Hunting a 16-year-old SQLite bug with TLA+: is dqlite affected? | Ubuntu Anbox Cloud on C4A metal: Android, at scale, without friction | Ubuntu Canonical announces live kernel patching for Arm64 | Ubuntu Ubuntu Summit 26.04: connected by open source | Ubuntu So you need to add microcontrollers to your fleet: now what? | Ubuntu Validating real-world skills through Canonical Academy | Ubuntu Virtualized Android comes to Anbox Cloud | Ubuntu Template: Streamlining open source design contributions | Ubuntu Beyond Mythos: responding to a new threat landscape | Ubuntu A look into Ubuntu Core 26: Building a local AI inference appliance in a virtual machine | Ubuntu A decade of Ubuntu on IBM Z and IBM LinuxONE | Ubuntu AI at the edge: simplifying infrastructure with Cisco and Canonical | Ubuntu The next era of telco clouds: get open infrastructure choice with Sylva and Canonical Kubernetes | Ubuntu What is RDMA over Converged Ethernet (RoCE)? | Ubuntu Beyond tokens per watt – using Ubuntu 26.04 LTS for AI | Ubuntu A look into Ubuntu Core 26: Deploying AI models on Renesas RZ/V series for production | Ubuntu RISC-V profiles – why is RVA23 significant? | Ubuntu AI with AMD ROCm on Ubuntu: your questions answered | Ubuntu Ubuntu and Ubuntu Pro on Azure Cobalt 200 VMs | Ubuntu What is InfiniBand? | Ubuntu How Canonical Support solves hard Linux performance bugs  – even in 12-year old code | Ubuntu Securing AI agent workflows on Ubuntu with the new NVIDIA OpenShell snap | Ubuntu Canonical announces optimized Ubuntu images for TPU virtual machines by Google Cloud | Ubuntu VMware hypervisor deployment using MAAS | Ubuntu Migrating from Apache Spark 3 to Spark 4 | Ubuntu Introducing Workshop: launch sandboxed development environments on Ubuntu with a single command | Ubuntu Run agentic workloads on Arm and Ubuntu | Ubuntu Decoding design: How design and engineering thrive together in open source | Ubuntu Developing web apps with local LLM inference | Ubuntu PinTheft Linux kernel vulnerability mitigation | Ubuntu Canonical announces fully Managed Kubeflow AI operations platform on the Microsoft Azure Marketplace | Ubuntu A look into Ubuntu Core 26: Cloud-powered edge computing with AWS IoT Greengrass and Azure IoT Edge | Ubuntu CVE-2026-46333 (ssh-keysign-pwn) Linux kernel vulnerability mitigations | Ubuntu Finding the blind spot: How Canonical hunts logic flaws with AI | Ubuntu Fragnesia Linux kernel local privilege escalation vulnerability mitigations | Ubuntu Rethinking BYOD security: protecting data without trusting devices | Ubuntu Dirty Frag Linux kernel local privilege escalation vulnerability mitigations | Ubuntu Three weeks to go: A sneak peek of the Ubuntu Summit 26.04 experience | Ubuntu How to use Ubuntu on Windows | Ubuntu Fixes available for CVE-2026-31431 (Copy Fail) Linux Kernel Local Privilege Escalation Vulnerability | Ubuntu Run NVIDIA Nemotron 3 Nano Omni locally in a single command | Ubuntu Why Web Engineering is great | Ubuntu Ubuntu 16.04 LTS has reached the end of standard Expanded Security Maintenance with Ubuntu Pro. Here are your options. | Ubuntu Understanding disaggregated GenAI model serving with llm-d | Ubuntu From Jammy to Resolute: how Ubuntu’s toolchains have evolved | Ubuntu Hybrid search and reranking: a deeper look at RAG | Ubuntu Canonical expands Ubuntu support to next-generation MediaTek Genio 520 and 720 platforms | Ubuntu Intentional leadership at Canonical | Ubuntu Ubuntu Pro comes to Nutanix bare-metal Kubernetes | Ubuntu RISC-V 101 – what is it and what does it mean for Canonical? | Ubuntu Ubuntu Summit 26.04 is coming: Save the date and share your story! | Ubuntu How to manage Ubuntu fleets using on-premises Active Directory and ADSys | Ubuntu Simplify bare metal operations for sovereign clouds | Ubuntu How to Harden Ubuntu SSH: From static keys to cloud identity | Ubuntu The “scanner report has to be green” trap | Ubuntu Modern Linux identity management: from local auth to the cloud with Ubuntu | Ubuntu Canonical welcomes NVIDIA’s donation of the GPU DRA driver to CNCF | Ubuntu Hot code burns: the supply chain case for letting your containers cool before you ship | Ubuntu
How to use RISC-V custom instructions with Ubuntu | Ubuntu
Jon Taylor ( · 2026-06-23 · via Ubuntu blog

Introduction

My previous blog talked about the importance of instruction set standardization for ecosystem stability and growth through the use of profiles. And standardization is indeed important, but since one of RISC-V’s great benefits is the ability to customize the instruction set, we should also consider how to support that ability.

This blog looks at what is needed in the software layer to support hardware custom instructions and how you can make that work with Ubuntu.

What is a custom instruction?

A custom instruction is simply an instruction that is not part of the base instruction set definition or ratified extensions. When RISC-V was created, there was an explicit desire to support innovation at the level of CPU architecture. While much innovation has been done at the microarchitecture level (for example, speculative execution, superscalar pipelines, and so forth), there are very few ISAs that allow for novelty at the architecture level itself. To support this, RISC-V created explicit instruction encoding space for instructions that are not part of the standard ISA or standard extensions. 

Why customize?

In an embedded microcontroller, it’s easy to imagine the benefits of custom instructions. For example in security operations it might be accelerating specific cryptographic operations, or for audio it might be custom DSP acceleration. For example Espressif’s ESP32-P4 provides custom extensions for SIMD DSP.

In these systems the implementor usually controls both hardware and software – or at least software toolchain. However when we think of Linux based systems, it is usually a richer environment, with user deployed applications distributed in binary form. Linux can be used for embedded systems where the software is still tightly controlled, and there are increasing numbers of applications where the scale of deployment makes custom silicon viable.

In a world where software and hardware codesign becomes more common and companies are creating vertically integrated solutions comprising both hardware and software, customized silicon can address opportunities that may not have been possible before. The most well known example in recent years is probably Apple creating their own laptop silicon, but here are a couple of simple examples too:

  1. Custom data types. With machine learning evolving at a very fast pace, using custom data types for a specific application might provide significant benefits in performance or power efficiency
  2. Control and data flow to an external accelerator. RISC-V CPUs are often used alongside custom accelerators, where custom instructions in the host CPU can be used to more efficiently manage the accelerator than connecting it as a simple memory mapped peripheral

While software compiled for custom hardware will only run on that hardware, it can still be worthwhile for the performance or power benefits.

These custom instructions are unlikely to be used by the operating system (OS), but there are situations where the OS needs to know about them. Specifically if the instructions require additional processor state, the OS needs to know about it. Let’s explain that a little further.

What is state space?

State space is things that persist over time – for example, registers containing data values and status flags reporting on the output of instructions. At the OS level, these are important because the OS needs to be able to save and restore this state across events like interrupts. It is also common that registers need to be enabled by the OS. This can either be at boot time, or on a per-process basis at runtime For example, floating point and vector register files (where implemented) are disabled by default, and it is only after enabling them in the OS that application code can make use of them. Even if an implementation didn’t require the OS to enable user access to a particular state, failing to account for it in the OS is likely to cause data corruption or execution problems. 

How to support custom data processing instructions

Where a custom instruction only impacts data processing, but does not require any additional state space, it can be managed without having to modify the OS code. For example, instructions that treat data as a 4-bit datatype but only using the normal integer register file and status registers could be implemented without needing the OS to be aware of them.

Building applications to use these instructions needs either precompiled libraries with them implemented, or a custom toolchain that can target those instructions. Ubuntu’s launchpad.net build infrastructure supports custom toolchains using Private Package Archives (PPA). The toolchain can either be built in its own right in its own PPA, or a pre-built binary toolchain can be included as part of the application code source tree. In either case, the application code is then built in turn and made available in the PPA.

By combining PPAs to manage customizations with an Ubuntu kernel and general package distribution, users can benefit both from security and maintenance patches from Canonical as well as the performance gains from customized hardware

How to support custom instructions that need state space

As discussed above, custom instructions that require state space are more complex since they need a custom kernel to handle saving and restoring the context around interrupts or permit access from user space to the extra state. Therefore, you will need more than a custom toolchain and application code: you will also need to create a custom kernel. Even here, the launchpad.net infrastructure can still be used to help. Again, the first step is making the custom toolchain available. 

Canonical has worked with several RISC-V partners and developed an image cookbook which walks through the steps needed to create a custom kernel package. If you’re thinking of building a custom kernel, this should be your starting point.

Once your custom kernel is ready, you can proceed as above, building the toolchain, kernel, and user packages.

The downside of a custom kernel is that it won’t be maintained by Canonical, so security updates and patches are something you will have to manage yourself for the packages in the PPAs (any standard packages from our main repositories will of course still be supported and updated by Canonical).

Best practices for portability

So far we have assumed that the software will only ever be run on hardware with the related custom instruction support. While this might be true in embedded systems, for engineers building Linux binary packages this creates software that isn’t portable. Running a binary that assumed a given custom instruction was available will cause an illegal instruction trap on hardware that doesn’t support it.

What would be more useful is to write the software in a way that detects at runtime whether the custom instructions are available, and then calls the appropriate code path. This can also be used for standard extensions – for example detecting whether floating point instructions are implemented. If they are, then hardware floating point can be used; if not, then the software can still use a soft floating point implementation, rather than crashing or refusing to run.

The mechanism to do this within linux is hwprobe. It’s beyond the scope of this blog to explain all the details, but in short, it provides a mechanism for user-level code to query the kernel and ask what extensions are supported. In turn the kernel will learn from the boot firmware what instructions are implemented on the specific hardware it is running on.

Earlier I argued that it’s for stateless instructions it’s not strictly necessary for the kernel to know about them. While true, it would mean this binary code may no longer be portable between different CPU implementations which have different extensions implemented. Using descriptions of the extensions in the firmware with a kernel that can identify them and hwprobe provides a more scalable way to support both stateful and stateless custom instructions. 

Conclusion

We have discussed how Ubuntu’s launchpad.net infrastructure can be used to support custom instructions, whether simpler data processing only, or more complex ones involving state space. This shows how RISC-V’s promise of allowing innovation through customization works in a complex Linux environment. 

While chips with custom instructions are less likely to be generally available to developers than vanilla RVA23 designs, it is almost certain there will be applications where Linux + custom RISC-V provides benefits to justify the investment. These will be high volume, high performance applications – for example networking, storage management or AI inference.

Canonical works directly with silicon companies to provide optimized open source solutions. Our Silicon partner page describes more about our partner program or if you’re ready to work with us please get in touch  

Further reading