ARM中断处理的QEMU [英] ARM Interrupt Handling in QEMU

查看:925
本文介绍了ARM中断处理的QEMU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解QEMU如何处理中断ARM处理器。我有一个裸机二进制数据(即不是linux的 - 只是一些组装code),它是一个内置的ARM1176。当QEMU运行,初始化过程中二进制数据集的code位的CPSR指示中断向量表位于 0xFFFF0000地址 13。挂钩GDB,并在该地址倾销的指示,我确实可以看到相应的中断向量表。在一个IRQ,它跳转到 0xFFFF0018 ,它只是做一个跳转到 0xFFFF00070 ,里面有code用于第一irq_handler,最终跳转到一个第二irq_handler

I'm trying to understand how QEMU handles interrupts for ARM processors. I have a bare metal binary blob (ie, not linux -- just some assembly code) which was built for a ARM1176. When run in QEMU, during initialisation the code in the binary blob sets bit 13 of the CPSR indicating that the interrupt vector table is located at 0xFFFF0000. Hooking up GDB and dumping the instructions at that address, I can indeed see the corresponding interrupt vector table. On an IRQ, it jumps to 0xFFFF0018, which just does a jump to 0xFFFF00070, which has the code for the first irq_handler, and ultimately jumps to a second irq_handler.

这很好,但是当我看看QEMU挂钩中断每次我找到引用钩住我自己irq_handler。如果您分配一个IRQ,我需要提供 qemu_irq_handler 当IRQ被触发时调用。但是,在这种情况下,我不希望我自己的处理程序被调用。我假设QEMU会效仿ARM处理器并跳转到 0xFFFF0018 的当口,例如,名为 qemu_set_irq()并开始运行code那里。

That's fine, but when I look at hooking up interrupts in QEMU every reference I find is hooking up my own irq_handler. If you allocate an irq, I need to provide a qemu_irq_handler that gets called when the IRQ is fired. But in this case, I don't want my own handler to get called. I was assuming that QEMU would emulate the ARM processor and jump to 0xFFFF0018 when I, for instance, called qemu_set_irq() and start running the code there.

我敢肯定的东西是缺乏我的理解,但有没有办法让QEMU来触发时中断,例如,用<$ C跳转到中断向量表和运行code有$ C> qemu_set_irq()?

I'm sure something is lacking in my understanding, but is there not some way to get QEMU to jump to the interrupt vector table and run the code there when triggering an interrupt, for example, with qemu_set_irq()?

推荐答案

我认为QEMU是使用半虚拟化,在ARM。没有中断控制器在PC上的ARM设备。我觉得 qemu_irq_handler 准虚拟化的技术来处理中断。哪里的中断从哪儿来?请参阅: QEMU技术文档尤其是,

I would think that QEMU is using Paravirtualization for the ARM. There is no interrupt controller for the ARM device on a PC. I think the qemu_irq_handler is a paravirtualization technique to handle an interrupt. Where are interrupts going to come from? See: QEMU tech document especially,

2.11硬件中断

为了更快,QEMU并不在每个基本块检查,如果一个硬件中断产生。相反,用户必须异步调用一个特定的功能来告诉一个中断处于未决状态。此功能将当前正在执行的基本块的链接。它确保执行将在CPU模拟器的主循环很快就会回来。然后,主循环可以测试中断正在等待和处理。

In order to be faster, QEMU does not check at every basic block if a hardware interrupt is pending. Instead, the user must asynchronously call a specific function to tell that an interrupt is pending. This function resets the chaining of the currently executing basic block. It ensures that the execution will return soon in the main loop of the CPU emulator. Then the main loop can test if the interrupt is pending and handle it.

大概QEMU带有一些code模拟设备。但是,如果你想使用自己的设备,你需要做一些定制。这不是一个的实际的ARM处理器。大多数的虚拟化 有问题与中断;即使当虚拟化是由相同的CPU作为目标托管

Probably QEMU comes with some code to emulate devices. However, if you want to use your own device, you will need to do something custom. It is not an actual ARM processor. Most virtualization technology have issues with interrupts; even when the virtualization is hosted by the same CPU as the target.

这篇关于ARM中断处理的QEMU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆