diff mbox series

[PATCH-for-8.0,3/5] accel/tcg: Rename tb_invalidate_phys_page_[locked_]fast()

Message ID 20221209093649.43738-4-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series accel/tcg: Restrict page_collection structure to system TB maintainance | expand

Commit Message

Philippe Mathieu-Daudé Dec. 9, 2022, 9:36 a.m. UTC
Emphasize this function is called with pages locked.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/tcg/cputlb.c   | 2 +-
 accel/tcg/internal.h | 6 +++---
 accel/tcg/tb-maint.c | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

Comments

Alex Bennée Dec. 16, 2022, 12:11 p.m. UTC | #1
Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Emphasize this function is called with pages locked.

The _locked should be a suffix rather than in the function and possibly
a __locked for continuity with the other __locked functions in the file.

Otherwise:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  accel/tcg/cputlb.c   | 2 +-
>  accel/tcg/internal.h | 6 +++---
>  accel/tcg/tb-maint.c | 6 +++---
>  3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index ac459478f4..6402fe11c1 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -1510,7 +1510,7 @@ static void notdirty_write(CPUState *cpu, vaddr mem_vaddr, unsigned size,
>      if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) {
>          struct page_collection *pages
>              = page_collection_lock(ram_addr, ram_addr + size);
> -        tb_invalidate_phys_page_fast(pages, ram_addr, size, retaddr);
> +        tb_invalidate_phys_page_locked_fast(pages, ram_addr, size, retaddr);
>          page_collection_unlock(pages);
>      }
>  
> diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
> index 35419f3fe1..d8b58c1e70 100644
> --- a/accel/tcg/internal.h
> +++ b/accel/tcg/internal.h
> @@ -37,9 +37,9 @@ void page_table_config_init(void);
>  
>  #ifdef CONFIG_SOFTMMU
>  struct page_collection;
> -void tb_invalidate_phys_page_fast(struct page_collection *pages,
> -                                  tb_page_addr_t start, int len,
> -                                  uintptr_t retaddr);
> +void tb_invalidate_phys_page_locked_fast(struct page_collection *pages,
> +                                         tb_page_addr_t start, int len,
> +                                         uintptr_t retaddr);
>  struct page_collection *page_collection_lock(tb_page_addr_t start,
>                                               tb_page_addr_t end);
>  void page_collection_unlock(struct page_collection *set);
> diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
> index 0c56e81d8c..bf84728910 100644
> --- a/accel/tcg/tb-maint.c
> +++ b/accel/tcg/tb-maint.c
> @@ -1200,9 +1200,9 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
>   *
>   * Call with all @pages in the range [@start, @start + len[ locked.
>   */
> -void tb_invalidate_phys_page_fast(struct page_collection *pages,
> -                                  tb_page_addr_t start, int len,
> -                                  uintptr_t retaddr)
> +void tb_invalidate_phys_page_locked_fast(struct page_collection *pages,
> +                                         tb_page_addr_t start, int len,
> +                                         uintptr_t retaddr)
>  {
>      PageDesc *p;
Richard Henderson Dec. 16, 2022, 5:31 p.m. UTC | #2
On 12/9/22 01:36, Philippe Mathieu-Daudé wrote:
> Emphasize this function is called with pages locked.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/tcg/cputlb.c   | 2 +-
>   accel/tcg/internal.h | 6 +++---
>   accel/tcg/tb-maint.c | 6 +++---
>   3 files changed, 7 insertions(+), 7 deletions(-)

Our other subroutines of the same form use the suffix "__locked".
As this is my only quibble with the series, I'll fix it up when applying.


r~
diff mbox series

Patch

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index ac459478f4..6402fe11c1 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1510,7 +1510,7 @@  static void notdirty_write(CPUState *cpu, vaddr mem_vaddr, unsigned size,
     if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) {
         struct page_collection *pages
             = page_collection_lock(ram_addr, ram_addr + size);
-        tb_invalidate_phys_page_fast(pages, ram_addr, size, retaddr);
+        tb_invalidate_phys_page_locked_fast(pages, ram_addr, size, retaddr);
         page_collection_unlock(pages);
     }
 
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
index 35419f3fe1..d8b58c1e70 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal.h
@@ -37,9 +37,9 @@  void page_table_config_init(void);
 
 #ifdef CONFIG_SOFTMMU
 struct page_collection;
-void tb_invalidate_phys_page_fast(struct page_collection *pages,
-                                  tb_page_addr_t start, int len,
-                                  uintptr_t retaddr);
+void tb_invalidate_phys_page_locked_fast(struct page_collection *pages,
+                                         tb_page_addr_t start, int len,
+                                         uintptr_t retaddr);
 struct page_collection *page_collection_lock(tb_page_addr_t start,
                                              tb_page_addr_t end);
 void page_collection_unlock(struct page_collection *set);
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 0c56e81d8c..bf84728910 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -1200,9 +1200,9 @@  void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
  *
  * Call with all @pages in the range [@start, @start + len[ locked.
  */
-void tb_invalidate_phys_page_fast(struct page_collection *pages,
-                                  tb_page_addr_t start, int len,
-                                  uintptr_t retaddr)
+void tb_invalidate_phys_page_locked_fast(struct page_collection *pages,
+                                         tb_page_addr_t start, int len,
+                                         uintptr_t retaddr)
 {
     PageDesc *p;