Hello experts can you help booting issue with XEN

2025-03-06 Thread Kandyala Saikumar
Hi Experts,

Greetings of the day!!

I have started with Zynqultrascale+MPSoC  in this I am using zcu102
evaluation board.

   - I have taken installation steps guide from AMD Xilinx. Firstly i have
   downloaded the PetaLinux tool installer .
   - After downloading the PetaLinux installer,I have setup the environment
   source for PetaLinux tool.
   - Then i downloaded the BSP of zcu102 board. After that I have created
   of zcu102 using the PetaLinux commands.
   - Then I configured the zcu102 image and build the PetaLinux. After
   building the image, i booted with the builded image using qemu i.e,
   petalinux-boot --qemu --prebuilt 2 or 3 (2 here which built from the u-boot
   i am able to login to Xilinx zcu102 board, 3 -Kernel image).
   - Then i  enabled the config for the Xen hypervisor in the menu-config i
   did the changes of it and again I rebuild the image.
   - Now i am able to see the Xen files like xen boot scripts, xen dtb, xen
   rootfs. Using this files, i want to boot the xen using qemu.
   - I am facing issues when i am booting with Xen, it is partially booting
   but I am not able to see any bootlogs for Xen.

with thanks & regards
k sai kumar


Re: Timer quality

2025-03-06 Thread Yanfeng Liu
Dear Frank,

Thank you so much for the thorough explanations!

Sorry for my late reply as I was tesing with NuttX guest with qemu-system-arm
v9.2 on Ubuntu 22.04 x64 edition, using the emulated Generic Timer.

My test includes two parts:

- A NuttX app sends CAN data within QEMU, with usleep(S) between the ops.
- Use candump on Ubuntu host to check CAN timestamp delta (-t d)

I collected logs of 1000 operations and got statistics like

usleep mean(ms), stdev(ms)

 1 10.530 0.198
  5000  5.558 0.229 
  1000  1.187 0.071

See my other notes embedded below.

Regards,
yf

On Wed, 2025-03-05 at 10:55 +0100, Frantisek Rysanek wrote:
> Dear YangFeng,
> 
> thanks for the question :-)
> 
> Timekeeping is a complex topic.
> Could you perhaps add more detail on what you are trying to achieve?
> Linux offers various API functions for timing, in the kernel and in 
> the user space - though oops, you haven't mentioned what guest VM you 
> are considering...
> Different timing functions serve different purposes, and under the 
> hood, they tap into different hardware "resources" available (timers, 
> counters, whatever). Such as, you can ask the guest OS:
> - "wake me up after 20 ms, starting from now"
> - Or, you can ask it "wake me up at 13:07:21.057 precisely". 
> - Or, you may merely want to know "what time is it, right now as I'm 
> asking?" 
> 
It seems that I am asking the first case.

> Note that QEMU/KVM comes accompanied by a set of guest-side drivers. 
> One of them presents a virtual PHC. This will provide a fairly 
> precise answer to the question "what time is it right now", tapping 
> into the host's timebase and hardware. Ordinarily, you would let your 
> guest OS sync its timebase to that PHC, and your applications running 
> in the guest would then get precise time just by asking their OS in 
> the standard way.
> 
> 
> If the question really is, "how precise are the emulated HW timers", 
> e.g. the PC AT i8254 programmable timer, or some HPET (not sure if 
> this even gets emulated) - obviously that emulation is not so rosy. 
> Its precision boils down to event (interrupt) handling latency and 
> jitter. Things are relatively good if you have a whole CPU core 
> reserved to the particular VM guest instance - but if multiple guest 
> VM instances share the time of a physical host CPU core, guess what's 
> likely to happen... Same thing if the HV/host OS instance is busy, 
> especially if busy serving other interrupts.
> 
Yes, I was wondering how good the emulated Arm Generic Timer is.

I guess the observed time intervals are mainly contributed by usleep(), time for
send operations, time for data traveling, plus jitters from scheduling. Anything
else?

> Please note that the PIT and HPET exist just once for the whole 
> physical machine (are a part of the chipset) and therefore need to be 
> emulated for each VM guest instance.
> Modern x86 CPU's supposedly also have the "local APIC timer" - and 
> the LAPIC supposedly is private to a CPU core. Not sure to what 
> extent the LAPIC is beneficial to virtualization - you could argue 
> that the VM guest could use it directly, if the CPU core is 
> reserved/dedicated to a particular guest. Yet I wouldn't bet on this, 
> and for the general case, the host / HV will likely want to keep a 
> handle on the LAPIC timer per core (and maybe make it available to 
> the VM guest through some virty encapsulation mechanism).
> The one hardware counter that IMO needs no virty wrappers, is the TSC 
> :-) It just counts forward, at some constant frequency, derived by 
> multiplication from the physical CPU's external reference base.
> 
> 
> I don't quite understand your note about the TCG *accelerator*.
> I'm just a fellow user of QEMU, not conversant in the guts.
> A quick google is telling me that the TCG is the code generator 
> inside QEMU, that's able to emulate instructions not supported by 
> your physical CPU.
Yes, I used TCG to mean that I was not using KVM.

> In that vein, for optimal results, I would suggest to set the 
> emulated CPU to "host" (=native). This should allow your guest OS to 
> adapt to your host CPU's physical capabilities, thus all guest 
> instructions get executed natively by bare metal, and thus the need 
> to actually emulate instructions via the TCG gets minimized...
> 
> Frank
> 
> https://www.vmware.com/docs/vmware_timekeeping
> https://wiki.osdev.org/APIC_Timer
> https://airbus-seclab.github.io/qemu_blog/tcg_p1.html
> 
> 
> 
> Subject:Timer quality
> From:   Yanfeng Liu 
> To: qemu-discuss@nongnu.org
> Date sent:  Wed, 05 Mar 2025 15:37:30 +0800
> 
> > Dear experts,
> > 
> > I am wondering how the precision of timers are with QEMU on x64 Ubuntu
> > Linux and TCG accelerator?
> > 
> > Regards,
> > yf
> > 
> > 
> > 
> > 
> 




boot problems with an arcolinux vm

2025-03-06 Thread Frank McCormick





I am running Arlcolinux in a virtual machine under QEMU. Or at least I 
was until this morning. My latest boot  ended up at the Grub rescue 
prompt with an error message "grub_is_cli_need_auth"


I have no idea what happened except I updated a few days ago but this is 
the first time I booted since then.


I think I am in way over my head here.

Can anyone help or am I going to have to recreate the VM ?

Thanks