CINXE.COM
Documentation/Platforms/RISCV - QEMU
<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"/> <title>Documentation/Platforms/RISCV - QEMU</title> <script>document.documentElement.className="client-js";RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"dd4af334fa381e82f6a52e8b","wgCSPNonce":false,"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Documentation/Platforms/RISCV","wgTitle":"Documentation/Platforms/RISCV","wgCurRevisionId":10741,"wgRevisionId":10741,"wgArticleId":1252,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Documentation/Platforms/RISCV","wgRelevantArticleId":1252,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgVector2022PreviewPages":[]}; RLSTATE={"skins.vector.user.styles":"ready","site.styles":"ready","user.styles":"ready","skins.vector.user":"ready","user":"ready","user.options":"loading","mediawiki.ui.button":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","mediawiki.ui.icon":"ready"};RLPAGEMODULES=["site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","skins.vector.es6"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.implement("user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});});});</script> <link rel="stylesheet" href="/load.php?lang=en&modules=mediawiki.ui.button%2Cicon%7Cskins.vector.icons%2Cstyles&only=styles&skin=vector-2022"/> <script async="" src="/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="generator" content="MediaWiki 1.39.7"/> <meta name="format-detection" content="telephone=no"/> <meta name="viewport" content="width=1000"/> <link rel="icon" href="/favicon.ico"/> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="QEMU (en)"/> <link rel="EditURI" type="application/rsd+xml" href="https://wiki.qemu.org/api.php?action=rsd"/> <link rel="license" href="http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt"/> <link rel="alternate" type="application/atom+xml" title="QEMU Atom feed" href="/index.php?title=Special:RecentChanges&feed=atom"/> </head> <body class="skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Documentation_Platforms_RISCV rootpage-Documentation_Platforms_RISCV skin-vector-2022 action-view vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-language-alert-in-sidebar-disabled vector-feature-sticky-header-disabled vector-feature-sticky-header-edit-disabled vector-feature-table-of-contents-disabled vector-feature-visual-enhancement-next-disabled"><div class="mw-page-container"> <span id="top-page"></span> <a class="mw-jump-link" href="#content">Jump to content</a> <div class="mw-page-container-inner"> <input type="checkbox" id="mw-sidebar-checkbox" class="mw-checkbox-hack-checkbox" > <header class="mw-header"> <div class="mw-header-aside"> <label id="mw-sidebar-button" class="mw-checkbox-hack-button mw-ui-icon mw-ui-button mw-ui-quiet mw-ui-icon-element" for="mw-sidebar-checkbox" role="button" aria-controls="mw-panel" data-event-name="ui.sidebar" tabindex="0" title="Main menu"> <span>Toggle sidebar</span> </label> <a href="/Main_Page" class="mw-logo"> <span class="mw-logo-container"> <img class="mw-logo-wordmark" alt="QEMU" src="/images/Qemu-logo-small.png" style="width: 9.375em; height: 3em;"> </span> </a> </div> <div class="mw-header-content"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/Special:Search" title="Search QEMU [f]" accesskey="f" class="mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-wikimedia-search search-toggle"> <span>Search</span> </a> <div> <form action="/index.php" id="searchform" class="vector-search-box-form"> <div id="simpleSearch" class="vector-search-box-inner" data-search-loc="header-moved"> <input class="vector-search-box-input" type="search" name="search" placeholder="Search QEMU" aria-label="Search QEMU" autocapitalize="sentences" title="Search QEMU [f]" accesskey="f" id="searchInput" > <input type="hidden" name="title" value="Special:Search"> <input id="mw-searchButton" class="searchButton mw-fallbackSearchButton" type="submit" name="fulltext" title="Search the pages for this text" value="Search"> <input id="searchButton" class="searchButton" type="submit" name="go" title="Go to a page with this exact name if it exists" value="Go"> </div> </form> </div> </div> <nav class="vector-user-links" aria-label="Personal tools" role="navigation" > <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet mw-portlet-vector-user-menu-overflow emptyPortlet vector-user-menu-overflow" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"></ul> </div> </div> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal vector-user-menu vector-user-menu-logged-out vector-menu-dropdown" title="More options" > <input type="checkbox" id="p-personal-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-personal" class="vector-menu-checkbox" /> <label id="p-personal-label" for="p-personal-checkbox" class="vector-menu-heading mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis" > <span class="vector-menu-heading-label">Personal tools</span> </label> <div class="vector-menu-content"> <div class="vector-user-menu-create-account"><a href="/index.php?title=Special:CreateAccount&returnto=Documentation%2FPlatforms%2FRISCV" class="vector-menu-content-item user-links-collapsible-item" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="mw-ui-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></div> <div class="vector-user-menu-login"><a href="/index.php?title=Special:UserLogin&returnto=Documentation%2FPlatforms%2FRISCV" class="vector-menu-content-item vector-menu-content-item-login" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="mw-ui-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></div> <ul class="vector-menu-content-list"></ul> </div> </div> </nav> </div> </header> <div class="vector-sidebar-container "> <div id="mw-navigation"> <nav id="mw-panel" class="mw-sidebar" aria-label="Site" role="navigation"> <div id="p-Link_to_website" class="vector-menu mw-portlet mw-portlet-Link_to_website vector-menu-portal portal" > <div id="p-Link_to_website-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Link to website</span> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-About-QEMU" class="mw-list-item"><a href="/QEMU:About"><span>About QEMU</span></a></li></ul> </div> </div> <div id="p-Get" class="vector-menu mw-portlet mw-portlet-Get vector-menu-portal portal" > <div id="p-Get-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Get</span> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-Download" class="mw-list-item"><a href="/Download"><span>Download</span></a></li><li id="n-License" class="mw-list-item"><a href="/License"><span>License</span></a></li></ul> </div> </div> <div id="p-Contribute" class="vector-menu mw-portlet mw-portlet-Contribute vector-menu-portal portal" > <div id="p-Contribute-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Contribute</span> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-Start-Here" class="mw-list-item"><a href="/Contribute"><span>Start Here</span></a></li><li id="n-Report-a-Bug" class="mw-list-item"><a href="/Contribute/ReportABug"><span>Report a Bug</span></a></li><li id="n-Report-a-security-issue" class="mw-list-item"><a href="/SecurityProcess"><span>Report a security issue</span></a></li><li id="n-Submit-a-Patch" class="mw-list-item"><a href="/Contribute/SubmitAPatch"><span>Submit a Patch</span></a></li><li id="n-Mailing-Lists" class="mw-list-item"><a href="/Contribute/MailingLists"><span>Mailing Lists</span></a></li><li id="n-Testing-QEMU" class="mw-list-item"><a href="/Testing"><span>Testing QEMU</span></a></li></ul> </div> </div> <div id="p-Learn" class="vector-menu mw-portlet mw-portlet-Learn vector-menu-portal portal" > <div id="p-Learn-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Learn</span> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="n-Documentation" class="mw-list-item"><a href="/Documentation"><span>Documentation</span></a></li><li id="n-Links" class="mw-list-item"><a href="/Links"><span>Links</span></a></li></ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb vector-menu-portal portal" > <div id="p-tb-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Tools</span> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="t-whatlinkshere" class="mw-list-item"><a href="/Special:WhatLinksHere/Documentation/Platforms/RISCV" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/Special:RecentChangesLinked/Documentation/Platforms/RISCV" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/index.php?title=Documentation/Platforms/RISCV&oldid=10741" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/index.php?title=Documentation/Platforms/RISCV&action=info" title="More information about this page"><span>Page information</span></a></li></ul> </div> </div> </nav> </div> </div> <div class="vector-sitenotice-container"> <div id="siteNotice"></div> </div> <input type="checkbox" id="vector-toc-collapsed-checkbox" class="mw-checkbox-hack-checkbox"> <div class="mw-table-of-contents-container"> <div class="vector-sticky-toc-container mw-sticky-header-element"> <nav id="mw-panel-toc" class="sidebar-toc" role="navigation" aria-labelledby="sidebar-toc-label" data-event-name="ui.sidebar-toc"> <div id="sidebar-toc-label" class="sidebar-toc-header"> <p class="sidebar-toc-title"> Contents <button class="vector-toc-uncollapse-button">move to sidebar</button> <button class="vector-toc-collapse-button">hide</button> </p> </div> <ul class="sidebar-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="sidebar-toc-list-item sidebar-toc-level-1"> <a href="#top-page" class="sidebar-toc-link"> <div class="sidebar-toc-text">Beginning</div> </a> </li> <li id="toc-Description" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#Description"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">1</span>Description</div> </a> <ul id="toc-Description-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Build_Directions" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#Build_Directions"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">2</span>Build Directions</div> </a> <ul id="toc-Build_Directions-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Booting_Linux" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#Booting_Linux"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">3</span>Booting Linux</div> </a> <button aria-controls="toc-Booting_Linux-sublist" class="mw-ui-icon mw-ui-icon-wikimedia-expand mw-ui-icon-small sidebar-toc-toggle"> Toggle Booting Linux subsection </button> <ul id="toc-Booting_Linux-sublist" class="sidebar-toc-list"> <li id="toc-Booting_64-bit_Debian" class="sidebar-toc-list-item sidebar-toc-level-2"> <a class="sidebar-toc-link" href="#Booting_64-bit_Debian"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">3.1</span>Booting 64-bit Debian</div> </a> <ul id="toc-Booting_64-bit_Debian-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Booting_64-bit_Fedora" class="sidebar-toc-list-item sidebar-toc-level-2"> <a class="sidebar-toc-link" href="#Booting_64-bit_Fedora"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">3.2</span>Booting 64-bit Fedora</div> </a> <ul id="toc-Booting_64-bit_Fedora-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Booting_32-bit_OpenEmbedded_Images" class="sidebar-toc-list-item sidebar-toc-level-2"> <a class="sidebar-toc-link" href="#Booting_32-bit_OpenEmbedded_Images"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">3.3</span>Booting 32-bit OpenEmbedded Images</div> </a> <ul id="toc-Booting_32-bit_OpenEmbedded_Images-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Booting_64-bit_OpenEmbedded_Images" class="sidebar-toc-list-item sidebar-toc-level-2"> <a class="sidebar-toc-link" href="#Booting_64-bit_OpenEmbedded_Images"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">3.4</span>Booting 64-bit OpenEmbedded Images</div> </a> <ul id="toc-Booting_64-bit_OpenEmbedded_Images-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Booting_32-bit_Buildroot_Images" class="sidebar-toc-list-item sidebar-toc-level-2"> <a class="sidebar-toc-link" href="#Booting_32-bit_Buildroot_Images"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">3.5</span>Booting 32-bit Buildroot Images</div> </a> <ul id="toc-Booting_32-bit_Buildroot_Images-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Booting_64-bit_Buildroot_Images" class="sidebar-toc-list-item sidebar-toc-level-2"> <a class="sidebar-toc-link" href="#Booting_64-bit_Buildroot_Images"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">3.6</span>Booting 64-bit Buildroot Images</div> </a> <ul id="toc-Booting_64-bit_Buildroot_Images-sublist" class="sidebar-toc-list"> </ul> </li> </ul> </li> <li id="toc-Microchip_PolarFire_SoC_Icicle_Kit" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#Microchip_PolarFire_SoC_Icicle_Kit"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">4</span>Microchip PolarFire SoC Icicle Kit</div> </a> <ul id="toc-Microchip_PolarFire_SoC_Icicle_Kit-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Attaching_GDB" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#Attaching_GDB"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">5</span>Attaching GDB</div> </a> <ul id="toc-Attaching_GDB-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-RISC-V_Foundation_Extensions" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#RISC-V_Foundation_Extensions"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">6</span>RISC-V Foundation Extensions</div> </a> <ul id="toc-RISC-V_Foundation_Extensions-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-RISC-V_Custom_Extensions/Instructions" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#RISC-V_Custom_Extensions/Instructions"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">7</span>RISC-V Custom Extensions/Instructions</div> </a> <ul id="toc-RISC-V_Custom_Extensions/Instructions-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Links" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#Links"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">8</span>Links</div> </a> <ul id="toc-Links-sublist" class="sidebar-toc-list"> </ul> </li> <li id="toc-Contacts" class="sidebar-toc-list-item sidebar-toc-level-1 sidebar-toc-list-item-expanded"> <a class="sidebar-toc-link" href="#Contacts"> <div class="sidebar-toc-text"> <span class="sidebar-toc-numb">9</span>Contacts</div> </a> <ul id="toc-Contacts-sublist" class="sidebar-toc-list"> </ul> </li> </ul> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body" role="main"> <a id="top"></a> <header class="mw-body-header"> <label id="vector-toc-collapsed-button" class="mw-ui-button mw-ui-quiet mw-ui-icon mw-ui-icon-element mw-ui-icon-wikimedia-listBullet mw-checkbox-hack-button" for="vector-toc-collapsed-checkbox" role="button" aria-controls="toc-toggle-list" data-event-name="vector.toc-toggle-list" tabindex="0" title="Table of Contents"> Toggle the table of contents </label> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Documentation/Platforms/RISCV</span></h1> </header> <nav class="vector-article-toolbar" aria-label="Tools" role="navigation"> <div class="mw-article-toolbar-container"> <div id="left-navigation"> <div id="p-associated-pages" class="vector-menu mw-portlet mw-portlet-associated-pages vector-menu-tabs" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="ca-nstab-main" class="selected mw-list-item"><a href="/Documentation/Platforms/RISCV" title="View the content page [c]" accesskey="c"><span>Page</span></a></li><li id="ca-talk" class="new mw-list-item"><a href="/index.php?title=Talk:Documentation/Platforms/RISCV&action=edit&redlink=1" rel="discussion" title="Discussion about the content page (page does not exist) [t]" accesskey="t"><span>Discussion</span></a></li></ul> </div> </div> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown" > <input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-menu-checkbox" aria-label="Change language variant" /> <label id="p-variants-label" for="p-variants-checkbox" class="vector-menu-heading " > <span class="vector-menu-heading-label">English</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"></ul> </div> </div> </div> <div id="right-navigation" class="vector-collapsible "> <div id="p-views" class="vector-menu mw-portlet mw-portlet-views vector-menu-tabs" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="ca-view" class="selected mw-list-item"><a href="/Documentation/Platforms/RISCV"><span>Read</span></a></li><li id="ca-viewsource" class="mw-list-item"><a href="/index.php?title=Documentation/Platforms/RISCV&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="mw-list-item"><a href="/index.php?title=Documentation/Platforms/RISCV&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li></ul> </div> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown vector-has-collapsible-items" title="More options" > <input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" /> <label id="p-cactions-label" for="p-cactions-checkbox" class="vector-menu-heading " > <span class="vector-menu-heading-label">More</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"><li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/Documentation/Platforms/RISCV"><span>Read</span></a></li><li id="ca-more-viewsource" class="vector-more-collapsible-item mw-list-item"><a href="/index.php?title=Documentation/Platforms/RISCV&action=edit"><span>View source</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/index.php?title=Documentation/Platforms/RISCV&action=history"><span>View history</span></a></li></ul> </div> </div> </div> </div> </nav> <div id="bodyContent" class="vector-body" data-mw-ve-target-container> <div class="mw-body-subheader"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">From QEMU</div> </div> <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-parser-output"><mw:tocplace></mw:tocplace> <h2><span class="mw-headline" id="Description">Description</span></h2> <p>RISC-V is an open source instruction set. It is a modular with only a small set of mandatory instructions. Every other module might be implemented by vendors allowing RISC-V to be suitable for small embedded systems up to large supercomputers. </p> <h2><span class="mw-headline" id="Build_Directions">Build Directions</span></h2> <p>For RV64: </p> <pre> ./configure --target-list=riscv64-softmmu && make </pre> <p>For RV32: </p> <pre> ./configure --target-list=riscv32-softmmu && make </pre> <h2><span class="mw-headline" id="Booting_Linux">Booting Linux</span></h2> <h3><span class="mw-headline" id="Booting_64-bit_Debian">Booting 64-bit Debian</span></h3> <p>Follow the instructions on the Debian wiki to boot Debian on QEMU: <a rel="nofollow" class="external free" href="https://wiki.debian.org/RISC-V">https://wiki.debian.org/RISC-V</a> </p> <h3><span class="mw-headline" id="Booting_64-bit_Fedora">Booting 64-bit Fedora</span></h3> <p>Download the Fedora prebuilt images from: <a rel="nofollow" class="external free" href="https://dl.fedoraproject.org/pub/alt/risc-v/repo/virt-builder-images/images/">https://dl.fedoraproject.org/pub/alt/risc-v/repo/virt-builder-images/images/</a> You will want to download Fedora-Minimal-Rawhide-*-fw_payload-uboot-qemu-virt-smode.elf and Fedora-Minimal-Rawhide-*-sda.raw.xz images </p><p>Decompress the rootFS: </p> <pre> unxz Fedora-Minimal-Rawhide-*-sda.raw.xz </pre> <p>Boot linux using RV64GC qemu: </p> <pre> qemu-system-riscv64 \ -nographic \ -machine virt \ -smp 4 \ -m 2G \ -kernel Fedora-Minimal-Rawhide-*-fw_payload-uboot-qemu-virt-smode.elf \ -bios none \ -object rng-random,filename=/dev/urandom,id=rng0 \ -device virtio-rng-device,rng=rng0 \ -device virtio-blk-device,drive=hd0 \ -drive file=Fedora-Minimal-Rawhide-20200108.n.0-sda.raw,format=raw,id=hd0 \ -device virtio-net-device,netdev=usernet \ -netdev user,id=usernet,hostfwd=tcp::10000-:22 </pre> <ul><li>Login: root</li> <li>Password: riscv</li></ul> <p>For more details on running Fedora see the Fedora Wiki: <a rel="nofollow" class="external free" href="https://fedoraproject.org/wiki/Architectures/RISC-V/Installing">https://fedoraproject.org/wiki/Architectures/RISC-V/Installing</a> </p> <h3><span class="mw-headline" id="Booting_32-bit_OpenEmbedded_Images">Booting 32-bit OpenEmbedded Images</span></h3> <p>Follow the usual OpenEmbedded build flow using meta-riscv to build for the qemuriscv32 machine. </p> <pre> MACHINE=qemuriscv32 bitbake core-image-minimal; runqemu qemuriscv32 </pre> <p>More details on doing this can be found here: <a rel="nofollow" class="external free" href="https://github.com/riscv/meta-riscv/#build-image">https://github.com/riscv/meta-riscv/#build-image</a> </p><p>When using OpenEmbedded it is recommended to use the runqemu script to boot QEMU. It will dynamically handle display options as well as advanced networking. </p> <h3><span class="mw-headline" id="Booting_64-bit_OpenEmbedded_Images">Booting 64-bit OpenEmbedded Images</span></h3> <p>Follow the usual OpenEmbedded build flow using meta-riscv to build for the qemuriscv64 machine. </p> <pre> MACHINE=qemuriscv64 bitbake core-image-minimal; runqemu qemuriscv64 </pre> <p>More details on doing this can be found here: <a rel="nofollow" class="external free" href="https://github.com/riscv/meta-riscv/#build-image">https://github.com/riscv/meta-riscv/#build-image</a> </p><p>When using OpenEmbedded it is recommended to use the runqemu script to boot QEMU. It will dynamically handle display options as well as advanced networking. </p> <h3><span class="mw-headline" id="Booting_32-bit_Buildroot_Images">Booting 32-bit Buildroot Images</span></h3> <p>Clone the Buildroot source code and cd into the directory. </p><p>Generate the default config: </p> <pre> make qemu_riscv32_virt_defconfig </pre> <p>Build the images </p> <pre> make </pre> <p>Boot the images: </p> <pre> qemu-system-riscv32 \ -M virt -nographic \ -bios output/images/fw_jump.elf \ -kernel output/images/Image \ -append "root=/dev/vda ro" \ -drive file=output/images/rootfs.ext2,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -netdev user,id=net0 -device virtio-net-device,netdev=net0 </pre> <h3><span class="mw-headline" id="Booting_64-bit_Buildroot_Images">Booting 64-bit Buildroot Images</span></h3> <p>Clone the Buildroot source code and cd into the directory. </p><p>Generate the default config: </p> <pre> make qemu_riscv64_virt_defconfig </pre> <p>Build the images </p> <pre> make </pre> <p>Boot the images: </p> <pre> qemu-system-riscv64 \ -M virt -nographic \ -bios output/images/fw_jump.elf \ -kernel output/images/Image \ -append "root=/dev/vda ro" \ -drive file=output/images/rootfs.ext2,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -netdev user,id=net0 -device virtio-net-device,netdev=net0 </pre> <h2><span class="mw-headline" id="Microchip_PolarFire_SoC_Icicle_Kit">Microchip PolarFire SoC Icicle Kit</span></h2> <p>QEMU 5.2.0 supports a new machine: Microchip PolarFire SoC Icicle Kit. The Icicle Kit board integrates a PolarFire SoC, with one SiFive's E51 plus four U54 cores and many on-chip peripherals and an FPGA. </p><p>For more details about Microchip PolarFire Soc, please see: <a rel="nofollow" class="external free" href="https://www.microsemi.com/product-directory/soc-fpgas/5498-polarfire-soc-fpga">https://www.microsemi.com/product-directory/soc-fpgas/5498-polarfire-soc-fpga</a> </p><p>The Icicle Kit board information can be found here: <a rel="nofollow" class="external free" href="https://www.microsemi.com/existing-parts/parts/152514">https://www.microsemi.com/existing-parts/parts/152514</a> </p><p>Boot the images: </p> <pre> qemu-system-riscv64 -M microchip-icicle-kit -smp 5 \ -bios path/to/hss.bin -sd path/to/sdcard.img \ -nic user,model=cadence_gem \ -nic tap,ifname=tap,model=cadence_gem,script=no \ -display none -serial stdio \ -chardev socket,id=serial1,path=serial1.sock,server,wait \ -serial chardev:serial1 </pre> <p>The BIOS image used by this machine is hss.bin, aka Hart Software Services, which can be built from: <a rel="nofollow" class="external free" href="https://github.com/polarfire-soc/hart-software-services">https://github.com/polarfire-soc/hart-software-services</a> </p><p>QEMU does not support eMMC hence the SD configuration shall be used in the HSS and Yocto BSP build. The eMMC configuration is not supported. </p><p>Instructions to build HSS: </p> <pre> $ cp boards/icicle-kit-es/def_config.sdcard .config $ make BOARD=icicle-kit-es </pre> <p>The following commit of HSS was tested: </p> <pre> commit 078ce16d8cb3a89e4c3e93916621b816dbdaa274 Merge: 76b34dd 2cd45c9 Author: Cyril-Jean <cyril.jean@microchip.com> Date: Fri Oct 9 17:07:12 2020 +0100 Merge pull request #7 from avpatel/custom_boot_flow_v1 Custom boot flow for PolarFire boards </pre> <p>For Yocto build, "MACHINE=icicle-kit-es-sd" should be specified, otherwise when booting Linux kernel the rootfs cannot be mounted. The generated image is something like: mpfs-dev-cli-icicle-kit-es-sd.rootfs.wic. Resize the file with 'qemu-image' to a power of 2 before passing to QEMU '-sd' command line. </p><p>The following commands download the official SD card image released by Microchip and prepare it for QEMU usage: </p> <pre> $ wget <a rel="nofollow" class="external free" href="ftp://ftpsoc.microsemi.com/outgoing/core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic.gz">ftp://ftpsoc.microsemi.com/outgoing/core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic.gz</a> $ gunzip core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic.gz $ qemu-img resize core-image-minimal-dev-icicle-kit-es-sd-20201009141623.rootfs.wic 4G </pre> <p>The memory is set to 1537 MiB by default which is the minimum required high memory size by HSS. A sanity check on ram size is performed in the machine init routine to prompt user to increase the RAM size to > 1537 MiB when less than 1537 MiB ram is detected. </p><p>HSS output is on the first serial port (stdio) and U-Boot/Linux outputs on the 2nd serial port. OpenSBI outputs on a random serial port due to the lottery mechanism used during the multi-core boot. </p> <h2><span class="mw-headline" id="Attaching_GDB">Attaching GDB</span></h2> <p>To attach GDB to a QEMU RISC-V instance with only a single cluster (every machine except the sifive_u) run these commands from GDB: </p> <pre> target extended-remote :1234 info threads </pre> <p>To attach GDB to a QEMU RISC-V instance with multiple clusters (the sifive_u) run these commands from GDB: </p> <pre> target extended-remote :1234 add-inferior inferior 2 attach 2 set schedule-multiple info threads </pre> <p>The above commands assume the default GDB port exposed from QEMU of 1234. This will happen when you run QEMU with the '-s' command line argument. </p><p>If you would like QEMU to not run the guest until you have connected GDB, you can specify the '-S' command line argument as well. </p> <h2><span class="mw-headline" id="RISC-V_Foundation_Extensions">RISC-V Foundation Extensions</span></h2> <p>As RISC-V has a range of possible extensions, QEMU has guidelines for supporting them all. </p><p>If an extension is frozen or ratified by the RISC-V foundation, it can be supported in QEMU. Generally we will try to support as many versions as feasible, following the usual QEMU deprecation policy to remove old versions. </p><p>If an official RISC-V foundation extension is in a reasonable draft state, that is not too many changes are still expected, it can be supported experimentally by QEMU. Experimental support means it must be disabled by default and marked with a "x-" in the CPU/board properties. Draft extensions should also include the version information in the property. Draft extensions can be enabled by specific CPUs or boards if the hardware supports that extension. </p><p>QEMU will only support the latest version of patches submitted for a draft extension. A draft extension can also be removed at any time and does not follow QEMU's deprecation policy. </p> <h2><span id="RISC-V_Custom_Extensions.2FInstructions"></span><span class="mw-headline" id="RISC-V_Custom_Extensions/Instructions">RISC-V Custom Extensions/Instructions</span></h2> <p>Support for custom instruction set extensions are an important part of RISC-V, with large encoding spaces reserved of vendor extensions. </p><p>QEMU follows similar rules to the RISC-V toolchain convention, as described here: <a rel="nofollow" class="external free" href="https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/17">https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/17</a> </p><p>QEMU will support vendor extensions. Vendor extensions must be disabled by default, but can be enabled for specific vendor CPUs and boards. The vendor extensions should use prefixes and names as described in <a rel="nofollow" class="external free" href="https://github.com/riscv-non-isa/riscv-toolchain-conventions">https://github.com/riscv-non-isa/riscv-toolchain-conventions</a> </p><p>Vendor extensions must be maintained and tested by the vendor. Upstream will take efforts to not break extensions, but testing and bug fixes should be done by the vendor. Patches to add support for open source toolchains are unlikely to be accepted without specification documents being made available publicly. </p><p>Vendor extensions can not interfere with other extensions and can not be obtrusive to the core RISC-V target code. </p><p>If you are looking to add support for vendor extensions, it is recommended that you get involved in the QEMU review process. It is also recommended that you send your patches as early as possible to get community feedback before they are fully implemented. This is especially important if you are modifying core code. </p> <h2><span class="mw-headline" id="Links">Links</span></h2> <ul><li><a rel="nofollow" class="external text" href="https://fedoraproject.org/wiki/Architectures/RISC-V">Fedora RISC-V wiki</a></li> <li><a rel="nofollow" class="external text" href="https://github.com/riscv/meta-riscv/">OpenEmbedded meta-riscv</a></li> <li><a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=b5g8u3GA-lo">Video: QEMU Support for the RISC-V Instruction Set Architecture</a></li></ul> <h2><span class="mw-headline" id="Contacts">Contacts</span></h2> <p>Maintainers: </p> <ul><li><a rel="nofollow" class="external text" href="mailto:palmer@sifive.com">Palmer Dabbelt</a></li> <li><a rel="nofollow" class="external text" href="mailto:alistair.francis@wdc.com">Alistair Francis</a></li></ul> <!-- NewPP limit report Cached time: 20241124094201 Cache expiry: 86400 Reduced expiry: false Complications: [show鈥恡oc] CPU time usage: 0.016 seconds Real time usage: 0.042 seconds Preprocessor visited node count: 44/1000000 Post鈥恊xpand include size: 0/2097152 bytes Template argument size: 0/2097152 bytes Highest expansion depth: 2/100 Expensive parser function count: 0/100 Unstrip recursion depth: 0/20 Unstrip post鈥恊xpand size: 0/5000000 bytes --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 0.000 1 -total --> <!-- Saved in parser cache with key qemu_mediawiki:pcache:idhash:1252-0!canonical and timestamp 20241124094201 and revision id 10741. --> </div> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://wiki.qemu.org/index.php?title=Documentation/Platforms/RISCV&oldid=10741">https://wiki.qemu.org/index.php?title=Documentation/Platforms/RISCV&oldid=10741</a>"</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" role="contentinfo" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 21 January 2022, at 03:02.</li> <li id="footer-info-copyright">Content is available under <a class="external" rel="nofollow" href="http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt">GNU Free Documentation License 1.2</a>.<br />QEMU is a trademark of Fabrice Bellard.<br /></li> </ul> <ul id="footer-places"> <li id="footer-places-about"><a href="/QEMU:About">About QEMU</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="http://www.gnu.org/licenses/old-licenses/fdl-1.2.txt"><img src="/resources/assets/licenses/gnu-fdl.png" alt="GNU Free Documentation License 1.2" width="88" height="31" loading="lazy"/></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/"><img src="/resources/assets/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" srcset="/resources/assets/poweredby_mediawiki_132x47.png 1.5x, /resources/assets/poweredby_mediawiki_176x62.png 2x" width="88" height="31" loading="lazy"/></a></li> </ul> </footer> </div> </div> </div> <script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.016","walltime":"0.042","ppvisitednodes":{"value":44,"limit":1000000},"postexpandincludesize":{"value":0,"limit":2097152},"templateargumentsize":{"value":0,"limit":2097152},"expansiondepth":{"value":2,"limit":100},"expensivefunctioncount":{"value":0,"limit":100},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":0,"limit":5000000},"timingprofile":["100.00% 0.000 1 -total"]},"cachereport":{"timestamp":"20241124094201","ttl":86400,"transientcontent":false}}});mw.config.set({"wgBackendResponseTime":149});});</script> </body> </html>