Bug 1132 - Build qemu without **GUEST** vsx (***GUEST*** is SFFS only)
Summary: Build qemu without **GUEST** vsx (***GUEST*** is SFFS only)
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Milestones (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Sadoon Albader
URL: https://libre-soc.org/SFFS/qemu/
Depends on:
Blocks:
 
Reported: 2023-08-02 20:47 BST by Toshaan Bharvani
Modified: 2024-03-10 06:58 GMT (History)
4 users (show)

See Also:
NLnet milestone: NLnet.2022-08-107.ongoing
total budget (EUR) for completion of task and all subtasks: 2500
budget (EUR) for this task, excluding subtasks' budget: 2500
parent task for budget allocation: 999
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:
sadoon={amount=1500, submitted=2024-02-26, paid=2024-03-08} lkcl = {amount=1000, submitted=2024-02-26, paid=2024-03-08}


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toshaan Bharvani 2023-08-02 20:47:51 BST
QEMU is a piece of software that would be extremely valuable to us at libre-soc because it provides a way to test that any given software or full OS image is fully SFFS compliant by emulating a chip that in itself is SFFS compliant. However, QEMU has no such chip to emulate and the closest thing is POWER7 in little endian mode, which lacks VSX but also lacks the v3.0 ISA and is unusable for our purposes.
Comment 1 Luke Kenneth Casson Leighton 2023-08-04 17:08:49 BST
qemu needs to be modifed so that the **GUEST** operating system has
no VSX or other non-SFFS instructions.

***NOT*** repeat ***NOT*** "the host qemu binary is compiled for SFFS".
Comment 2 Sadoon Albader 2023-08-24 14:59:13 BST
Will write up a full wiki page documenting everything we have tried with QEMU, how and where it failed, and what steps we can take for the future to make it work.
Comment 3 Sadoon Albader 2023-08-25 14:54:17 BST
Attempts were made to patch a new chip into QEMU but given the many assumptions that any LE chip is supposed to have at least AltiVec and VSX, it proved to be a nontrivial task, and only research was conducted on how and whether this can be done at all.

The final solution is to add something similar to x86(_64) in the CPU features flags, where they use "-sse,-avx" to disable SSE and AVX respectively, and apply those to POWER since the features flags are completely missing from POWER chips. In other words, the code is there to add features flags but needs a considerable amount of patching to the TCG emulator and/or KVM implementation for it to work.
Comment 4 Sadoon Albader 2023-08-25 14:54:40 BST
Wiki page is up: https://libre-soc.org/SFFS/qemu
Comment 5 Luke Kenneth Casson Leighton 2023-08-25 15:24:14 BST
(In reply to Sadoon Albader from comment #4)
> Wiki page is up: https://libre-soc.org/SFFS/qemu

awesome i have linked it as the URL, and will crossreference it
shortly. also i mentioned what Toshaan said in the earlier
conversation, that the reason compiling for POWER7 failed is because
that is v2.07 and some v2.07 instructions are deprecated in
v3.0

https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=170518402a98b9d119974cfa89be33265db98250
Comment 6 Luke Kenneth Casson Leighton 2023-08-25 15:29:19 BST
formatted to 80 chars per line, removed absolute URL (use wiki links),
cross-ref to bugtracker was already added (awesome)

https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=5daf8c95