Commit c7288767 authored by Peter Maydell's avatar Peter Maydell
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
parents c6eb076a 86b50f2e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -102,11 +102,15 @@ static target_ulong h_enter(PowerPCCPU *cpu, sPAPRMachineState *spapr,
            return H_PARAMETER;
        }
    } else {
        target_ulong wimg_flags;
        /* Looks like an IO address */
        /* FIXME: What WIMG combinations could be sensible for IO?
         * For now we allow WIMG=010x, but are there others? */
        /* FIXME: Should we check against registered IO addresses? */
        if ((ptel & (HPTE64_R_W | HPTE64_R_I | HPTE64_R_M)) != HPTE64_R_I) {
        wimg_flags = (ptel & (HPTE64_R_W | HPTE64_R_I | HPTE64_R_M));

        if (wimg_flags != HPTE64_R_I &&
            wimg_flags != (HPTE64_R_I | HPTE64_R_M)) {
            return H_PARAMETER;
        }
    }
+8 −0
Original line number Diff line number Diff line
@@ -149,6 +149,13 @@ static void spapr_tce_table_pre_save(void *opaque)
                               tcet->bus_offset, tcet->page_shift);
}

static uint64_t spapr_tce_get_min_page_size(MemoryRegion *iommu)
{
    sPAPRTCETable *tcet = container_of(iommu, sPAPRTCETable, iommu);

    return 1ULL << tcet->page_shift;
}

static int spapr_tce_table_post_load(void *opaque, int version_id)
{
    sPAPRTCETable *tcet = SPAPR_TCE_TABLE(opaque);
@@ -228,6 +235,7 @@ static const VMStateDescription vmstate_spapr_tce_table = {

static MemoryRegionIOMMUOps spapr_iommu_ops = {
    .translate = spapr_tce_translate_iommu,
    .get_min_page_size = spapr_tce_get_min_page_size,
};

static int spapr_tce_table_realize(DeviceState *dev)
+1 −8
Original line number Diff line number Diff line
@@ -321,11 +321,6 @@ out:
    rcu_read_unlock();
}

static hwaddr vfio_container_granularity(VFIOContainer *container)
{
    return (hwaddr)1 << ctz64(container->iova_pgsizes);
}

static void vfio_listener_region_add(MemoryListener *listener,
                                     MemoryRegionSection *section)
{
@@ -392,9 +387,7 @@ static void vfio_listener_region_add(MemoryListener *listener,
        QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next);

        memory_region_register_iommu_notifier(giommu->iommu, &giommu->n);
        memory_region_iommu_replay(giommu->iommu, &giommu->n,
                                   vfio_container_granularity(container),
                                   false);
        memory_region_iommu_replay(giommu->iommu, &giommu->n, false);

        return;
    }
+15 −4
Original line number Diff line number Diff line
@@ -151,6 +151,8 @@ typedef struct MemoryRegionIOMMUOps MemoryRegionIOMMUOps;
struct MemoryRegionIOMMUOps {
    /* Return a TLB entry that contains a given address. */
    IOMMUTLBEntry (*translate)(MemoryRegion *iommu, hwaddr addr, bool is_write);
    /* Returns minimum supported page size */
    uint64_t (*get_min_page_size)(MemoryRegion *iommu);
};

typedef struct CoalescedMemoryRange CoalescedMemoryRange;
@@ -572,6 +574,16 @@ static inline bool memory_region_is_iommu(MemoryRegion *mr)
}


/**
 * memory_region_iommu_get_min_page_size: get minimum supported page size
 * for an iommu
 *
 * Returns minimum supported page size for an iommu.
 *
 * @mr: the memory region being queried
 */
uint64_t memory_region_iommu_get_min_page_size(MemoryRegion *mr);

/**
 * memory_region_notify_iommu: notify a change in an IOMMU translation entry.
 *
@@ -596,16 +608,15 @@ void memory_region_register_iommu_notifier(MemoryRegion *mr, Notifier *n);

/**
 * memory_region_iommu_replay: replay existing IOMMU translations to
 * a notifier
 * a notifier with the minimum page granularity returned by
 * mr->iommu_ops->get_page_size().
 *
 * @mr: the memory region to observe
 * @n: the notifier to which to replay iommu mappings
 * @granularity: Minimum page granularity to replay notifications for
 * @is_write: Whether to treat the replay as a translate "write"
 *     through the iommu
 */
void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n,
                                hwaddr granularity, bool is_write);
void memory_region_iommu_replay(MemoryRegion *mr, Notifier *n, bool is_write);

/**
 * memory_region_unregister_iommu_notifier: unregister a notifier for
+1 −0
Original line number Diff line number Diff line
@@ -1721,6 +1721,7 @@ void cpu_loop(CPUPPCState *env)
            queue_signal(env, info.si_signo, &info);
            break;
        case POWERPC_EXCP_PROGRAM:  /* Program exception                     */
        case POWERPC_EXCP_HV_EMU:   /* HV emulation                          */
            /* XXX: check this */
            switch (env->error_code & ~0xF) {
            case POWERPC_EXCP_FP:
Loading