On 15.08.14 12:12, Alexey Kardashevskiy wrote: > The existing KVM_CREATE_SPAPR_TCE ioctl only support 4G windows max. > We are going to add huge DMA windows support so this will create small > window and unexpectedly fail later. > > This disables KVM_CREATE_SPAPR_TCE for windows bigger that 4GB. Since > those windows are normally mapped at the boot time, there will be no > performance impact. > > Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> > --- > hw/ppc/spapr_iommu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c > index f6e32a4..36f5d27 100644 > --- a/hw/ppc/spapr_iommu.c > +++ b/hw/ppc/spapr_iommu.c > @@ -113,11 +113,11 @@ static MemoryRegionIOMMUOps spapr_iommu_ops = { > static int spapr_tce_table_realize(DeviceState *dev) > { > sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev); > + uint64_t window_size = tcet->nb_table << tcet->page_shift; > > - if (kvm_enabled()) { > + if (kvm_enabled() && !(window_size >> 32)) {
Please add a comment here that explains the reasoning. Alex