[Qemu-devel] My OS hangup in KVM for some reasons, how can I debug?

2014-05-08 Thread Jun Koi
Hi, I have an weird OS that I am trying to boot in KVM. however, it just hang in the middle, without a good reason. The same OS boots fine in physical machine, and this OS comes with no source code. There must be a bug somewhere in KVM, so I am wondering how people debug deal with such a case to

Re: [Qemu-devel] My OS hangup in KVM for some reasons, how can I debug?

2014-05-08 Thread Jun Koi
On Thu, May 8, 2014 at 4:28 PM, Jun Koi wrote: > Hi, > > I have an weird OS that I am trying to boot in KVM. however, it just hang > in the middle, without a good reason. > > The same OS boots fine in physical machine, and this OS comes with no > source code. > > There

Re: [Qemu-devel] My OS hangup in KVM for some reasons, how can I debug?

2014-05-11 Thread Jun Koi
On Fri, May 9, 2014 at 11:24 AM, Jun Koi wrote: > > > > On Thu, May 8, 2014 at 4:28 PM, Jun Koi wrote: > >> Hi, >> >> I have an weird OS that I am trying to boot in KVM. however, it just hang >> in the middle, without a good reason. >> >> The

[Qemu-devel] dump-guest-memory command?

2014-05-15 Thread Jun Koi
Hi, Anybody please help me on this dump-guest-memory command? How does the virtual memory map to the dumped file? For example, if x86 register RIP points to 0x12345, how does that map to the dump file? Meaning how can I find where this address 0x12345 in the dump? I tried, but couldnt find much

Re: [Qemu-devel] dump-guest-memory command?

2014-05-16 Thread Jun Koi
On Fri, May 16, 2014 at 3:03 PM, Greg Kurz wrote: > On Fri, 16 May 2014 14:24:16 +0800 > Jun Koi wrote: > > Hi, > > > > Anybody please help me on this dump-guest-memory command? How does the > > virtual memory map to the dumped file? > > > > For exam

Re: [Qemu-devel] dump-guest-memory command?

2014-05-16 Thread Jun Koi
On Fri, May 16, 2014 at 4:45 PM, Andreas Färber wrote: > Am 16.05.2014 10:40, schrieb Jun Koi: > > What I want > > to know is how to map 0x12345 (virtual address) back to the dump file. > > > > For example, if 0x12345 was executing some filesystem code at the time I &g

Re: [Qemu-devel] dump-guest-memory command?

2014-05-16 Thread Jun Koi
On Fri, May 16, 2014 at 5:51 PM, Greg Kurz wrote: > On Fri, 16 May 2014 16:40:23 +0800 > Jun Koi wrote: > > On Fri, May 16, 2014 at 3:03 PM, Greg Kurz > wrote: > > > > > On Fri, 16 May 2014 14:24:16 +0800 > > > Jun Koi wrote: > > > > Hi,

Re: [Qemu-devel] dump-guest-memory command?

2014-05-16 Thread Jun Koi
On Fri, May 16, 2014 at 7:30 PM, Laszlo Ersek wrote: > On 05/16/14 11:59, Jun Koi wrote: > > > - is it true that dump-guest-memory just write down physical memory > > page, and does not consider the virtual-memory concept? > > No, it isn't. > > Basically, &qu

Re: [Qemu-devel] [RFC][PATCH 00/15 v5] introducing a new, dedicated memory dump mechanism

2012-01-19 Thread Jun Koi
On Thu, Jan 19, 2012 at 10:50 AM, Wen Congyang wrote: > Hi, all > > 'virsh dump' can not work when host pci device is used by guest. We have > discussed this issue here: > http://lists.nongnu.org/archive/html/qemu-devel/2011-10/msg00736.html > > We have determined to introduce a new command dump t

Re: [Qemu-devel] Qemu as a library?

2012-04-09 Thread Jun Koi
On Tue, Apr 10, 2012 at 8:09 AM, Mikael wrote: > Dear list, > > I understood that earlier on there was a "libqemu" library, using which an > ordinary userspace application could allocate a qemu virtual machine and get > it in a pointer/handle representation, run it as long as it wanted to, and > i

[Qemu-devel] Fail to share Samba directory with guest

2012-02-27 Thread Jun Koi
hi, on qemu 1.0.1, i am trying to share a host directory with the Windows guest like below: qemu-system-i386 -enable-kvm -m 1000 -net nic,model=rtl8139 -net user,smb=/tmp img.winxp but in the guest, \\10.0.2.4 doesnt show me any shared directory. i already run Samba on the host (default configu

Re: [Qemu-devel] Fail to share Samba directory with guest

2012-02-27 Thread Jun Koi
On Tue, Feb 28, 2012 at 12:08 AM, Shu Ming wrote: > On 2012-2-27 17:21, Jun Koi wrote: >> >> hi, >> >> on qemu 1.0.1, i am trying to share a host directory with the Windows >> guest like below: >> >> qemu-system-i386 -enable-kvm -m 1000 -net nic,

Re: [Qemu-devel] Fail to share Samba directory with guest

2012-02-29 Thread Jun Koi
On Tue, Feb 28, 2012 at 9:43 AM, Jun Koi wrote: > On Tue, Feb 28, 2012 at 12:08 AM, Shu Ming wrote: >> On 2012-2-27 17:21, Jun Koi wrote: >>> >>> hi, >>> >>> on qemu 1.0.1, i am trying to share a host directory with the Windows >>> guest li

[Qemu-devel] Windows 8 fails to boot

2012-02-29 Thread Jun Koi
hi, anybody tested Qemu with the Windows 8 Consumer Preview? i tried the 32-bit ISO file with 1.0.1, with and without -enable-kvm, and Qemu reboots immediately after the first screen. that is no more than 10 seconds into the boot. thanks, Jun

Re: [Qemu-devel] Fail to share Samba directory with guest

2012-03-01 Thread Jun Koi
On Thu, Mar 1, 2012 at 5:59 PM, Jan Kiszka wrote: > On 2012-03-01 05:21, Jun Koi wrote: >> On Tue, Feb 28, 2012 at 9:43 AM, Jun Koi wrote: >>> On Tue, Feb 28, 2012 at 12:08 AM, Shu Ming >>> wrote: >>>> On 2012-2-27 17:21, Jun Koi wrote: >>>>&g

Re: [Qemu-devel] Windows 8 fails to boot

2012-03-01 Thread Jun Koi
;> >> On 01.03.2012, at 09:00, Andreas Färber wrote: >> >> >> >>> Hi, >> >>> >> >>> Am 01.03.2012 05:24, schrieb Jun Koi: >> >>>> anybody tested Qemu with the Windows 8 Consumer Preview? >> >>>> >>

Re: [Qemu-devel] Fail to share Samba directory with guest

2012-03-01 Thread Jun Koi
On Thu, Mar 1, 2012 at 6:21 PM, Jan Kiszka wrote: > > > Jun Koi schrieb: > >>On Thu, Mar 1, 2012 at 5:59 PM, Jan Kiszka wrote: >>> On 2012-03-01 05:21, Jun Koi wrote: >>>> On Tue, Feb 28, 2012 at 9:43 AM, Jun Koi >>wrote: >>>>> On

[Qemu-devel] [patch] make trace_thread_create() use its function arg

2012-03-07 Thread Jun Koi
this patch makes trace_thread_create() to use its function arg to initialize thread. the other choice is to make this a function to use void arg, but i prefer this way. Signed-off-by: Jun Koi diff --git a/trace/simple.c b/trace/simple.c index bbc9930..33ae486 100644 --- a/trace/simple.c +++ b

[Qemu-devel] [patch] correct tracing.txt

2012-03-08 Thread Jun Koi
this patch corrects the configure's trace option in docs/tracing.txt Signed-off-by: Jun Koi diff --git a/docs/tracing.txt b/docs/tracing.txt index ea29f2c..7b11d15 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -9,7 +9,7 @@ for debugging, profiling, and observing execution. 1.

[Qemu-devel] pthread code crash??

2011-07-10 Thread Jun Koi
hi, i am doing some experiments with Qemu. this is to add a new pthread into Qemu code, like below: ... pthread_t pt; pthread_attr_t thread_attr; pthread_attr_init(&thread_attr); pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); pthread_create(&pt, &

Re: [Qemu-devel] [PATCH 1/2] seabios: Add Local APIC NMI Structure to ACPI MADT

2011-10-28 Thread Jun Koi
2011/10/28 Kenji Kaneshige : > Avi, Jan, > > Could you comment on these patches? > > Inject-NMI doesn't work on Windows guest without these patches. sorry but i am really curious here: why Windows still works well even if it desnt see the inject-NMI? or there are still invisible side-effects that

[Qemu-devel] [patch] explicitly initialize tcg_cpu_thread

2011-10-31 Thread Jun Koi
This patch explicitly initializes tcg_cpu_thread to NULL in cpus.c (One code patch in qemu_tcg_init_vcpu() relies on the value of tcg_cpu_thread to create env->thread and so on ) Signed-off-by: Jun Koi diff --git a/cpus.c b/cpus.c index f768683..47feb58 100644 --- a/cpus.c +++ b/cpu

[Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()

2011-10-31 Thread Jun Koi
This patch removes unused function argument xfds from qemu_iohandler_poll() and qemu_iohandler_fill() Signed-off-by: Jun Koi diff --git a/iohandler.c b/iohandler.c index 5640d49..9963790 100644 --- a/iohandler.c +++ b/iohandler.c @@ -89,7 +89,7 @@ int qemu_set_fd_handler(int fd, return

Re: [Qemu-devel] [patch] explicitly initialize tcg_cpu_thread

2011-11-01 Thread Jun Koi
On Tue, Nov 1, 2011 at 3:06 PM, Pavel Borzenkov wrote: > On Tue, Nov 1, 2011 at 7:35 AM, Jun Koi wrote: >> This patch explicitly initializes tcg_cpu_thread to NULL in cpus.c >> (One code patch in qemu_tcg_init_vcpu() relies on the value of >> tcg_cpu_thread to create

[Qemu-devel] [patch] remove dead code, and make cpu_exec_all() static

2011-11-01 Thread Jun Koi
This patch removes dead code (kvm related) in cpu_exec_all(), and makes that static (since nobody uses it) Signed-off-by: Jun Koi diff --git a/cpus.c b/cpus.c index f768683..77282a1 100644 --- a/cpus.c +++ b/cpus.c @@ -85,6 +85,8 @@ typedef struct TimersState { TimersState timers_state

Re: [Qemu-devel] [PATCH] Simplify cpu_exec_all to tcg_exec_all

2011-11-01 Thread Jun Koi
i have sent a patch, which duplicated the function of this patch. this one was not approved yet?? thanks, Jun On Mon, Sep 26, 2011 at 3:40 PM, Jan Kiszka wrote: > After the removal of the non-threaded mode cpu_exec_all is now only used > by TCG. Refactor it accordingly, also dropping its unused

[Qemu-devel] cpu_x86() ?

2011-11-01 Thread Jun Koi
hi, the way cpu_exec() is defined is really confused to me. in cpu-exec.c, we define cpu_exec() function. however, each architecture seems to redefine cpu_exec(), like we have in target-i386/cpu.h #define cpu_exec cpu_x86_exec so which cpu_exec() is executed in case of tcg/x86? also, i cannot

Re: [Qemu-devel] cpu_x86() ?

2011-11-01 Thread Jun Koi
On Tue, Nov 1, 2011 at 6:58 PM, Max Filippov wrote: >> the way cpu_exec() is defined is really confused to me. >> >> in cpu-exec.c, we define cpu_exec() function. >> >> however, each architecture seems to redefine cpu_exec(), like we have >> in target-i386/cpu.h >> >> #define cpu_exec cpu_x86_exec

[Qemu-devel] [patch] add auto-generated files into .gitignore

2011-11-01 Thread Jun Koi
This patch adds some auto-generated files into .gitignore Signed-off-by: Jun Koi diff --git a/.gitignore b/.gitignore index 6d2acab..62679d8 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,9 @@ cscope.* tags TAGS *~ +qapi-types.c +qapi-types.h +qapi-visit.c +qapi-visit.h +qmp

Re: [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()

2011-11-01 Thread Jun Koi
On Tue, Nov 1, 2011 at 11:05 PM, Anthony Liguori wrote: > On 11/01/2011 12:11 AM, Jun Koi wrote: >> >> This patch removes unused function argument xfds from >> qemu_iohandler_poll() and qemu_iohandler_fill() >> >> Signed-off-by: Jun Koi >> > > Your

Re: [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()

2011-11-02 Thread Jun Koi
On Wed, Nov 2, 2011 at 3:40 PM, Paolo Bonzini wrote: > On 11/01/2011 06:11 AM, Jun Koi wrote: >> >> This patch removes unused function argument xfds from >> qemu_iohandler_poll() and qemu_iohandler_fill() > > I don't think the patch us particularly useful; the a

[Qemu-devel] how to delete a savevm in image?

2011-11-07 Thread Jun Koi
hi, during the run of my VM, i used "savevm" to save the VM status down. now how can i delete that? i checked qemu-img, and it doesnt seem to have any option to delete the savevm in the VM image. thanks, Jun

[Qemu-devel] Do not compile hw/ for SOFTMMU

2014-02-26 Thread Jun Koi
Currently hw/ is compiled in for SOFTMMU setup, but actually it is always compiled no matter what. This patch removes the related line in Makefile.objs. Signed-off-by: Jun Koi diff --git a/Makefile.objs b/Makefile.objs index 4a62913..15d75be 100644 --- a/Makefile.objs +++ b/Makefile.objs

[Qemu-devel] Running KVM inside pure Qemu?

2014-04-24 Thread Jun Koi
Hi, On Qemu 2.0, what commandline options should I use to run KVM (nested VM) inside pure emulator Qemu? Any guideline available onthis would be very helpful. Thanks so much, Jun

Re: [Qemu-devel] Running KVM inside pure Qemu?

2014-04-26 Thread Jun Koi
On Sat, Apr 26, 2014 at 4:50 PM, Paolo Bonzini wrote: > Il 25/04/2014 20:13, Shehbaz Jaffer ha scritto: > > Hi, >> >> Are you talking about running KVM(hardware virtualization) enabled >> support on top of a Linux host running on only QEMU (software >> virtualization)? I doubt if this is nesting

Re: [Qemu-devel] Running KVM inside pure Qemu?

2014-04-27 Thread Jun Koi
On Sun, Apr 27, 2014 at 3:05 PM, Paolo Bonzini wrote: > Il 27/04/2014 04:33, Jun Koi ha scritto: > >> >> >> >> On Sat, Apr 26, 2014 at 4:50 PM, Paolo Bonzini > <mailto:pbonz...@redhat.com>> wrote: >> >> Il 25/04/2014 20:13, Shehbaz Jaff

[Qemu-devel] where is the definition of cpu_ldub_code() for Softmmu mode?

2015-05-18 Thread Jun Koi
Hi, I am trying to find the definition of cpu_ldub_code() in Softmmu mode. However, the only thing I can find is like this in include/exec/cpu_ldst.h: #define cpu_ldub_code(env1, p) ldub_raw(p) Unfortunately, this is only for Usermode (CONFIG_USER_ONLY), so still I have no idea where cpu_ldu

Re: [Qemu-devel] where is the definition of cpu_ldub_code() for Softmmu mode?

2015-05-19 Thread Jun Koi
On Mon, May 18, 2015 at 6:20 PM, Peter Maydell wrote: > On 18 May 2015 at 10:55, Jun Koi wrote: > > Hi, > > > > I am trying to find the definition of cpu_ldub_code() in Softmmu mode. > > However, the only thing I can find is like this in > include/exec/c

[Qemu-devel] How Qemu timer interrupts code emulation?

2015-05-22 Thread Jun Koi
Hi, I am wondering how the timer interrupt works in softmmu TCG mode (on X86)? In general, we would have timer & code execution run in parallel, then once in a while, the timer would interrupt the code execution to switch it out to execute the timer interrupt. I looked at the code, but still co

[Qemu-devel] where is crc32() function?

2015-05-29 Thread Jun Koi
Hi, In target-arm/helper-a64.c, there is a call to crc32(). I searched everywhere in the source, but still cannot find this function anywhere (only crc32c() is available) Any hint where this function is, please? Thanks.

Re: [Qemu-devel] where is crc32() function?

2015-05-29 Thread Jun Koi
On Fri, May 29, 2015 at 11:43 PM, Peter Maydell wrote: > On 29 May 2015 at 17:41, Jun Koi wrote: > > In target-arm/helper-a64.c, there is a call to crc32(). > > > > I searched everywhere in the source, but still cannot find this function > > anywhere (only crc32c(

[Qemu-devel] Qemu uses C++ ??

2015-05-29 Thread Jun Koi
Hi, I always thought that Qemu never has C++ code inside, but I am surprise to see this when Aarch64 emulator is linked, as following (excerpt) c++ -I/usr/include/pixman-1 -I/home/me/projects/qemu-2.3.0/dtc/libfdt -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstri

Re: [Qemu-devel] Qemu uses C++ ??

2015-05-29 Thread Jun Koi
On Sat, May 30, 2015 at 1:09 AM, Peter Maydell wrote: > On 29 May 2015 at 19:01, Jun Koi wrote: > > I always thought that Qemu never has C++ code inside, but I am surprise > to > > see this when Aarch64 emulator is linked, as following (excerpt) > > The AArch64 disa

[Qemu-devel] Nested KVM is weird?

2014-06-01 Thread Jun Koi
Hi, I managed to run VMWare ESXi hypervisor (type 1) inside KVM. From there, I can install & run nested guest Linux on this ESXi. However, I find this very strange: I put some printk() at the top of function nested_vmx_run(), which should run to handle nested KVM. Below is the definition of neste

Re: [Qemu-devel] Nested KVM is weird?

2014-06-01 Thread Jun Koi
On Sun, Jun 1, 2014 at 5:59 PM, Muli Ben-Yehuda wrote: > On Sun, Jun 01, 2014 at 05:54:25PM +0700, Jun Koi wrote: > > > So this means ESXi never uses VMResume/VMLaunch? How is this > > possible, because it uses VMX for its implementation? > > ESXi will fall back to

[Qemu-devel] Resource leaking in gen_intermediate_code_internal ?

2015-06-29 Thread Jun Koi
Hello, In function gen_intermediate_code_internal() of target-i386/translate.c, we have this code: cpu_T[0] = tcg_temp_new(); cpu_T[1] = tcg_temp_new(); cpu_A0 = tcg_temp_new(); I cannot see anywhere cpu_T & cpu_A0 are freed, so each time this function is called, it allocates new va

[Qemu-devel] Trace memory access in guest VM?

2015-06-30 Thread Jun Koi
Hello, I am trying to monitor all the memory accesses inside the guest VM running on Qemu. I know this is heavy, but this is only the first step of my experiments. To do this, I look at the sample trace in "trace-events" and wondering: is it possible to trace all the memory access (read/write) in

[Qemu-devel] Monitoring write to memory

2015-07-01 Thread Jun Koi
Hello, I am trying to monitor all the memory writing events inside Qemu by instrumenting tcg_gen_qemu_st8, tcg_gen_qemu_st16, tcg_gen_qemu_st32, tcg_gen_qemu_st64, as followings: // in tcg-op.h void helper_checkmem(int64_t data, int64_t address); // this is declared elsewhere static inline vo

[Qemu-devel] Parameter of helper_le_ld_name ?

2015-07-02 Thread Jun Koi
Hi, In softmmu_template.h, we have this function: WORD_TYPE helper_le_ld_name(CPUArchState *env, target_ulong addr, int mmu_idx, uintptr_t retaddr) Anybody please explains what is this "retaddr" parameter, and how does that work? Thanks!

[Qemu-devel] How to break cpu_tb_exec()?

2015-07-03 Thread Jun Koi
Hello, I am looking at how the main thread interrupts TCG thread. Inside cpu-exec.c, in function cpu_tb_exec(), I can see that it executes one TB, and when this is over, it can check for events from other threads (like main thread). This is the reason why TCG thread can be interrupted. Is my unde

Re: [Qemu-devel] How to break cpu_tb_exec()?

2015-07-03 Thread Jun Koi
On Sat, Jul 4, 2015 at 1:06 AM, Peter Maydell wrote: > On 3 July 2015 at 18:02, Jun Koi wrote: > > I am looking at how the main thread interrupts TCG thread. Inside > > cpu-exec.c, in function cpu_tb_exec(), I can see that it executes one TB, > > and when this is over, it

Re: [Qemu-devel] How to break cpu_tb_exec()?

2015-07-03 Thread Jun Koi
On Sat, Jul 4, 2015 at 1:12 AM, Peter Maydell wrote: > On 3 July 2015 at 18:10, Jun Koi wrote: > > On Sat, Jul 4, 2015 at 1:06 AM, Peter Maydell > > wrote: > >> On 3 July 2015 at 18:02, Jun Koi wrote: > >> > If this is true, then what if this TB

[Qemu-devel] [patch] replace all strdup() with g_strdup()

2011-12-16 Thread Jun Koi
This patch replaces all the strdup() with g_strdup() Signed-off-by: Jun Koi $ diffstat strdup.diff cmd.c |4 ++-- envlist.c |6 +++--- exec.c |2 +- hw/isa-bus.c|2 +- hw/pc.c |2 +- hw/pci.c|2 +- hw

Re: [Qemu-devel] where is the definition of cpu_ldub_code() for Softmmu mode?

2015-06-12 Thread Jun Koi
On Mon, May 18, 2015 at 6:20 PM, Peter Maydell wrote: > On 18 May 2015 at 10:55, Jun Koi wrote: > > Hi, > > > > I am trying to find the definition of cpu_ldub_code() in Softmmu mode. > > However, the only thing I can find is like this in > include/exec/c

Re: [Qemu-devel] where is the definition of cpu_ldub_code() for Softmmu mode?

2015-06-12 Thread Jun Koi
On Fri, Jun 12, 2015 at 3:59 PM, Peter Maydell wrote: > On 12 June 2015 at 08:29, Jun Koi wrote: > > On Mon, May 18, 2015 at 6:20 PM, Peter Maydell > > > wrote: > >> In cpu_ldst.h we #define MEMSUFFIX _code and then include > >> "exec/cpu_ldst

Re: [Qemu-devel] [Bug 581353] Re: qemu doesn't stop execution upon hitting a breakpoint

2010-06-16 Thread Jun Koi
On Wed, Jun 16, 2010 at 4:07 PM, Alfredo Mungo wrote: > Same thing happens to me, same versions as above.. I must turn to > another app to accomplish my work while awaiting for a bug-fix, the code > is perfectly executed but while gdb hits the breakpoints qemu goes on.. > > -- > qemu doesn't stop

[Qemu-devel] Re: [Bug 581353] Re: qemu doesn't stop execution upon hitting a breakpoint

2010-06-16 Thread Jun Koi
On Wed, Jun 16, 2010 at 4:40 PM, Jan Kiszka wrote: > Jun Koi wrote: >> On Wed, Jun 16, 2010 at 4:07 PM, Alfredo Mungo >> wrote: >>> Same thing happens to me, same versions as above.. I must turn to >>> another app to accomplish my work while awaiting for a b

[Qemu-devel] Re: [Bug 581353] Re: qemu doesn't stop execution upon hitting a breakpoint

2010-06-16 Thread Jun Koi
On Wed, Jun 16, 2010 at 4:49 PM, Jan Kiszka wrote: > Jun Koi wrote: >> On Wed, Jun 16, 2010 at 4:40 PM, Jan Kiszka wrote: >>> Jun Koi wrote: >>>> On Wed, Jun 16, 2010 at 4:07 PM, Alfredo Mungo >>>> wrote: >>>>> Same thing happens to me,

[Qemu-devel] Monitoring memory access

2010-07-09 Thread Jun Koi
Hi, I want to monitor memory reading access in Qemu. According to function tcg/i386/tcg-target.c::tcg_out_qemu_ld(), all the memory access must call qemu_ld_helpers[] functions, which in turn calls __ldX_mmu functions. These __ldX_mmu() functions are declared in softmmu_template.c, with macro glu

Re: [Qemu-devel] Monitoring memory access

2010-07-09 Thread Jun Koi
On Fri, Jul 9, 2010 at 7:41 PM, malc wrote: > On Fri, 9 Jul 2010, Jun Koi wrote: > >> Hi, >> >> I want to monitor memory reading access in Qemu. According to function >> tcg/i386/tcg-target.c::tcg_out_qemu_ld(), all the memory access must >> call qemu_ld_help

[Qemu-devel] regs_to_env() ?

2010-07-21 Thread Jun Koi
Hi, Function regs_to_env() in target-i386/exec.h has a code like below: ... #ifdef reg_EAX env->regs[R_EAX] = EAX #endif ... However, elsewhere we have EAX defined as: #define EAX (env->regs[R_EAX]) This means effectively, we have code like: env->regs[R_EAX] = env->regs[R_EAX]; What is the m

Re: [Qemu-devel] regs_to_env() ?

2010-07-22 Thread Jun Koi
On Fri, Jul 23, 2010 at 7:08 AM, Blue Swirl wrote: > On Thu, Jul 22, 2010 at 2:06 AM, Jun Koi wrote: >> Hi, >> >> Function regs_to_env() in target-i386/exec.h has a code like below: >> >> ... >> #ifdef reg_EAX >> env->regs[R_EAX] = EAX >&

Re: [Qemu-devel] regs_to_env() ?

2010-07-22 Thread Jun Koi
On Fri, Jul 23, 2010 at 10:43 AM, Jun Koi wrote: > On Fri, Jul 23, 2010 at 7:08 AM, Blue Swirl wrote: >> On Thu, Jul 22, 2010 at 2:06 AM, Jun Koi wrote: >>> Hi, >>> >>> Function regs_to_env() in target-i386/exec.h has a code like below: >>> >>

Re: [Qemu-devel] [PATCH 8/8] Rework debug exception processing for gdb use

2010-07-22 Thread Jun Koi
On Fri, Jul 23, 2010 at 1:58 PM, TeLeMan wrote: > On Fri, Jun 25, 2010 at 22:56, Jan Kiszka wrote: >> Guest debugging is currently broken under CONFIG_IOTHREAD. The reason is >> inconsistent or even lacking signaling the debug events from the source >> VCPU to the main loop and the gdbstub. >> >>

[Qemu-devel] [patch] add cscope.* to .gitignore

2010-07-22 Thread Jun Koi
we have "make cscope", therefore that makes sense to have cscope.* in .gitignore. Signed-off-by: Jun Koi diff --git a/.gitignore b/.gitignore index a32b7c4..ec6f89f 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ pc-bios/optionrom/linuxboot.bin pc-bios/optionrom/multibo

[Qemu-devel] [patch] remove dead code

2010-07-22 Thread Jun Koi
this patch removes unused function cpu_restore_state_copy(). Signed-off-by: Jun Koi diff --git a/exec-all.h b/exec-all.h index 58b5575..3a53fe6 100644 --- a/exec-all.h +++ b/exec-all.h @@ -86,9 +86,6 @@ int cpu_gen_code(CPUState *env, struct TranslationBlock *tb, int cpu_restore_state

Re: [Qemu-devel] memory trace with qemu

2010-07-23 Thread Jun Koi
On Fri, Jul 23, 2010 at 3:15 PM, Stefan Hajnoczi wrote: > On Fri, Jul 23, 2010 at 4:12 AM, Mulyadi Santosa > wrote: >> Hi... >> >> On Fri, Jul 23, 2010 at 05:30, Eduardo Cruz >> wrote: >>> Hello, I need qemu to keep track of all the memory access made by the guest, >>> including read, write and

[Qemu-devel] Question on save_globals() in TCG

2010-07-23 Thread Jun Koi
Hi, I am looking at the save_globals() of TCG code, and it seems this function saves regular registers like EAX, ..., EDI back to CPU state. But I am not sure if it also saves value of other registers, like EFlags, Segments, CR*, DR*, ... (?) >From what I saw, it doesnt seem to do so. Is it corre

[Qemu-devel] [patch] use symbol for DisasContext->is_jmp

2010-07-23 Thread Jun Koi
This patch replaces constant value assigned for (DisasContext *)->is_jmp with DISAS_TB_JUMP. Signed-off-by: Jun Koi diff --git a/target-i386/translate.c b/target-i386/translate.c index 2fcc026..9543298 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -2322,7 +232

Re: [Qemu-devel] Question on save_globals() in TCG

2010-07-23 Thread Jun Koi
On Sat, Jul 24, 2010 at 2:53 AM, Aurelien Jarno wrote: > On Fri, Jul 23, 2010 at 08:59:54PM +0900, Jun Koi wrote: >> Hi, >> >> I am looking at the save_globals() of TCG code, and it seems this >> function saves regular registers like EAX, ..., EDI back to CPU state. &g

Re: [Qemu-devel] Question on save_globals() in TCG

2010-07-24 Thread Jun Koi
On Sat, Jul 24, 2010 at 11:49 AM, Aurelien Jarno wrote: > On Sat, Jul 24, 2010 at 09:35:44AM +0900, Jun Koi wrote: >> On Sat, Jul 24, 2010 at 2:53 AM, Aurelien Jarno wrote: >> > On Fri, Jul 23, 2010 at 08:59:54PM +0900, Jun Koi wrote: >> >> Hi, >> >> &

Re: [Qemu-devel] Question on save_globals() in TCG

2010-07-24 Thread Jun Koi
On Sun, Jul 25, 2010 at 7:57 AM, Aurelien Jarno wrote: > On Sun, Jul 25, 2010 at 01:58:51AM +0900, Jun Koi wrote: >> On Sat, Jul 24, 2010 at 11:49 AM, Aurelien Jarno >> wrote: >> > On Sat, Jul 24, 2010 at 09:35:44AM +0900, Jun Koi wrote: >> >> On Sat, Jul

[Qemu-devel] [patch] use gen_update_cc_op()

2010-07-24 Thread Jun Koi
this patch simplifies target-i386/translate.c a bit by replacing some code with gen_update_cc_op() Signed-off-by: Jun Koi diff --git a/target-i386/translate.c b/target-i386/translate.c index 9543298..7b6e3c2 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -2310,10 +2310,7

Re: [Qemu-devel] memory trace with qemu

2010-07-26 Thread Jun Koi
On Mon, Jul 26, 2010 at 8:16 PM, malc wrote: > On Mon, 26 Jul 2010, Eliot Moss wrote: > >> On 7/26/2010 6:20 AM, Llu?s wrote: >> > Eduardo Cruz writes: >> > >> > > Thanks for your awnsers. Stean, after I find the right place to capture >> > > the >> > > reads and writes I'll definitely try your tr

[Qemu-devel] Exposing monitor on socket interface?

2010-03-23 Thread Jun Koi
Hi, Is it possible to use -monitor option to expose the monitor on socket interface, such as TCP or Unix domain port, so I can access the monitor using non-stdio way? Thanks a lot, Jun

[Qemu-devel] Re: Exposing monitor on socket interface?

2010-03-24 Thread Jun Koi
Thanks a lot, Juan! Jun On Wed, Mar 24, 2010 at 6:41 PM, Juan Quintela wrote: > Jun Koi wrote: >> Hi, >> >> Is it possible to use -monitor option to expose the monitor on socket >> interface, such as TCP or Unix domain port, so I can access the >> monitor

[Qemu-devel] Semantic meaning of "stop" command?

2010-04-05 Thread Jun Koi
Hi, I always thought that the "stop" command provided by the monitor interface would pause the VM completely, but it doesnt seem so? I checked this by issuing the "stop" command on my VM, and noted its clock. Few minutes later, I resumed the VM (with "cont" command). The clock is immediately upda

[Qemu-devel] Re: Semantic meaning of "stop" command?

2010-04-06 Thread Jun Koi
On Tue, Apr 6, 2010 at 9:59 PM, Juan Quintela wrote: > Jun Koi wrote: >> Hi, >> >> I always thought that the "stop" command provided by the monitor >> interface would pause the VM completely, but it doesnt seem so? >> >> I checked this by i

[Qemu-devel] Weird thing happen when the VM is stop! (0.12.3)

2010-04-09 Thread Jun Koi
Hi, I found something very funny happening with 0.12.3: it seems the VM is still running even I already stopped it. Here is how I verified that: Boot any OS (I checked with Windows XP and Ubuntu) with 0.12.3, and stop it any time after it booted up. Use "stop" command on monitor interface. Now t

[Qemu-devel] [PATCH] Cleanup dead code

2010-04-09 Thread Jun Koi
This patch removes some dead code in exec.c Signed-off-by: Jun Koi diff --git a/exec.c b/exec.c index 76163aa..43366ac 100644 --- a/exec.c +++ b/exec.c @@ -2884,15 +2884,12 @@ void *qemu_get_ram_ptr(ram_addr_t addr) (typically a TLB entry) back to a ram offset. */ ram_addr_t

Re: [Qemu-devel] Weird thing happen when the VM is stop! (0.12.3)

2010-04-09 Thread Jun Koi
On Fri, Apr 9, 2010 at 10:20 PM, Luiz Capitulino wrote: > On Fri, 9 Apr 2010 18:32:21 +0900 > Jun Koi wrote: > >> Hi, >> >> I found something very funny happening with 0.12.3: it seems the VM is >> still running even I already stopped it. >> >> Here i

Re: [Qemu-devel] Weird thing happen when the VM is stop! (0.12.3)

2010-04-11 Thread Jun Koi
On Sat, Apr 10, 2010 at 3:09 AM, Marcelo Tosatti wrote: > On Sat, Apr 10, 2010 at 01:12:27AM +0900, Jun Koi wrote: >> On Fri, Apr 9, 2010 at 10:20 PM, Luiz Capitulino >> wrote: >> > On Fri, 9 Apr 2010 18:32:21 +0900 >> > Jun Koi wrote: >> > >>

[Qemu-devel] [Patch] Simplify cpu_can_run()

2010-04-11 Thread Jun Koi
This patch simplifies cpu_can_run(). Signed-off-by: Jun Koi diff --git a/cpus.c b/cpus.c index 0debe77..4adb66d 100644 --- a/cpus.c +++ b/cpus.c @@ -98,9 +98,7 @@ static void do_vm_stop(int reason) static int cpu_can_run(CPUState *env) { -if (env->stop) -return 0; -if (

[Qemu-devel] Missing singlestep for already-translated code?

2010-04-12 Thread Jun Koi
Hi, I am looking into the singlestep command in monitor interface, and it seems that we only take into account the singlestep flag when we are translating code. So for the already-translated code, we will miss singlestep? Thanks, Jun

[Qemu-devel] Re: Missing singlestep for already-translated code?

2010-04-13 Thread Jun Koi
On Tue, Apr 13, 2010 at 6:21 PM, wrote: > Hi, >> So for the already-translated code, we will miss singlestep? > At least SH4(and mips?) shows such behaviour. > I think a patch below enables single stepping in such case, too. > But, I'm not sure if this behaviour is on purpose, nor this patch is c

Re: [Qemu-devel] Re: Missing singlestep for already-translated code?

2010-04-14 Thread Jun Koi
On Wed, Apr 14, 2010 at 12:28 AM, Jan Kiszka wrote: > Alexander Graf wrote: >> On 13.04.2010, at 15:36, Jan Kiszka wrote: >> >>> Jun Koi wrote: >>>> Hi, >>>> >>>> I am looking into the singlestep command in monitor interface, and it &

[Qemu-devel] [PATCH] flush TB on singlestep command

2010-04-15 Thread Jun Koi
on already translated code. This patch fixes the problem by flushing all the TB to force new code generation. Signed-off-by: Jun Koi diff --git a/monitor.c b/monitor.c index 5659991..948b861 100644 --- a/monitor.c +++ b/monitor.c @@ -1190,8 +1190,14 @@ static void do_log(Monitor *mon, const

[Qemu-devel] TLB entry with separate addr_{read|write|code}?

2010-04-15 Thread Jun Koi
Hi, In the TLB entry, why do we need to maintain separately addr_read, addr_write and addr_code? Is it impossible to have only one for all the purposes? As far as I can see in tlb_set_page(), these fields are mutually exclusive, as they either enable or get invalid value (-1). Thanks, Jun

[Qemu-devel] Re: TLB entry with separate addr_{read|write|code}?

2010-04-15 Thread Jun Koi
On Fri, Apr 16, 2010 at 11:49 AM, Jun Koi wrote: > Hi, > > In the TLB entry, why do we need to maintain separately addr_read, > addr_write and addr_code? Is it impossible to have only one for all > the purposes? > > As far as I can see in tlb_set_page(), these fields are mut

[Qemu-devel] Which functions writes to memory?

2010-04-15 Thread Jun Koi
Hi, I am writing a small tool to trace all the activities that write to an area of (virtual) memory in Qemu. I am currently doing that by putting my code at the top of the below macro in softmmu_header.h static inline void glue(glue(st, SUFFIX), MEMSUFFIX) However, it seems I still miss some

Re: [Qemu-devel] Which functions writes to memory?

2010-04-16 Thread Jun Koi
2010/4/16 malc : > On Fri, 16 Apr 2010, Jun Koi wrote: > >> On Fri, Apr 16, 2010 at 3:17 PM, malc wrote: >> > On Fri, 16 Apr 2010, Jun Koi wrote: >> > >> >> Hi, >> >> >> >> I am writing a small tool to trace all the activities t

Re: [Qemu-devel] Which functions writes to memory?

2010-04-16 Thread Jun Koi
On Fri, Apr 16, 2010 at 3:17 PM, malc wrote: > On Fri, 16 Apr 2010, Jun Koi wrote: > >> Hi, >> >> I am writing a small tool to trace all the activities that write to an >> area of (virtual) memory in Qemu. >> I am currently doing that by putting my code

[Qemu-devel] dummy field in CPUTLBEntry?

2010-04-16 Thread Jun Koi
Hi, I find the way we calculate the dummy field in CPUTLBEntry funny. What is the point of having: ((-sizeof(target_ulong) * 3) & (sizeof(unsigned long) - 1)) in its size? Why shouldnt it be more simple, like below? uint8_t dummy[(1 << CPU_TLB_ENTRY_BITS) - (sizeof(target

Re: [Qemu-devel] [PATCH] flush TB on singlestep command

2010-04-19 Thread Jun Koi
Thank you for the explanation of this code. Qemu has a command named singlestep, which reduces the translated code block to be only one instruction. This new patch flushes TBs both when singlestep is on and off. Signed-off-by: Jun Koi diff --git a/monitor.c b/monitor.c index 5659991..2b2005b

Re: [Qemu-devel] Re: [PATCH] flush TB on singlestep command

2010-04-21 Thread Jun Koi
On Tue, Apr 20, 2010 at 8:44 PM, Alexander Graf wrote: > > On 20.04.2010, at 13:38, Jan Kiszka wrote: > >> Alexander Graf wrote: >>> On 20.04.2010, at 09:18, Jan Kiszka wrote: >>> >>>> Jun Koi wrote: >>>>> Thank you for the explanation o

Re: [Qemu-devel] Re: [PATCH] flush TB on singlestep command

2010-04-22 Thread Jun Koi
On Thu, Apr 22, 2010 at 4:20 AM, Stefan Weil wrote: > Jan Kiszka schrieb: >> Alexander Graf wrote: >> >>> On 21.04.2010, at 12:04, Jun Koi wrote: >>> >>> >>>> On Tue, Apr 20, 2010 at 8:44 PM, Alexander Graf wrote: >>>> >>>

[Qemu-devel] Compile Qemu on Windows?

2010-04-22 Thread Jun Koi
Hi, I want to compile Qemu on Windows (then run it there). Is there any instruction on how to do that? (I googled around, to no avail) Many thanks, Jun

[Qemu-devel] Problem with watchpoint in gdbstub

2010-04-25 Thread Jun Koi
Hi, I am trying to debug a VM using gdb. I connected gdb to Qemu (latest code from git repo), and issued below command: ... (gdb) watch *0x77f44cd8 (gdb) c The idea is to catch the write access to address 0x77f44cd8. But after the "c" command, I saw that the window title of my VM continuously f

[Qemu-devel] [PATCH] A bit optimization for tlb_set_page()

2010-04-26 Thread Jun Koi
It is not necessary to continue searching for watchpoint when we already found one and setup for handling watchpoint in a search loop in tlb_set_page(). This patch breaks that search loop on then. Signed-off-by: Jun Koi diff --git a/exec.c b/exec.c index 14d1fd7..6329775 100644 --- a/exec.c

[Qemu-devel] Re: Problem with watchpoint in gdbstub

2010-04-27 Thread Jun Koi
On Tue, Apr 27, 2010 at 5:10 PM, Jan Kiszka wrote: > Jun Koi wrote: >> Hi, >> >> I am trying to debug a VM using gdb. I connected gdb to Qemu (latest >> code from git repo), and issued below command: >> >> ... >> (gdb) watch *0x77f44cd8 >> (gd

  1   2   >