[PATCH v3 00/10] hvf: Implement Apple Silicon Support

Alexander Graf posted 10 patches 3 years, 3 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201202190408.2041-1-agraf@csgraf.de
Maintainers: Roman Bolshakov <r.bolshakov@yadro.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Cameron Esfahani <dirty@apple.com>, Richard Henderson <richard.henderson@linaro.org>, Alexander Graf <agraf@csgraf.de>, Peter Maydell <peter.maydell@linaro.org>, Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
MAINTAINERS                  |  14 +-
accel/hvf/entitlements.plist |   8 +
accel/hvf/hvf-all.c          |  56 +++
accel/hvf/hvf-cpus.c         | 481 ++++++++++++++++++++
accel/hvf/meson.build        |   7 +
accel/meson.build            |   1 +
include/hw/core/cpu.h        |   3 +-
include/sysemu/hvf.h         |   2 +
include/sysemu/hvf_int.h     |  77 ++++
meson.build                  |  41 +-
scripts/entitlement.sh       |  13 +
target/arm/arm-powerctl.c    |   1 +
target/arm/cpu.c             |  15 +-
target/arm/cpu.h             |   2 +
target/arm/hvf/hvf.c         | 857 +++++++++++++++++++++++++++++++++++
target/arm/hvf/meson.build   |   3 +
target/arm/kvm_arm.h         |   2 -
target/arm/meson.build       |   2 +
target/i386/hvf/hvf-cpus.c   | 131 ------
target/i386/hvf/hvf-cpus.h   |  25 -
target/i386/hvf/hvf-i386.h   |  48 +-
target/i386/hvf/hvf.c        | 462 +++----------------
target/i386/hvf/meson.build  |   1 -
target/i386/hvf/vmx.h        |  24 +-
target/i386/hvf/x86.c        |  28 +-
target/i386/hvf/x86_descr.c  |  26 +-
target/i386/hvf/x86_emu.c    |  62 +--
target/i386/hvf/x86_mmu.c    |   4 +-
target/i386/hvf/x86_task.c   |  12 +-
target/i386/hvf/x86hvf.c     | 221 ++++-----
target/i386/hvf/x86hvf.h     |   2 -
31 files changed, 1818 insertions(+), 813 deletions(-)
create mode 100644 accel/hvf/entitlements.plist
create mode 100644 accel/hvf/hvf-all.c
create mode 100644 accel/hvf/hvf-cpus.c
create mode 100644 accel/hvf/meson.build
create mode 100644 include/sysemu/hvf_int.h
create mode 100755 scripts/entitlement.sh
create mode 100644 target/arm/hvf/hvf.c
create mode 100644 target/arm/hvf/meson.build
delete mode 100644 target/i386/hvf/hvf-cpus.c
delete mode 100644 target/i386/hvf/hvf-cpus.h
[PATCH v3 00/10] hvf: Implement Apple Silicon Support
Posted by Alexander Graf 3 years, 3 months ago
Now that Apple Silicon is widely available, people are obviously excited
to try and run virtualized workloads on them, such as Linux and Windows.

This patch set implements a fully functional version to get the ball
going on that. With this applied, I can successfully run both Linux and
Windows as guests. I am not aware of any limitations specific to
Hypervisor.framework apart from:

  - Live migration / savevm
  - gdbstub debugging (SP register)


Enjoy!

Alex

v1 -> v2:

  - New patch: hvf: Actually set SIG_IPI mask
  - New patch: hvf: Introduce hvf vcpu struct
  - New patch: hvf: arm: Mark CPU as dirty on reset
  - Removed patch: hw/arm/virt: Disable highmem when on hypervisor.framework
  - Removed patch: arm: Synchronize CPU on PSCI on
  - Fix build on 32bit arm
  - Merge vcpu kick function patch into ARM enablement
  - Implement WFI handling (allows vCPUs to sleep)
  - Synchronize system registers (fixes OVMF crashes and reboot)
  - Don't always call cpu_synchronize_state()
  - Use more fine grained iothread locking
  - Populate aa64mmfr0 from hardware
  - Make safe to ctrl-C entitlement application

v2 -> v3:

  - Removed patch: hvf: Actually set SIG_IPI mask
  - New patch: hvf: arm: Add support for GICv3
  - New patch: hvf: arm: Implement -cpu host
  - Advance PC on SMC
  - Use cp list interface for sysreg syncs
  - Do not set current_cpu
  - Fix sysreg isread mask
  - Move sysreg handling to functions
  - Remove WFI logic again
  - Revert to global iothread locking

Alexander Graf (9):
  hvf: Add hypervisor entitlement to output binaries
  hvf: Move common code out
  hvf: Introduce hvf vcpu struct
  arm: Set PSCI to 0.2 for HVF
  hvf: arm: Mark CPU as dirty on reset
  hvf: Add Apple Silicon support
  arm: Add Hypervisor.framework build target
  hvf: arm: Add support for GICv3
  hvf: arm: Implement -cpu host

Peter Collingbourne (1):
  arm/hvf: Add a WFI handler

 MAINTAINERS                  |  14 +-
 accel/hvf/entitlements.plist |   8 +
 accel/hvf/hvf-all.c          |  56 +++
 accel/hvf/hvf-cpus.c         | 481 ++++++++++++++++++++
 accel/hvf/meson.build        |   7 +
 accel/meson.build            |   1 +
 include/hw/core/cpu.h        |   3 +-
 include/sysemu/hvf.h         |   2 +
 include/sysemu/hvf_int.h     |  77 ++++
 meson.build                  |  41 +-
 scripts/entitlement.sh       |  13 +
 target/arm/arm-powerctl.c    |   1 +
 target/arm/cpu.c             |  15 +-
 target/arm/cpu.h             |   2 +
 target/arm/hvf/hvf.c         | 857 +++++++++++++++++++++++++++++++++++
 target/arm/hvf/meson.build   |   3 +
 target/arm/kvm_arm.h         |   2 -
 target/arm/meson.build       |   2 +
 target/i386/hvf/hvf-cpus.c   | 131 ------
 target/i386/hvf/hvf-cpus.h   |  25 -
 target/i386/hvf/hvf-i386.h   |  48 +-
 target/i386/hvf/hvf.c        | 462 +++----------------
 target/i386/hvf/meson.build  |   1 -
 target/i386/hvf/vmx.h        |  24 +-
 target/i386/hvf/x86.c        |  28 +-
 target/i386/hvf/x86_descr.c  |  26 +-
 target/i386/hvf/x86_emu.c    |  62 +--
 target/i386/hvf/x86_mmu.c    |   4 +-
 target/i386/hvf/x86_task.c   |  12 +-
 target/i386/hvf/x86hvf.c     | 221 ++++-----
 target/i386/hvf/x86hvf.h     |   2 -
 31 files changed, 1818 insertions(+), 813 deletions(-)
 create mode 100644 accel/hvf/entitlements.plist
 create mode 100644 accel/hvf/hvf-all.c
 create mode 100644 accel/hvf/hvf-cpus.c
 create mode 100644 accel/hvf/meson.build
 create mode 100644 include/sysemu/hvf_int.h
 create mode 100755 scripts/entitlement.sh
 create mode 100644 target/arm/hvf/hvf.c
 create mode 100644 target/arm/hvf/meson.build
 delete mode 100644 target/i386/hvf/hvf-cpus.c
 delete mode 100644 target/i386/hvf/hvf-cpus.h

-- 
2.24.3 (Apple Git-128)


Re: [PATCH v3 00/10] hvf: Implement Apple Silicon Support
Posted by no-reply@patchew.org 3 years, 3 months ago
Patchew URL: https://patchew.org/QEMU/20201202190408.2041-1-agraf@csgraf.de/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20201202190408.2041-1-agraf@csgraf.de
Subject: [PATCH v3 00/10] hvf: Implement Apple Silicon Support

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20201202190408.2041-1-agraf@csgraf.de -> patchew/20201202190408.2041-1-agraf@csgraf.de
Switched to a new branch 'test'
4d827f3 hvf: arm: Implement -cpu host
bde0110 hvf: arm: Add support for GICv3
5c824d7 arm/hvf: Add a WFI handler
68f28c6 arm: Add Hypervisor.framework build target
ae48800 hvf: Add Apple Silicon support
ced03a5 hvf: arm: Mark CPU as dirty on reset
9830bf6 arm: Set PSCI to 0.2 for HVF
b2218df hvf: Introduce hvf vcpu struct
0d5f075 hvf: Move common code out
6ae373a hvf: Add hypervisor entitlement to output binaries

=== OUTPUT BEGIN ===
1/10 Checking commit 6ae373af35d9 (hvf: Add hypervisor entitlement to output binaries)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#16: 
new file mode 100644

total: 0 errors, 1 warnings, 63 lines checked

Patch 1/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/10 Checking commit 0d5f07559d56 (hvf: Move common code out)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#38: 
new file mode 100644

total: 0 errors, 1 warnings, 1088 lines checked

Patch 2/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/10 Checking commit b2218df9dabc (hvf: Introduce hvf vcpu struct)
WARNING: line over 80 characters
#138: FILE: target/i386/hvf/hvf.c:213:
+    wvmcs(cpu->hvf->fd, VMCS_ENTRY_CTLS, cap2ctrl(hvf_state->hvf_caps->vmx_cap_entry,

ERROR: "(foo*)" should be "(foo *)"
#746: FILE: target/i386/hvf/x86hvf.c:85:
+    if (hv_vcpu_write_fpstate(cpu_state->hvf->fd, (void*)xsave, 4096)) {

ERROR: "(foo*)" should be "(foo *)"
#827: FILE: target/i386/hvf/x86hvf.c:167:
+    if (hv_vcpu_read_fpstate(cpu_state->hvf->fd, (void*)xsave, 4096)) {

total: 2 errors, 1 warnings, 996 lines checked

Patch 3/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

4/10 Checking commit 9830bf633313 (arm: Set PSCI to 0.2 for HVF)
5/10 Checking commit ced03a5fa1eb (hvf: arm: Mark CPU as dirty on reset)
6/10 Checking commit ae4880007b12 (hvf: Add Apple Silicon support)
WARNING: architecture specific defines should be avoided
#47: FILE: accel/hvf/hvf-cpus.c:63:
+#ifdef __aarch64__

WARNING: architecture specific defines should be avoided
#58: FILE: accel/hvf/hvf-cpus.c:350:
+#ifdef __aarch64__

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#111: 
new file mode 100644

WARNING: line over 80 characters
#575: FILE: target/arm/hvf/hvf.c:460:
+        hv_vcpu_set_pending_interrupt(cpu->hvf->fd, HV_INTERRUPT_TYPE_FIQ, true);

WARNING: line over 80 characters
#580: FILE: target/arm/hvf/hvf.c:465:
+        hv_vcpu_set_pending_interrupt(cpu->hvf->fd, HV_INTERRUPT_TYPE_IRQ, true);

total: 0 errors, 5 warnings, 688 lines checked

Patch 6/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
7/10 Checking commit 68f28c62f682 (arm: Add Hypervisor.framework build target)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#47: 
new file mode 100644

total: 0 errors, 1 warnings, 36 lines checked

Patch 7/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
8/10 Checking commit 5c824d7a4a5e (arm/hvf: Add a WFI handler)
9/10 Checking commit bde0110d9163 (hvf: arm: Add support for GICv3)
10/10 Checking commit 4d827f39b205 (hvf: arm: Implement -cpu host)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201202190408.2041-1-agraf@csgraf.de/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com