diff mbox series

[v3,18/20] cputlb: Remove tb_invalidate_phys_page_range is_cpu_write_access

Message ID 20190922035458.14879-19-richard.henderson@linaro.org
State Superseded
Headers show
Series Move rom and notdirty handling to cputlb | expand

Commit Message

Richard Henderson Sept. 22, 2019, 3:54 a.m. UTC
All callers pass false to this argument.  Remove it and pass the
constant on to tb_invalidate_phys_page_range__locked.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 accel/tcg/translate-all.h | 3 +--
 accel/tcg/translate-all.c | 6 ++----
 exec.c                    | 4 ++--
 3 files changed, 5 insertions(+), 8 deletions(-)

-- 
2.17.1

Comments

David Hildenbrand Sept. 23, 2019, 8:52 a.m. UTC | #1
On 22.09.19 05:54, Richard Henderson wrote:
> All callers pass false to this argument.  Remove it and pass the

> constant on to tb_invalidate_phys_page_range__locked.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  accel/tcg/translate-all.h | 3 +--

>  accel/tcg/translate-all.c | 6 ++----

>  exec.c                    | 4 ++--

>  3 files changed, 5 insertions(+), 8 deletions(-)

> 

> diff --git a/accel/tcg/translate-all.h b/accel/tcg/translate-all.h

> index 64f5fd9a05..31f2117188 100644

> --- a/accel/tcg/translate-all.h

> +++ b/accel/tcg/translate-all.h

> @@ -28,8 +28,7 @@ struct page_collection *page_collection_lock(tb_page_addr_t start,

>  void page_collection_unlock(struct page_collection *set);

>  void tb_invalidate_phys_page_fast(struct page_collection *pages,

>                                    tb_page_addr_t start, int len);

> -void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,

> -                                   int is_cpu_write_access);

> +void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end);

>  void tb_check_watchpoint(CPUState *cpu);

>  

>  #ifdef CONFIG_USER_ONLY

> diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c

> index 5d1e08b169..de4b697163 100644

> --- a/accel/tcg/translate-all.c

> +++ b/accel/tcg/translate-all.c

> @@ -1983,8 +1983,7 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages,

>   *

>   * Called with mmap_lock held for user-mode emulation

>   */

> -void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,

> -                                   int is_cpu_write_access)

> +void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end)

>  {

>      struct page_collection *pages;

>      PageDesc *p;

> @@ -1996,8 +1995,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,

>          return;

>      }

>      pages = page_collection_lock(start, end);

> -    tb_invalidate_phys_page_range__locked(pages, p, start, end,

> -                                          is_cpu_write_access);

> +    tb_invalidate_phys_page_range__locked(pages, p, start, end, 0);


I'd prefer "false" to highlight the semantics, but as it's and int ...

Reviewed-by: David Hildenbrand <david@redhat.com>


-- 

Thanks,

David / dhildenb
Richard Henderson Sept. 23, 2019, 4:05 p.m. UTC | #2
On 9/23/19 1:52 AM, David Hildenbrand wrote:
>> -    tb_invalidate_phys_page_range__locked(pages, p, start, end,

>> -                                          is_cpu_write_access);

>> +    tb_invalidate_phys_page_range__locked(pages, p, start, end, 0);

> 

> I'd prefer "false" to highlight the semantics, but as it's and int ...

> 

> Reviewed-by: David Hildenbrand <david@redhat.com>


I did think of that, but then the next patch changes this last argument to
"uintptr_t retaddr", so then it's not really a boolean argument anymore, and
"0" is exactly what we want.


r~
Paolo Bonzini Sept. 23, 2019, 4:50 p.m. UTC | #3
On 23/09/19 18:05, Richard Henderson wrote:
> On 9/23/19 1:52 AM, David Hildenbrand wrote:

>>> -    tb_invalidate_phys_page_range__locked(pages, p, start, end,

>>> -                                          is_cpu_write_access);

>>> +    tb_invalidate_phys_page_range__locked(pages, p, start, end, 0);

>>

>> I'd prefer "false" to highlight the semantics, but as it's and int ...

>>

>> Reviewed-by: David Hildenbrand <david@redhat.com>

> 

> I did think of that, but then the next patch changes this last argument to

> "uintptr_t retaddr", so then it's not really a boolean argument anymore, and

> "0" is exactly what we want.


Yeah, 0 is fine here.

Paolo
diff mbox series

Patch

diff --git a/accel/tcg/translate-all.h b/accel/tcg/translate-all.h
index 64f5fd9a05..31f2117188 100644
--- a/accel/tcg/translate-all.h
+++ b/accel/tcg/translate-all.h
@@ -28,8 +28,7 @@  struct page_collection *page_collection_lock(tb_page_addr_t start,
 void page_collection_unlock(struct page_collection *set);
 void tb_invalidate_phys_page_fast(struct page_collection *pages,
                                   tb_page_addr_t start, int len);
-void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
-                                   int is_cpu_write_access);
+void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end);
 void tb_check_watchpoint(CPUState *cpu);
 
 #ifdef CONFIG_USER_ONLY
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 5d1e08b169..de4b697163 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1983,8 +1983,7 @@  tb_invalidate_phys_page_range__locked(struct page_collection *pages,
  *
  * Called with mmap_lock held for user-mode emulation
  */
-void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
-                                   int is_cpu_write_access)
+void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end)
 {
     struct page_collection *pages;
     PageDesc *p;
@@ -1996,8 +1995,7 @@  void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
         return;
     }
     pages = page_collection_lock(start, end);
-    tb_invalidate_phys_page_range__locked(pages, p, start, end,
-                                          is_cpu_write_access);
+    tb_invalidate_phys_page_range__locked(pages, p, start, end, 0);
     page_collection_unlock(pages);
 }
 
diff --git a/exec.c b/exec.c
index 090bcc05da..fed25d029b 100644
--- a/exec.c
+++ b/exec.c
@@ -978,7 +978,7 @@  const char *parse_cpu_option(const char *cpu_option)
 void tb_invalidate_phys_addr(target_ulong addr)
 {
     mmap_lock();
-    tb_invalidate_phys_page_range(addr, addr + 1, 0);
+    tb_invalidate_phys_page_range(addr, addr + 1);
     mmap_unlock();
 }
 
@@ -1005,7 +1005,7 @@  void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs)
         return;
     }
     ram_addr = memory_region_get_ram_addr(mr) + addr;
-    tb_invalidate_phys_page_range(ram_addr, ram_addr + 1, 0);
+    tb_invalidate_phys_page_range(ram_addr, ram_addr + 1);
     rcu_read_unlock();
 }