[Qemu-devel] [PATCH] accel/tcg: Remove dead code

Thomas Huth posted 1 patch 7 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1537204134-15905-1-git-send-email-thuth@redhat.com
Test docker-clang@ubuntu failed
Test checkpatch passed
accel/tcg/translate-all.c | 9 ---------
1 file changed, 9 deletions(-)
[Qemu-devel] [PATCH] accel/tcg: Remove dead code
Posted by Thomas Huth 7 years, 1 month ago
The global cpu_single_env variable has been removed more than 5 years
ago, so apparently nobody used this dead debug code in that timeframe
anymore. Thus let's remove it completely now.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 accel/tcg/translate-all.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 898c3bb..e589c35 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -2011,15 +2011,6 @@ void tb_invalidate_phys_page_fast(struct page_collection *pages,
 {
     PageDesc *p;
 
-#if 0
-    if (1) {
-        qemu_log("modifying code at 0x%x size=%d EIP=%x PC=%08x\n",
-                  cpu_single_env->mem_io_vaddr, len,
-                  cpu_single_env->eip,
-                  cpu_single_env->eip +
-                  (intptr_t)cpu_single_env->segs[R_CS].base);
-    }
-#endif
     assert_memory_lock();
 
     p = page_find(start >> TARGET_PAGE_BITS);
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] accel/tcg: Remove dead code
Posted by Peter Maydell 7 years, 1 month ago
On 17 September 2018 at 18:08, Thomas Huth <thuth@redhat.com> wrote:
> The global cpu_single_env variable has been removed more than 5 years
> ago, so apparently nobody used this dead debug code in that timeframe
> anymore. Thus let's remove it completely now.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>

It's also x86-specific debug (R_CS) in the middle of a
generic file, which is pretty ugly, so we're well rid of it.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

Re: [Qemu-devel] [PATCH] accel/tcg: Remove dead code
Posted by Paolo Bonzini 7 years, 1 month ago
On 17/09/2018 19:08, Thomas Huth wrote:
> The global cpu_single_env variable has been removed more than 5 years
> ago, so apparently nobody used this dead debug code in that timeframe
> anymore. Thus let's remove it completely now.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  accel/tcg/translate-all.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
> index 898c3bb..e589c35 100644
> --- a/accel/tcg/translate-all.c
> +++ b/accel/tcg/translate-all.c
> @@ -2011,15 +2011,6 @@ void tb_invalidate_phys_page_fast(struct page_collection *pages,
>  {
>      PageDesc *p;
>  
> -#if 0
> -    if (1) {
> -        qemu_log("modifying code at 0x%x size=%d EIP=%x PC=%08x\n",
> -                  cpu_single_env->mem_io_vaddr, len,
> -                  cpu_single_env->eip,
> -                  cpu_single_env->eip +
> -                  (intptr_t)cpu_single_env->segs[R_CS].base);
> -    }
> -#endif
>      assert_memory_lock();
>  
>      p = page_find(start >> TARGET_PAGE_BITS);
> 

Queued, thanks.

Paolo