-
Notifications
You must be signed in to change notification settings - Fork 6
Add RISC-V support #29
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,37 @@ def generate(self) -> str: | |
| ) | ||
|
|
||
|
|
||
| class RISCV64ArchitectureConfiguration(ArchitectureConfiguration): | ||
| qemu = "qemu-system-riscv64" | ||
| arch = "riscv64" | ||
| model = "virt" | ||
|
|
||
| def __init__(self, kvm=True, uefi=True, model="virt") -> None: | ||
| self.kvm = kvm | ||
| self.uefi = uefi | ||
| self.model = model | ||
|
|
||
| def generate(self) -> str: | ||
| return """ | ||
| <os> | ||
| <type arch='{arch}' machine='{model}'>hvm</type> | ||
| {uefi_loader} | ||
| <boot dev='hd'/> | ||
| </os> | ||
| {cpu} | ||
| <memballoon model='virtio'></memballoon> | ||
| """.format( | ||
| arch=self.arch, | ||
| model=self.model, | ||
| uefi_loader="<loader readonly='yes' type='pflash'>/usr/share/edk2/riscv/RISCV_VIRT_CODE.qcow2</loader>", | ||
| cpu=( | ||
| "<cpu mode='host-passthrough' check='none'/>" | ||
| if self.kvm | ||
| else "<cpu mode='custom' match='exact'><model>rva23s64</model></cpu>" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to be more conservative here? e.g. use rather
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I'd prefer to keep rva23s64 for now. My primary use case is testing openruyi RISC-V images, which need at least RVA23. Since rva23s64 is a superset of rv64, it should remain backwards compatible so it won't cause issues for other use cases. |
||
| ), | ||
| ) | ||
|
|
||
|
|
||
| def storage_device_name_generator(): | ||
| prefix = "vd" | ||
| for i in range(26): | ||
|
|
@@ -529,6 +560,8 @@ def _get_default_domain_conf( | |
| domain_configuration.system_architecture = Ppc64leArchitectureConfiguration(kvm=kvm, uefi=False, model="pseries") | ||
| elif desired_arch == "s390x": | ||
| domain_configuration.system_architecture = S390xArchitectureConfiguration(kvm=kvm, uefi=False, model="s390-ccw-virtio") | ||
| elif desired_arch == "riscv64": | ||
| domain_configuration.system_architecture = RISCV64ArchitectureConfiguration(kvm=kvm, uefi=True, model="virt") | ||
| else: | ||
| raise TestcloudInstanceError("Unsupported arch") | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.