Skip to content

Commit

Permalink
Fix #60: VMs running via QEMU only expose SSE and SSE2 CPU features
Browse files Browse the repository at this point in the history
This changes the machine to `q35` and the CPU to `max`, for x86-64.
  • Loading branch information
jacob-carlborg committed Aug 17, 2023
1 parent 476a1a8 commit c4e0256
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 13 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,23 @@ jobs:
version: '7.3'
image_url: https://github.com/cross-platform-actions/test-custom-image-builder/releases/download/v1.0.0/openbsd-7.3-x86-64.qcow2
run: test -f /foo

test-cpu-features:
timeout-minutes: 5
name: Test CPU features
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Test
uses: ./
with:
operating_system: freebsd
architecture: x86-64
version: '13.2'
hypervisor: qemu
run: dmesg | grep -i avx2
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- VMs running via QEMU only expose SSE and SSE2 CPU features ([#60](https://github.com/cross-platform-actions/action/issues/60)).
This changes the machine to `q35` and the cpu to `max`, for x86-64 using
the QEMU hypervisor. This adds more CPU features like AVX and AVX2.

## [0.18.0] - 2023-08-04
### Added
Expand Down
6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions spec/operating_systems/freebsd/freebsd.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ describe('FreeBSD OperatingSystem', () => {
{
...config,
ssHostPort: 2847,
cpu: 'qemu64',
cpu: 'max',
accelerator: Accelerator.tcg,
machineType: 'pc',
machineType: 'q35',
uuid: '864ED7F0-7876-4AA7-8511-816FABCFA87F',
firmware: `${firmwareDirectory}/share/qemu/bios-256k.bin`
}
Expand Down
8 changes: 4 additions & 4 deletions spec/operating_systems/netbsd/netbsd.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ describe('NetBSD OperatingSystem', () => {
{
...config,
ssHostPort: 2847,
cpu: 'qemu64',
cpu: 'max',
accelerator: Accelerator.tcg,
machineType: 'pc',
machineType: 'q35',
uuid: '864ED7F0-7876-4AA7-8511-816FABCFA87F',
firmware: `${firmwareDirectory}/share/qemu/bios-256k.bin`
}
Expand Down Expand Up @@ -151,9 +151,9 @@ describe('NetBSD OperatingSystem', () => {
{
...config,
ssHostPort: 2847,
cpu: 'host',
cpu: 'max',
accelerator: Accelerator.hvf,
machineType: 'pc',
machineType: 'q35',
uuid: '864ED7F0-7876-4AA7-8511-816FABCFA87F',
firmware: `${firmwareDirectory}/share/qemu/bios-256k.bin`
}
Expand Down
2 changes: 1 addition & 1 deletion src/architecture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export abstract class Architecture {
}

override get machineType(): string {
return 'pc'
return 'q35'
}

override get accelerator(): vm.Accelerator {
Expand Down
4 changes: 2 additions & 2 deletions src/host_qemu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default abstract class HostQemu {
}

override get cpu(): string {
return 'qemu64'
return 'max'
}
}

Expand All @@ -21,7 +21,7 @@ export default abstract class HostQemu {
}

override get cpu(): string {
return 'host'
return 'max'
}
}
}

0 comments on commit c4e0256

Please sign in to comment.