Blame SOURCES/kvm-exec-Explicitly-export-target-AS-from-address_space_.patch

4a2fec
From 7d5255d9aa2d1b0da0e7fae12264c7582080de63 Mon Sep 17 00:00:00 2001
4a2fec
From: David Gibson <dgibson@redhat.com>
4a2fec
Date: Thu, 16 Nov 2017 03:07:14 +0100
4a2fec
Subject: [PATCH 10/30] exec: Explicitly export target AS from
4a2fec
 address_space_translate_internal
4a2fec
4a2fec
RH-Author: David Gibson <dgibson@redhat.com>
4a2fec
Message-id: <20171116030732.8560-5-dgibson@redhat.com>
4a2fec
Patchwork-id: 77696
4a2fec
O-Subject: [PATCH 04/22] exec: Explicitly export target AS from address_space_translate_internal
4a2fec
Bugzilla: 1481593
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
4a2fec
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
4a2fec
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
4a2fec
From: Alexey Kardashevskiy <aik@ozlabs.ru>
4a2fec
4a2fec
This adds an AS** parameter to address_space_do_translate()
4a2fec
to make it easier for the next patch to share FlatViews.
4a2fec
4a2fec
This should cause no behavioural change.
4a2fec
4a2fec
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
4a2fec
Message-Id: <20170921085110.25598-2-aik@ozlabs.ru>
4a2fec
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4a2fec
(cherry picked from commit e76bb18f7e430e0c50fb38d051feacf268bd78f4)
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
Conflicts:
4a2fec
	exec.c
4a2fec
4a2fec
Conflicts because we applied 076a93d7 "exec: simplify
4a2fec
address_space_get_iotlb_entry" out of order downstream.
4a2fec
4a2fec
Signed-off-by: David Gibson <dgibson@redhat.com>
4a2fec
---
4a2fec
 exec.c | 10 ++++++----
4a2fec
 1 file changed, 6 insertions(+), 4 deletions(-)
4a2fec
4a2fec
diff --git a/exec.c b/exec.c
4a2fec
index ae37a60..f00bd4e 100644
4a2fec
--- a/exec.c
4a2fec
+++ b/exec.c
4a2fec
@@ -478,7 +478,8 @@ static MemoryRegionSection address_space_do_translate(AddressSpace *as,
4a2fec
                                                       hwaddr *plen_out,
4a2fec
                                                       hwaddr *page_mask_out,
4a2fec
                                                       bool is_write,
4a2fec
-                                                      bool is_mmio)
4a2fec
+                                                      bool is_mmio,
4a2fec
+                                                      AddressSpace **target_as)
4a2fec
 {
4a2fec
     IOMMUTLBEntry iotlb;
4a2fec
     MemoryRegionSection *section;
4a2fec
@@ -512,6 +513,7 @@ static MemoryRegionSection address_space_do_translate(AddressSpace *as,
4a2fec
         }
4a2fec
 
4a2fec
         as = iotlb.target_as;
4a2fec
+        *target_as = iotlb.target_as;
4a2fec
     }
4a2fec
 
4a2fec
     *xlat = addr;
4a2fec
@@ -547,7 +549,7 @@ IOMMUTLBEntry address_space_get_iotlb_entry(AddressSpace *as, hwaddr addr,
4a2fec
      * but page mask.
4a2fec
      */
4a2fec
     section = address_space_do_translate(as, addr, &xlat, NULL,
4a2fec
-                                         &page_mask, is_write, false);
4a2fec
+                                         &page_mask, is_write, false, &as);
4a2fec
 
4a2fec
     /* Illegal translation */
4a2fec
     if (section.mr == &io_mem_unassigned) {
4a2fec
@@ -559,7 +561,7 @@ IOMMUTLBEntry address_space_get_iotlb_entry(AddressSpace *as, hwaddr addr,
4a2fec
         section.offset_within_region;
4a2fec
 
4a2fec
     return (IOMMUTLBEntry) {
4a2fec
-        .target_as = section.address_space,
4a2fec
+        .target_as = as,
4a2fec
         .iova = addr & ~page_mask,
4a2fec
         .translated_addr = xlat & ~page_mask,
4a2fec
         .addr_mask = page_mask,
4a2fec
@@ -581,7 +583,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
4a2fec
 
4a2fec
     /* This can be MMIO, so setup MMIO bit. */
4a2fec
     section = address_space_do_translate(as, addr, xlat, plen, NULL,
4a2fec
-                                         is_write, true);
4a2fec
+                                         is_write, true, &as);
4a2fec
     mr = section.mr;
4a2fec
 
4a2fec
     if (xen_enabled() && memory_access_is_direct(mr, is_write)) {
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec