diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-06-23 11:53:14 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-06-23 11:53:14 +0100 |
commit | c7288767523f6510cf557707d3eb5e78e519b90d (patch) | |
tree | 241dd0aa246a75b6f76acb8f810789b0d1993996 /memory.c | |
parent | c6eb076aecbe85e816a320d03d8dc1951be97efd (diff) | |
parent | 86b50f2e1befc33407bdfeb6f45f7b0d2439a740 (diff) | |
download | qemu-c7288767523f6510cf557707d3eb5e78e519b90d.zip qemu-c7288767523f6510cf557707d3eb5e78e519b90d.tar.gz qemu-c7288767523f6510cf557707d3eb5e78e519b90d.tar.bz2 |
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160623' into staging
ppc patch queue for 2016-06-23
Currently outstanding patches for spapr, target-ppc and related
devices. This batch has:
* Significant new progress towards full support for hypervisor
mode
* Assorted bugfixes
* Some preliminary patches towards dynamic DMA window support
The last involves a change to memory.c, which Paolo has said I can
take through this tree.
# gpg: Signature made Thu 23 Jun 2016 06:47:53 BST
# gpg: using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
# gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>"
# gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392
* remotes/dgibson/tags/ppc-for-2.7-20160623:
ppc: Disable huge page support if it is not available for main RAM
ppc: Add P7/P8 Power Management instructions
ppc: Move exception generation code out of line
ppc: Turn a bunch of booleans from int to bool
ppc: Add real mode CI load/store instructions for P7 and P8
ppc: Rework generation of priv and inval interrupts
ppc: Fix generation if ISI/DSI vs. HV mode
ppc: Fix POWER7 and POWER8 exception definitions
ppc: fix exception model for HV mode
ppc: define a default LPCR value
ppc: Fix rfi/rfid/hrfi/... emulation
memory: Add reporting of supported page sizes
ppc: Improve emulation of THRM registers
target-ppc: Fix rlwimi, rlwinm, rlwnm again
ppc64: disable gen_pause() for linux-user mode
tests: Use '+=' to add additional tests, not '='
powerpc/mm: Update the WIMG check during H_ENTER
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1502,12 +1502,22 @@ void memory_region_register_iommu_notifier(MemoryRegion *mr, Notifier *n) notifier_list_add(&mr->iommu_notify, n); } -void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n, - hwaddr granularity, bool is_write) +uint64_t memory_region_iommu_get_min_page_size(MemoryRegion *mr) { - hwaddr addr; + assert(memory_region_is_iommu(mr)); + if (mr->iommu_ops && mr->iommu_ops->get_min_page_size) { + return mr->iommu_ops->get_min_page_size(mr); + } + return TARGET_PAGE_SIZE; +} + +void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n, bool is_write) +{ + hwaddr addr, granularity; IOMMUTLBEntry iotlb; + granularity = memory_region_iommu_get_min_page_size(mr); + for (addr = 0; addr < memory_region_size(mr); addr += granularity) { iotlb = mr->iommu_ops->translate(mr, addr, is_write); if (iotlb.perm != IOMMU_NONE) { |