From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A3C2C7EE24 for ; Fri, 2 Jun 2023 09:28:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2BACA862CB; Fri, 2 Jun 2023 11:28:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=etri.re.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dooray.com header.i=@dooray.com header.b="FMtvOpN6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D5AF862FA; Fri, 2 Jun 2023 11:28:22 +0200 (CEST) Received: from mscreen.etri.re.kr (mscreen.etri.re.kr [129.254.9.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C5AD3860A6 for ; Fri, 2 Jun 2023 11:28:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=etri.re.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ckim@etri.re.kr Received: from unknown (HELO send002-relay.gov-dooray.com) (211.180.235.153) by 129.254.9.16 with ESMTP; 2 Jun 2023 18:28:11 +0900 X-Original-SENDERIP: 211.180.235.153 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: u-boot@lists.denx.de Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send002-relay.gov-dooray.com with SMTP id 736a59886479b62b; Fri, 02 Jun 2023 18:28:11 +0900 DKIM-Signature: a=rsa-sha256; b=FMtvOpN6yKluVNzPsi2H7WIBzzwpuea2SLUUxZBc64RMXcbyuMMY+YZy4GGPVriEOhOeU1e3GT tKteoFSfxkrXOlT73kkgoEqO9zO8oZkFNrw0TMXNUa4mlYDpoYm+P5K4B4K5VZfhFBiUMeA31cza QRy9YngS8HJQNy+pBmmjojPaV7mqy6hUgJt6plnJ1hEm4jZG78gY7/hP/F6XEmPTrvaFoySz4GNX KnSiNF3FDNrRmpyq3Cc48jN8Ei4bzMkkEQUW174db3AfawlHzFrUQ0dpAXPlAWs4oeQl0qLE1SEJ pPNWfxvLBpVa7eVa9tTzFkwwFNAJ1rC2tv/uSjnQ==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=08qw6VwzDNpHPraZhooLd99omkxu/ADXpMsfR7WOH6M=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id 89cd84406479b62a; Fri, 02 Jun 2023 18:28:10 +0900 From: "Chan Kim" To: "U-Boot Mailing List" , , Subject: Running u-boot and linux on qemu arm64 virt machine, linux shell does not respond.. Date: Fri, 2 Jun 2023 18:28:10 +0900 Message-ID: <02f001d99534$8c164cd0$a442e670$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdmVNH6yOfaD8OaLTXWHyFjHR7m/sA== Content-Language: ko Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.39 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hello all, I'm trying to run u-boot and linux on qemu arm64 virt machine preferably without changing any source code. (u-boot v2022.07, linux 5.15.68, qemu 6.2.0, busybox 1.32.1) I have built u-boot using qemu_arm64_defconfig and I got u-boot(elf) and u-boot.bin. I built linux using defconfig but later I removed many CONFIG_* to reduce compile time and got Image(binary). Also, I built busybox and made ramdisk. Now this is the qemu command I used. (I referenced u-boot's include/configs/qemu-arm.h to determine the load addresses, set CONFIG_BOOTCOMMAND=" booti 0x40400000 0x44000000 0x40000000") ../temp/qemu-6.2.0/build/aarch64-softmmu/qemu-system-aarch64 -machine virt,gic-version=max,secure=on,virtualization=true -cpu max -m 4G -nographic -bios u-boot/u-boot.bin -device loader,file=../temp/linux-5.15.68/arch/arm64/boot/Image,addr=0x40400000 -device loader,file=initrd.img,addr=0x44000000 u-boot runs and automatically boots linunx and it boots OK to the shell prompt. But at the linux shell prompt, it doesn't respond to my keyboard input. It looks like the symptom I saw last year when system counter is not working(for real board only). (I added system counter device in our qemu virtual machine just to not cause panic during the system counter access with the same driver. The qemu machine for our board runs ok using u-boot-spl and linux after booting including shell program and simple driver test. I'm trying to use u-boot proper now). Also last year I had to power-on the GICR(for virtual machine and real board). So I tried adding the code to power up GICR but it is the same. (this part is missing in u-boot, but I saw it is in the arm-tf S/W). For your reference this is the change in u-boot's arch/arm/lib/gic_64.S. /* x9: ReDistributor Base Address of Current CPU */ 2: mov w10, #~0x2 ldr w11, [x9, GICR_WAKER] and w11, w11, w10 /* Clear ProcessorSleep */ str w11, [x9, GICR_WAKER] dsb st isb ==> /* x9: ReDistributor Base Address of Current CPU */ 2: // gicr power on, ckim mov w10, 2 str w10, [x9, GICR_PWRR] 5: ldr w10, [x9, GICR_PWRR] tbnz w10, #1, 5b /* Wait Children be Alive */ mov w10, #~0x2 ldr w11, [x9, GICR_WAKER] and w11, w11, w10 /* Clear ProcessorSleep */ str w11, [x9, GICR_WAKER] dsb st isb Can anyone suggest what I can try to solve this problem? (I mean, the problem of linux shell not responding in qemu virtual machine) I would appreciate it for any comment or help. Thank you. Chan Kim From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE5CBC7EE29 for ; Fri, 2 Jun 2023 09:29:06 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1q515D-0007bR-22; Fri, 02 Jun 2023 05:28:31 -0400 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (Exim 4.96) (envelope-from ) id 1q5159-0007b8-2A for kernelnewbies@kernelnewbies.org; Fri, 02 Jun 2023 05:28:29 -0400 Received: from unknown (HELO send001-relay.gov-dooray.com) (211.180.235.152) by 129.254.9.16 with ESMTP; 2 Jun 2023 18:28:11 +0900 X-Original-SENDERIP: 211.180.235.152 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send001-relay.gov-dooray.com with SMTP id 1ba5f26c6479b62b; Fri, 02 Jun 2023 18:28:11 +0900 DKIM-Signature: a=rsa-sha256; b=FMtvOpN6yKluVNzPsi2H7WIBzzwpuea2SLUUxZBc64RMXcbyuMMY+YZy4GGPVriEOhOeU1e3GT tKteoFSfxkrXOlT73kkgoEqO9zO8oZkFNrw0TMXNUa4mlYDpoYm+P5K4B4K5VZfhFBiUMeA31cza QRy9YngS8HJQNy+pBmmjojPaV7mqy6hUgJt6plnJ1hEm4jZG78gY7/hP/F6XEmPTrvaFoySz4GNX KnSiNF3FDNrRmpyq3Cc48jN8Ei4bzMkkEQUW174db3AfawlHzFrUQ0dpAXPlAWs4oeQl0qLE1SEJ pPNWfxvLBpVa7eVa9tTzFkwwFNAJ1rC2tv/uSjnQ==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=08qw6VwzDNpHPraZhooLd99omkxu/ADXpMsfR7WOH6M=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id 89cd84406479b62a; Fri, 02 Jun 2023 18:28:10 +0900 From: "Chan Kim" To: "U-Boot Mailing List" , , Subject: Running u-boot and linux on qemu arm64 virt machine, linux shell does not respond.. Date: Fri, 2 Jun 2023 18:28:10 +0900 Message-ID: <02f001d99534$8c164cd0$a442e670$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdmVNH6yOfaD8OaLTXWHyFjHR7m/sA== Content-Language: ko X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3436964334834003423==" Errors-To: kernelnewbies-bounces@kernelnewbies.org This is a multipart message in MIME format. --===============3436964334834003423== Content-Type: multipart/alternative; boundary="----=_NextPart_000_02F1_01D9957F.FBFF0640" Content-Language: ko This is a multipart message in MIME format. ------=_NextPart_000_02F1_01D9957F.FBFF0640 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello all, I'm trying to run u-boot and linux on qemu arm64 virt machine preferably without changing any source code. (u-boot v2022.07, linux 5.15.68, qemu 6.2.0, busybox 1.32.1) I have built u-boot using qemu_arm64_defconfig and I got u-boot(elf) and u-boot.bin. I built linux using defconfig but later I removed many CONFIG_* to reduce compile time and got Image(binary). Also, I built busybox and made ramdisk. Now this is the qemu command I used. (I referenced u-boot's include/configs/qemu-arm.h to determine the load addresses, set CONFIG_BOOTCOMMAND=" booti 0x40400000 0x44000000 0x40000000") ../temp/qemu-6.2.0/build/aarch64-softmmu/qemu-system-aarch64 -machine virt,gic-version=max,secure=on,virtualization=true -cpu max -m 4G -nographic -bios u-boot/u-boot.bin -device loader,file=../temp/linux-5.15.68/arch/arm64/boot/Image,addr=0x40400000 -device loader,file=initrd.img,addr=0x44000000 u-boot runs and automatically boots linunx and it boots OK to the shell prompt. But at the linux shell prompt, it doesn't respond to my keyboard input. It looks like the symptom I saw last year when system counter is not working(for real board only). (I added system counter device in our qemu virtual machine just to not cause panic during the system counter access with the same driver. The qemu machine for our board runs ok using u-boot-spl and linux after booting including shell program and simple driver test. I'm trying to use u-boot proper now). Also last year I had to power-on the GICR(for virtual machine and real board). So I tried adding the code to power up GICR but it is the same. (this part is missing in u-boot, but I saw it is in the arm-tf S/W). For your reference this is the change in u-boot's arch/arm/lib/gic_64.S. /* x9: ReDistributor Base Address of Current CPU */ 2: mov w10, #~0x2 ldr w11, [x9, GICR_WAKER] and w11, w11, w10 /* Clear ProcessorSleep */ str w11, [x9, GICR_WAKER] dsb st isb ==> /* x9: ReDistributor Base Address of Current CPU */ 2: // gicr power on, ckim mov w10, 2 str w10, [x9, GICR_PWRR] 5: ldr w10, [x9, GICR_PWRR] tbnz w10, #1, 5b /* Wait Children be Alive */ mov w10, #~0x2 ldr w11, [x9, GICR_WAKER] and w11, w11, w10 /* Clear ProcessorSleep */ str w11, [x9, GICR_WAKER] dsb st isb Can anyone suggest what I can try to solve this problem? (I mean, the problem of linux shell not responding in qemu virtual machine) I would appreciate it for any comment or help. Thank you. Chan Kim ------=_NextPart_000_02F1_01D9957F.FBFF0640 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello = all,

 

I'm trying to run u-boot and linux on qemu arm64 virt = machine preferably without changing any source = code.

(u-boot v2022.07, linux 5.15.68, qemu 6.2.0, busybox = 1.32.1)

I have built u-boot using qemu_arm64_defconfig and I got = u-boot(elf) and u-boot.bin.

I built linux using defconfig = but later I removed many CONFIG_* to reduce compile time and got = Image(binary).

Also, I built busybox and made = ramdisk.

 

Now this is the qemu command I used. =

(I = referenced u-boot's include/configs/qemu-arm.h to determine the load = addresses, set CONFIG_BOOTCOMMAND=3D" booti 0x40400000 0x44000000 = 0x40000000")

 

../temp/qemu-6.2.0/build/aarch64-softmmu/qemu-system-aarch64= -machine virt,gic-version=3Dmax,secure=3Don,virtualization=3Dtrue -cpu = max -m 4G -nographic -bios u-boot/u-boot.bin -device = loader,file=3D../temp/linux-5.15.68/arch/arm64/boot/Image,addr=3D0x404000= 00 -device = loader,file=3Dinitrd.img,addr=3D0x44000000

 

u-boot runs and automatically = boots linunx and it boots OK to the shell = prompt.

But at the linux shell prompt, it doesn't respond to my = keyboard input.

It looks like the symptom I saw last year when system = counter is not working(for real board only).

(I added system counter device = in our qemu virtual machine just to not cause panic during the system = counter access with the same driver. The qemu machine for our board runs = ok using u-boot-spl and linux after booting including shell program and = simple driver test. I'm trying to use u-boot proper = now).

 

Also last year I had to power-on the GICR(for virtual = machine and real board).

So I tried adding the code to = power up GICR but it is the same. (this part is missing in u-boot, but I = saw it is in the arm-tf S/W).

For your reference this is the = change in u-boot’s arch/arm/lib/gic_64.S.

 

/* x9: ReDistributor Base Address of Current CPU = */

2:  mov w10, #~0x2

    ldr w11, [x9, = GICR_WAKER]

    and w11, w11, = w10       /* Clear ProcessorSleep = */

    str w11, [x9, = GICR_WAKER]

    dsb st

    isb

=3D=3D>

/* x9: ReDistributor Base Address of Current CPU = */

2:  // gicr power on, ckim

    mov w10, 2

    str w10, [x9, = GICR_PWRR]

5:  ldr w10, [x9, GICR_PWRR]

    tbnz    w10, #1, = 5b     /* Wait Children be Alive = */

    mov w10, #~0x2

    ldr w11, [x9, = GICR_WAKER]

    and w11, w11, = w10       /* Clear ProcessorSleep = */

    str w11, [x9, = GICR_WAKER]

    dsb st

    isb

 

Can anyone suggest what I can = try to solve this problem? (I mean, the problem of linux shell not = responding in qemu virtual machine)

I would appreciate it for any = comment or help.

 

Thank you.

Chan Kim

 

------=_NextPart_000_02F1_01D9957F.FBFF0640-- --===============3436964334834003423== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============3436964334834003423==--