qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 14/14] tests/boot-serial-test: Add support for t


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 14/14] tests/boot-serial-test: Add support for the aarch64 virt machine
Date: Thu, 8 Feb 2018 16:44:57 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 02/08/2018 02:09 PM, Thomas Huth wrote:
From: Wei Huang <address@hidden>

This patch adds a small binary kernel to test aarch64 virt machine's
UART.

Signed-off-by: Wei Huang <address@hidden>
[thuth: Fixed contextual conflict with the hppa patch]
Signed-off-by: Thomas Huth <address@hidden>
---
  tests/Makefile.include   | 1 +
  tests/boot-serial-test.c | 9 +++++++++
  2 files changed, 10 insertions(+)


+++ b/tests/boot-serial-test.c
@@ -55,6 +55,13 @@ static const uint8_t bios_raspi2[] = {
      0x00, 0x10, 0x20, 0x3f,                 /* 0x3f201000 = UART0 base addr */
  };
+static const uint8_t kernel_aarch64[] = {
+    0x81, 0x0a, 0x80, 0x52,                 /* mov     w1, #0x54 */
+    0x02, 0x20, 0xa1, 0xd2,                 /* mov     x2, #0x9000000 */
+    0x41, 0x00, 0x00, 0x39,                 /* strb    w1, [x2] */
+    0xfd, 0xff, 0xff, 0x17,                 /* b       -12 (loop) */
+};

Code like this reminds me of the 1984 IOCCC winner (https://www.ioccc.org/1984/mullender/mullender.c) - there's just something strangely satisfying about an array of integers being compiled into executable code ;)

Reviewed-by: Eric Blake <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]