Re: QEMU built-in RAM block device

2023-08-04 Thread Валентин via
Thank you very much.  If RAM block device driver doesn't exist yet, there is 
probably no point to implement it this way, since most OSes have ability to 
mount RAM disks.  I just thought that it existed and I could miss it. The issue 
#1797 is also mine, I'll reply there.  Thank you kindly! With best regards, 
Valentine.
On 03.08.2023 Hanna wrote:> No, we currently have no such block device.  It’s 
effectively been asked > for in 
https://gitlab.com/qemu-project/qemu/-/issues/1797, too, but so > far I don’t 
know of any plans to implement it.>> Hanna

Re: GPIO interrupt on QEMU

2023-08-04 Thread Swedha R
Thanks, I'll check it out!

On Fri, 4 Aug 2023 at 15:37, Peter Maydell  wrote:

> On Fri, 4 Aug 2023 at 10:25, Swedha R  wrote:
> >
> > Hi team,
> > I have arm64 up and  running in Qemu, And I built kernel image, rootfs
> everything via buildroot open source I cloned from git.
> > And I customized via make - menuconfig like enabling gpio support,
> libgpiod module and in device drivers gpio chip named pl061 .
> > After that, I able to see gpiochip in the /dev directory inside arm
> running in qemu.
> > I want to know , how to trigger the gpio line ( that is function for
> poweroff) and it have to cach and service it in this case.
> > The gpiochip has 7 lines in it. How to find which line is a poweroff key
> , the qemu-virt board has )
>
> If your guest is Linux it in theory [*] should have already
> found the power-off key GPIO by looking in the device tree that
> QEMU passed it (the information is in the /gpio-keys/poweroff
> node).
>
> You can trigger the power-down button by using the
> "system_powerdown" command at the QEMU monitor (HMP)
> prompt.
>
> [*] The guest I have didn't power down in response
> to the system_powerdown command, but I might well have
> not compiled in all the necessary kernel options for
> it to work. QEMU definitely does raise the GPIO line
> when you use the system_powerdown command.
>
> thanks
> -- PMM
>


Re: GPIO support on QEMU

2023-08-04 Thread Peter Maydell
On Fri, 4 Aug 2023 at 11:02, Swedha R  wrote:
>
> Hi ,
> Is qemu will support virtual GPIO drivers. How to work on GPIO in qemu?

Broadly speaking, you seem to be trying to do something
that QEMU is not set up to do. QEMU's support for GPIO
controllers and GPIO lines is almost entirely there
so we can emulate features of boards and SoCs which
are implemented via internal GPIO controllers and
GPIO lines. (For example, a board might wire up the
SD card "card present" line to a GPIO controller: so to
make the SD card work, QEMU needs to model that GPIO
controller and that line.) QEMU does not have a framework
for the equivalent of a board like a raspberry pi
where GPIO lines are exposed directly to pins that
the end-user can wire up to other boards, to sensors,
to LEDs, or to push buttons.

So if you are trying to model that sort of thing, or to
generally take an existing QEMU model and "use the
GPIO controller outputs", you are trying to push
uphill, because the facilities are basically not there
to help you.

-- PMM



Re: GPIO interrupt on QEMU

2023-08-04 Thread Peter Maydell
On Fri, 4 Aug 2023 at 10:25, Swedha R  wrote:
>
> Hi team,
> I have arm64 up and  running in Qemu, And I built kernel image, rootfs 
> everything via buildroot open source I cloned from git.
> And I customized via make - menuconfig like enabling gpio support, libgpiod 
> module and in device drivers gpio chip named pl061 .
> After that, I able to see gpiochip in the /dev directory inside arm running 
> in qemu.
> I want to know , how to trigger the gpio line ( that is function for 
> poweroff) and it have to cach and service it in this case.
> The gpiochip has 7 lines in it. How to find which line is a poweroff key , 
> the qemu-virt board has )

If your guest is Linux it in theory [*] should have already
found the power-off key GPIO by looking in the device tree that
QEMU passed it (the information is in the /gpio-keys/poweroff
node).

You can trigger the power-down button by using the
"system_powerdown" command at the QEMU monitor (HMP)
prompt.

[*] The guest I have didn't power down in response
to the system_powerdown command, but I might well have
not compiled in all the necessary kernel options for
it to work. QEMU definitely does raise the GPIO line
when you use the system_powerdown command.

thanks
-- PMM



GPIO support on QEMU

2023-08-04 Thread Swedha R
Hi ,
Is qemu will support virtual GPIO drivers. How to work on GPIO in qemu?

Please give more details on this.


GPIO interrupt on QEMU

2023-08-04 Thread Swedha R
Hi team,
I have arm64 up and  running in Qemu, And I built kernel image, rootfs
everything via buildroot open source I cloned from git.
And I customized via make - menuconfig like enabling gpio support, libgpiod
module and in device drivers gpio chip named pl061 .
After that, I able to see gpiochip in the /dev directory inside arm running
in qemu.
I want to know , how to trigger the gpio line ( that is function for
poweroff) and it have to cach and service it in this case.
The gpiochip has 7 lines in it. How to find which line is a poweroff key ,
the qemu-virt board has )

This is the qemu-command we used,
qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel Image
-append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0
-device virtio-net-device,netdev=eth0 -drive
file=rootfs.ext4,if=none,format=raw,id=hd0 -device
virtio-blk-device,drive=hd0

Will you please help on it.


Re: Pinging test

2023-08-04 Thread Thomas Huth

On 03/08/2023 22.18, Swedha R wrote:

Hi team,
   I have RISCV linux up and running in qemu . But I can't able to ping test 
in that. Like ping google.com . It able to transmit but 
not able to receive.


 Hi!
There are multiple network backends and frontends in QEMU, so please specify 
how you are running QEMU when you're asking such questions, otherwise it is 
hard to tell what could be wrong. But if I had to guess:


https://wiki.qemu.org/Documentation/Networking#Enabling_ping_in_the_guest,_on_Linux_hosts

 HTH,
  Thomas