Patchwork [04/30] exec: eliminate stq_phys_notdirty

login
register
mail settings
Submitter Paolo Bonzini
Date May 21, 2013, 10:57 a.m.
Message ID <1369133851-1894-5-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/245266/
State New
Headers show

Comments

Paolo Bonzini - May 21, 2013, 10:57 a.m.
It is not used anywhere.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 exec.c                    | 27 ---------------------------
 include/exec/cpu-common.h |  1 -
 include/exec/poison.h     |  1 -
 3 files changed, 29 deletions(-)
Peter Maydell - May 23, 2013, 5:32 p.m.
On 21 May 2013 11:57, Paolo Bonzini <pbonzini@redhat.com> wrote:
> It is not used anywhere.

So does this get deleted just because it's not used, or because
it gets in the way of patches later in the series. As far as I
can tell the st*_phys_notdirty() are for TCG to update page
table entries with accessed/modified bits, and I don't see
any reason we wouldn't have targets that need to update a
64 bit page table descriptor rather than just 32 bits of it.

thanks
-- PMM
Anthony Liguori - May 23, 2013, 7:18 p.m.
Peter Maydell <peter.maydell@linaro.org> writes:

> On 21 May 2013 11:57, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> It is not used anywhere.
>
> So does this get deleted just because it's not used, or because
> it gets in the way of patches later in the series. As far as I
> can tell the st*_phys_notdirty() are for TCG to update page
> table entries with accessed/modified bits, and I don't see
> any reason we wouldn't have targets that need to update a
> 64 bit page table descriptor rather than just 32 bits of it.

Unused code is untested code.  Untested code is broken code.

Someone can add it back later if it's ever needed.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori


>
> thanks
> -- PMM
Paolo Bonzini - May 23, 2013, 7:22 p.m.
Il 23/05/2013 19:32, Peter Maydell ha scritto:
> On 21 May 2013 11:57, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> > It is not used anywhere.
> So does this get deleted just because it's not used, or because
> it gets in the way of patches later in the series. 

No, it doesn't get in the way, I just preferred to kill it rather than
have an untested conversion.

Paolo
Peter Maydell - May 23, 2013, 11:14 p.m.
On 23 May 2013 20:22, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 23/05/2013 19:32, Peter Maydell ha scritto:
>> On 21 May 2013 11:57, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>> > It is not used anywhere.
>> So does this get deleted just because it's not used, or because
>> it gets in the way of patches later in the series.
>
> No, it doesn't get in the way, I just preferred to kill it rather than
> have an untested conversion.

Fair enough -- we can always put it back again if we need it.

-- PMM

Patch

diff --git a/exec.c b/exec.c
index fa5f9c3..1355661 100644
--- a/exec.c
+++ b/exec.c
@@ -2390,33 +2390,6 @@  void stl_phys_notdirty(hwaddr addr, uint32_t val)
     }
 }
 
-void stq_phys_notdirty(hwaddr addr, uint64_t val)
-{
-    uint8_t *ptr;
-    MemoryRegionSection *section;
-
-    section = phys_page_find(address_space_memory.dispatch, addr >> TARGET_PAGE_BITS);
-
-    if (!memory_region_is_ram(section->mr) || section->readonly) {
-        addr = memory_region_section_addr(section, addr);
-        if (memory_region_is_ram(section->mr)) {
-            section = &phys_sections[phys_section_rom];
-        }
-#ifdef TARGET_WORDS_BIGENDIAN
-        io_mem_write(section->mr, addr, val >> 32, 4);
-        io_mem_write(section->mr, addr + 4, (uint32_t)val, 4);
-#else
-        io_mem_write(section->mr, addr, (uint32_t)val, 4);
-        io_mem_write(section->mr, addr + 4, val >> 32, 4);
-#endif
-    } else {
-        ptr = qemu_get_ram_ptr((memory_region_get_ram_addr(section->mr)
-                                & TARGET_PAGE_MASK)
-                               + memory_region_section_addr(section, addr));
-        stq_p(ptr, val);
-    }
-}
-
 /* warning: addr must be aligned */
 static inline void stl_phys_internal(hwaddr addr, uint32_t val,
                                      enum device_endian endian)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index af851aa..af5258d 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -102,7 +102,6 @@  uint32_t lduw_phys(hwaddr addr);
 uint32_t ldl_phys(hwaddr addr);
 uint64_t ldq_phys(hwaddr addr);
 void stl_phys_notdirty(hwaddr addr, uint32_t val);
-void stq_phys_notdirty(hwaddr addr, uint64_t val);
 void stw_phys(hwaddr addr, uint32_t val);
 void stl_phys(hwaddr addr, uint32_t val);
 void stq_phys(hwaddr addr, uint64_t val);
diff --git a/include/exec/poison.h b/include/exec/poison.h
index 7d7b23b..2341a75 100644
--- a/include/exec/poison.h
+++ b/include/exec/poison.h
@@ -42,7 +42,6 @@ 
 #pragma GCC poison ldl_phys
 #pragma GCC poison ldq_phys
 #pragma GCC poison stl_phys_notdirty
-#pragma GCC poison stq_phys_notdirty
 #pragma GCC poison stw_phys
 #pragma GCC poison stl_phys
 #pragma GCC poison stq_phys