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

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