[Top][All Lists]

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

[Qemu-discuss] Access emulated memory fault when system reset

From: EricSong
Subject: [Qemu-discuss] Access emulated memory fault when system reset
Date: Sun, 4 Jan 2015 14:51:11 +0800

Hi, Expert

   I want to access emulated memory when system reset, but failed, please help to check it whether it is incorrect way.


   I emulate a x86 cpu under QEMU. And while x86 cpu resetting, I want to access the BIOS content with memory address—0xFFFFFFF0. This memory should be x86 cpu memory space, and it mapped to BIOS image, And it is a simple and normal thing.

   In QEMU, I find the qemu_system_reset() will reset x86 cpu, and after it x86 cpu will execute from 0xFFFFFFF0. I access this memory address in this function. In details, qemu_system_reset() call trace is :

qemu_system_reset() -> qemu_devices_reset() -> x86_cpu_machine_reset_cb() -> cpu_reset(CPU(cpu)).

   OK, In x86_cpu_machine_reset_cb(), and after cpu_reset(CPU(cpu)), I access this memory address with following code:

          CPUX86State env = cpu->env;

          Content = cpu_ldl_data(&env, 0xFFFFFFF0);

   But, When cpu_ldl_data() executing, QEMU is corrupted with Segmentation fault. But Why?

   I think I access memory address is a correct thing, but QEMU will be fault. In real silicon, Hardware can always access the memory space. Is there something wrong ?



Best wishes,



reply via email to

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