Skip to contentSkip to conversation

exec, cpu log

Qemu-devel Daniil Troshkov 2 participants 5 messages Dec 2, 2012

lore
Share & tools
lore
#0 lore raw

Public bug reported:

Hello!

CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb dumped) because tb links is occur. Patch:

cpu-exec.c +5 -1
index 904ee73..509d50c 100644
@@ -582,7 +582,11 @@ int cpu_exec(CPUArchState *env)
                 /* see if we can patch the calling TB. When the TB
                    spans two pages, we cannot safely do a direct
                    jump. */
-                if (next_tb != 0 && tb->page_addr[1] == -1) {
+                if (next_tb != 0 && tb->page_addr[1] == -1
+#ifdef CONFIG_DEBUG_EXEC
+                    && !qemu_loglevel_mask(CPU_LOG_EXEC | CPU_LOG_TB_CPU)
+#endif
+                ) {
                     tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
                 }
                 spin_unlock(&tb_lock);

** Affects: qemu
Importance: Undecided
Status: New

Signature · 36 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1085658

Title:
  exec, cpu log

Status in QEMU:
  New

Bug description:
  Hello!

  CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb dumped) because tb links is occur.
  Patch:

  diff --git a/cpu-exec.c b/cpu-exec.c
  index 904ee73..509d50c 100644
  --- a/cpu-exec.c
  +++ b/cpu-exec.c
  @@ -582,7 +582,11 @@ int cpu_exec(CPUArchState *env)
                   /* see if we can patch the calling TB. When the TB
                      spans two pages, we cannot safely do a direct
                      jump. */
  -                if (next_tb != 0 && tb->page_addr[1] == -1) {
  +                if (next_tb != 0 && tb->page_addr[1] == -1
  +#ifdef CONFIG_DEBUG_EXEC
  +                    && !qemu_loglevel_mask(CPU_LOG_EXEC | CPU_LOG_TB_CPU)
  +#endif
  +                ) {
                       tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
                   }
                   spin_unlock(&tb_lock);

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1085658/+subscriptions
#1 lore raw

** Attachment added: "patch_exec"
https://bugs.launchpad.net/qemu/+bug/1085658/+attachment/3449861/+files/patch_exec

Signature · 36 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1085658

Title:
  exec, cpu log

Status in QEMU:
  New

Bug description:
  Hello!

  CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb dumped) because tb links is occur.
  Patch:

  diff --git a/cpu-exec.c b/cpu-exec.c
  index 904ee73..509d50c 100644
  --- a/cpu-exec.c
  +++ b/cpu-exec.c
  @@ -582,7 +582,11 @@ int cpu_exec(CPUArchState *env)
                   /* see if we can patch the calling TB. When the TB
                      spans two pages, we cannot safely do a direct
                      jump. */
  -                if (next_tb != 0 && tb->page_addr[1] == -1) {
  +                if (next_tb != 0 && tb->page_addr[1] == -1
  +#ifdef CONFIG_DEBUG_EXEC
  +                    && !qemu_loglevel_mask(CPU_LOG_EXEC | CPU_LOG_TB_CPU)
  +#endif
  +                ) {
                       tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
                   }
                   spin_unlock(&tb_lock);

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1085658/+subscriptions
#2 lore raw
In reply to Daniil Troshkov
Quoted 1 line

CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb

dumped) because tb links is occur.

This is true, but I'm afraid I don't think this patch is the right approach. Enabling debug tracing shouldn't cause us to change behaviour, so we can't just disable TB linking when doing debug logging.

Signature · 36 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1085658

Title:
  exec, cpu log

Status in QEMU:
  New

Bug description:
  Hello!

  CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb dumped) because tb links is occur.
  Patch:

  diff --git a/cpu-exec.c b/cpu-exec.c
  index 904ee73..509d50c 100644
  --- a/cpu-exec.c
  +++ b/cpu-exec.c
  @@ -582,7 +582,11 @@ int cpu_exec(CPUArchState *env)
                   /* see if we can patch the calling TB. When the TB
                      spans two pages, we cannot safely do a direct
                      jump. */
  -                if (next_tb != 0 && tb->page_addr[1] == -1) {
  +                if (next_tb != 0 && tb->page_addr[1] == -1
  +#ifdef CONFIG_DEBUG_EXEC
  +                    && !qemu_loglevel_mask(CPU_LOG_EXEC | CPU_LOG_TB_CPU)
  +#endif
  +                ) {
                       tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
                   }
                   spin_unlock(&tb_lock);

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1085658/+subscriptions
#3 lore raw
In reply to Daniil Troshkov

** Description changed:

Hello!

CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb dumped) because tb links is occur. Patch:

diff --git a/cpu-exec.c b/cpu-exec.c
index 904ee73..509d50c 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -582,7 +582,11 @@ int cpu_exec(CPUArchState *env)
- /* see if we can patch the calling TB. When the TB
- spans two pages, we cannot safely do a direct
- jump. */
+                  /* see if we can patch the calling TB. When the TB
+                     spans two pages, we cannot safely do a direct
+                     jump. */
- if (next_tb != 0 && tb->page_addr[1] == -1) {
+ if (next_tb != 0 && tb->page_addr[1] == -1
+#ifdef CONFIG_DEBUG_EXEC
+ && !qemu_loglevel_mask(CPU_LOG_EXEC | CPU_LOG_TB_CPU)
+#endif
+ ) {
- tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
- }
- spin_unlock(&tb_lock);
+                      tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
+                  }
+                  spin_unlock(&tb_lock);

Signature · 36 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1085658

Title:
  exec, cpu log

Status in QEMU:
  Invalid

Bug description:
  Hello!

  CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb dumped) because tb links is occur.
  Patch:

  diff --git a/cpu-exec.c b/cpu-exec.c
  index 904ee73..509d50c 100644
  --- a/cpu-exec.c
  +++ b/cpu-exec.c
  @@ -582,7 +582,11 @@ int cpu_exec(CPUArchState *env)
                   /* see if we can patch the calling TB. When the TB
                      spans two pages, we cannot safely do a direct
                      jump. */
  -                if (next_tb != 0 && tb->page_addr[1] == -1) {
  +                if (next_tb != 0 && tb->page_addr[1] == -1
  +#ifdef CONFIG_DEBUG_EXEC
  +                    && !qemu_loglevel_mask(CPU_LOG_EXEC | CPU_LOG_TB_CPU)
  +#endif
  +                ) {
                       tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
                   }
                   spin_unlock(&tb_lock);

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1085658/+subscriptions
#4 lore raw
In reply to Daniil Troshkov

** Changed in: qemu
Assignee: (unassigned) => Daniil Troshkov (troshkovdanil)

** Changed in: qemu
Status: New => Invalid

Signature · 36 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1085658

Title:
  exec, cpu log

Status in QEMU:
  Invalid

Bug description:
  Hello!

  CPU_LOG_EXEC (and CPU_LOG_TB_CPU) does not work (i.e. not of each tb dumped) because tb links is occur.
  Patch:

  diff --git a/cpu-exec.c b/cpu-exec.c
  index 904ee73..509d50c 100644
  --- a/cpu-exec.c
  +++ b/cpu-exec.c
  @@ -582,7 +582,11 @@ int cpu_exec(CPUArchState *env)
                   /* see if we can patch the calling TB. When the TB
                      spans two pages, we cannot safely do a direct
                      jump. */
  -                if (next_tb != 0 && tb->page_addr[1] == -1) {
  +                if (next_tb != 0 && tb->page_addr[1] == -1
  +#ifdef CONFIG_DEBUG_EXEC
  +                    && !qemu_loglevel_mask(CPU_LOG_EXEC | CPU_LOG_TB_CPU)
  +#endif
  +                ) {
                       tb_add_jump((TranslationBlock *)(next_tb & ~3), next_tb & 3, tb);
                   }
                   spin_unlock(&tb_lock);

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1085658/+subscriptions