All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@csgraf.de>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Sergio Lopez <slp@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Cameron Esfahani <dirty@apple.com>,
	Roman Bolshakov <r.bolshakov@yadro.com>,
	qemu-arm <qemu-arm@nongnu.org>, Frank Yang <lfy@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Collingbourne <pcc@google.com>
Subject: Re: [PATCH v12 00/10] hvf: Implement Apple Silicon Support
Date: Mon, 20 Sep 2021 22:21:28 +0200	[thread overview]
Message-ID: <27a265d5-2e7c-f234-0d09-f40a731e588d@csgraf.de> (raw)
In-Reply-To: <d4859cae-d9c1-2879-0682-080d4b5efe90@amsat.org>


On 20.09.21 18:17, Philippe Mathieu-Daudé wrote:
> On 9/20/21 15:15, Peter Maydell wrote:
>> On Mon, 20 Sept 2021 at 11:11, Peter Maydell <peter.maydell@linaro.org> wrote:
>>> On Thu, 16 Sept 2021 at 16:54, Alexander Graf <agraf@csgraf.de> wrote:
>>>> 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:
>>>>
>>>>   - gdbstub debugging (breakpoints)
>>>>   - missing GICv3 support
>>>>   - Windows will not work due to UDEF SMC implementation
>>>>
>>>> To use hvf support, please make sure to run -M virt,highmem=off to fit
>>>> in M1's physical address space limits and use -cpu host.
>>> Applied to target-arm.next, thanks (with the unnecessary #include
>>> in patch 6 removed).
>> Turns out that the final patch breaks "make check-acceptance".
>> All the orangepi boot tests timeout:
>>
>>  (15/58) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi:
>> INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred:
>> Timeout reached\nOriginal status: ERROR\n{'name':
>> '15-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi',
>> 'logdir': '/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-clang/tests/...
>> (90.24 s)
>>  (16/58) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_initrd:
>> INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred:
>> Timeout reached\nOriginal status: ERROR\n{'name':
>> '16-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_initrd',
>> 'logdir': '/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-clang...
>> (90.24 s)
>>  (17/58) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd:
>> INTERRUPTED: Test interrupted by SIGTERM\nRunner error occurred:
>> Timeout reached\nOriginal status: ERROR\n{'name':
>> '17-tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd',
>> 'logdir': '/mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-clang/tes...
>> (90.24 s)
> Works for me on x86_64 Fedora 34 built with
> --enable-trace-backends=log --enable-debug:
>
> $ ./tests/venv/bin/avocado run
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_initrd
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_initrd
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic_20_08
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9
> Fetching asset from
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9
> JOB ID     : b19f151f7320def3a432255f3a99c0dde3da95c0
> JOB LOG    :
> /home/phil/avocado/job-results/job-2021-09-20T18.12-b19f151/job.log
>  (1/5)
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi:
> PASS (6.29 s)
>  (2/5)
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_initrd:
> PASS (51.23 s)
>  (3/5)
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_sd:
> PASS (76.53 s)
>  (4/5)
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_bionic_20_08:
> SKIP: storage limited
>  (5/5)
> tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_arm_orangepi_uboot_netbsd9:
> SKIP: storage limited
> RESULTS    : PASS 3 | ERROR 0 | FAIL 0 | SKIP 2 | WARN 0 | INTERRUPT 0 |
> CANCEL 0
> JOB TIME   : 135.18 s
>

The OrangePi kernel goes into an endless loop here:

 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/compressed/head.S?h=v5.10#n637

The reason is simple: It tries to install its own HYP code using the old
"install HYP handler, then invoke it" trick based on SPSR's indication
that HYP is available, but fails to do so because HYP calls get handled
by QEMU instead because the PSCI conduit is configured to HVC.

The patch below seems to fix it for me. Please advise how you want to
proceed.


Alex


diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c
index 27f1070145..f9b7ed1871 100644
--- a/hw/arm/allwinner-h3.c
+++ b/hw/arm/allwinner-h3.c
@@ -237,7 +237,7 @@ static void allwinner_h3_realize(DeviceState *dev,
Error **errp)

         /* Provide Power State Coordination Interface */
         qdev_prop_set_int32(DEVICE(&s->cpus[i]), "psci-conduit",
-                            QEMU_PSCI_CONDUIT_HVC);
+                            QEMU_PSCI_CONDUIT_SMC);

         /* Disable secondary CPUs */
         qdev_prop_set_bit(DEVICE(&s->cpus[i]), "start-powered-off",



  reply	other threads:[~2021-09-20 20:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 15:53 [PATCH v12 00/10] hvf: Implement Apple Silicon Support Alexander Graf
2021-09-16 15:53 ` [PATCH v12 01/10] arm: Move PMC register definitions to internals.h Alexander Graf
2021-09-16 15:53 ` [PATCH v12 02/10] hvf: Add execute to dirty log permission bitmap Alexander Graf
2021-09-16 15:53 ` [PATCH v12 03/10] hvf: Introduce hvf_arch_init() callback Alexander Graf
2021-09-16 15:53 ` [PATCH v12 04/10] hvf: Add Apple Silicon support Alexander Graf
2021-09-21 15:30   ` Peter Maydell
2021-09-21 17:05     ` Alexander Graf
2023-11-30 14:17   ` Philippe Mathieu-Daudé
2023-12-01  9:40     ` Alexander Graf
2021-09-16 15:53 ` [PATCH v12 05/10] arm/hvf: Add a WFI handler Alexander Graf
2021-09-16 15:54 ` [PATCH v12 06/10] hvf: arm: Implement -cpu host Alexander Graf
2021-09-16 16:08   ` Philippe Mathieu-Daudé
2021-09-20  9:19     ` Peter Maydell
2021-09-16 15:54 ` [PATCH v12 07/10] hvf: arm: Implement PSCI handling Alexander Graf
2021-09-16 15:54 ` [PATCH v12 08/10] arm: Add Hypervisor.framework build target Alexander Graf
2021-09-16 15:54 ` [PATCH v12 09/10] hvf: arm: Add rudimentary PMC support Alexander Graf
2021-09-16 15:54 ` [PATCH v12 10/10] arm: tcg: Adhere to SMCCC 1.3 section 5.2 Alexander Graf
2021-09-27 10:45   ` Peter Maydell
2021-09-20 10:11 ` [PATCH v12 00/10] hvf: Implement Apple Silicon Support Peter Maydell
2021-09-20 13:15   ` Peter Maydell
2021-09-20 16:17     ` Philippe Mathieu-Daudé
2021-09-20 20:21       ` Alexander Graf [this message]
2021-09-21  9:29         ` Philippe Mathieu-Daudé
2021-09-21 13:30           ` Alexander Graf
2021-09-25 17:22             ` Philippe Mathieu-Daudé
2021-09-25 18:09               ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27a265d5-2e7c-f234-0d09-f40a731e588d@csgraf.de \
    --to=agraf@csgraf.de \
    --cc=dirty@apple.com \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=lfy@google.com \
    --cc=pbonzini@redhat.com \
    --cc=pcc@google.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    --cc=richard.henderson@linaro.org \
    --cc=slp@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.