[PATCH 1/6] target/s390x/mmu_helper: Use address_space_rw() in place

Philippe Mathieu-Daudé posted 6 patches 5 years, 8 months ago
Maintainers: Cornelia Huck <cohuck@redhat.com>
[PATCH 1/6] target/s390x/mmu_helper: Use address_space_rw() in place
Posted by Philippe Mathieu-Daudé 5 years, 8 months ago
In an effort to remove the cpu_physical_memory_rw() API,
update s390_cpu_virt_mem_rw() to use a more recent
address_space_rw() API.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/s390x/mmu_helper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
index 7d9f3059cd..632e8a8af4 100644
--- a/target/s390x/mmu_helper.c
+++ b/target/s390x/mmu_helper.c
@@ -529,8 +529,10 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,
         /* Copy data by stepping through the area page by page */
         for (i = 0; i < nr_pages; i++) {
             currlen = MIN(len, TARGET_PAGE_SIZE - (laddr % TARGET_PAGE_SIZE));
-            cpu_physical_memory_rw(pages[i] | (laddr & ~TARGET_PAGE_MASK),
-                                   hostbuf, currlen, is_write);
+            address_space_rw(CPU(cpu)->as,
+                             pages[i] | (laddr & ~TARGET_PAGE_MASK),
+                             MEMTXATTRS_UNSPECIFIED,
+                             hostbuf, currlen, is_write);
             laddr += currlen;
             hostbuf += currlen;
             len -= currlen;
-- 
2.21.3


Re: [PATCH 1/6] target/s390x/mmu_helper: Use address_space_rw() in place
Posted by David Hildenbrand 5 years, 8 months ago
On 31.05.20 19:54, Philippe Mathieu-Daudé wrote:
> In an effort to remove the cpu_physical_memory_rw() API,
> update s390_cpu_virt_mem_rw() to use a more recent
> address_space_rw() API.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/s390x/mmu_helper.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
> index 7d9f3059cd..632e8a8af4 100644
> --- a/target/s390x/mmu_helper.c
> +++ b/target/s390x/mmu_helper.c
> @@ -529,8 +529,10 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,
>          /* Copy data by stepping through the area page by page */
>          for (i = 0; i < nr_pages; i++) {
>              currlen = MIN(len, TARGET_PAGE_SIZE - (laddr % TARGET_PAGE_SIZE));
> -            cpu_physical_memory_rw(pages[i] | (laddr & ~TARGET_PAGE_MASK),
> -                                   hostbuf, currlen, is_write);
> +            address_space_rw(CPU(cpu)->as,
> +                             pages[i] | (laddr & ~TARGET_PAGE_MASK),
> +                             MEMTXATTRS_UNSPECIFIED,
> +                             hostbuf, currlen, is_write);
>              laddr += currlen;
>              hostbuf += currlen;
>              len -= currlen;
> 

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

-- 
Thanks,

David / dhildenb