From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D73F6C072B1 for ; Tue, 28 May 2019 04:07:46 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AD762075B for ; Tue, 28 May 2019 04:07:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=anastas.io header.i=@anastas.io header.b="LByL6UKR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AD762075B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=anastas.io Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45CgKr4FyyzDqQv for ; Tue, 28 May 2019 14:07:44 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=anastas.io (client-ip=104.248.188.109; helo=alpha.anastas.io; envelope-from=shawn@anastas.io; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=anastas.io Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=anastas.io header.i=@anastas.io header.b="LByL6UKR"; dkim-atps=neutral Received: from alpha.anastas.io (alpha.anastas.io [104.248.188.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45CgFN5dQVzDqLx for ; Tue, 28 May 2019 14:03:52 +1000 (AEST) Received: from authenticated-user (alpha.anastas.io [104.248.188.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alpha.anastas.io (Postfix) with ESMTPSA id 38C037F8EF; Mon, 27 May 2019 23:03:19 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=anastas.io; s=mail; t=1559016200; bh=EbMGqvTbpmYpoY6l4LV+r9ViCc9hu4tEns2XXtxyPZ4=; h=From:To:Cc:Subject:Date:From; b=LByL6UKRIDR1c8RW+kQOJ3nBQiDIju1ahGKqda1v4yFnScHg9l4+zupmgModnYw0V 1g8Ah3gQfhnnOtQAxEYWhoWv3f9HzUvO9R2vFW0S1jLFh5Um6gtOAAqt3ED4eOKL+H hClUWlRnDQWpdnM+Ju1c1ba07njhTxE+CC/zeD1iPtrImjfjrSfSWliV2vJLiucvf7 KR4tlJazilVXT4tlkm8A9Jh036IFAzRcy9EF7GTVcYSmN8TG3popcNvomvyeXfQ25Q TV8cdv5mTR6ZgtULAAHipjCl2fJMtbOeB04xNjWnr6yWDzfKx78ZCmnIhPt9x2Wme6 o0dyEtNvcennA== From: Shawn Anastasio To: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 0/3] Allow custom PCI resource alignment on pseries Date: Mon, 27 May 2019 23:03:10 -0500 Message-Id: <20190528040313.35582-1-shawn@anastas.io> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sbobroff@linux.ibm.com, linux-kernel@vger.kernel.org, rppt@linux.ibm.com, xyjxie@linux.vnet.ibm.com, bhelgaas@google.com, paulus@samba.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Changes from v2 to v3: - Fix wrong return type of ppc pcibios_ignore_alignment_request (Not sure how my local compile didn't catch that!) Hello all, This patch set implements support for user-specified PCI resource alignment on the pseries platform for hotplugged PCI devices. Currently on pseries, PCI resource alignments specified with the pci=resource_alignment commandline argument are ignored, since the firmware is in charge of managing the PCI resources. In the case of hotplugged devices, though, the kernel is in charge of configuring the resources and should obey alignment requirements. The current behavior of ignoring the alignment for hotplugged devices results in sub-page BARs landing between page boundaries and becoming un-mappable from userspace via the VFIO framework. This issue was observed on a pseries KVM guest with hotplugged ivshmem devices. With these changes, users can specify an appropriate pci=resource_alignment argument on boot for devices they wish to use with VFIO. In the future, this could be extended to provide page-aligned resources by default for hotplugged devices, similar to what is done on powernv by commit 382746376993 ("powerpc/powernv: Override pcibios_default_alignment() to force PCI devices to be page aligned"). Feedback is appreciated. Thanks, Shawn Shawn Anastasio (3): PCI: Introduce pcibios_ignore_alignment_request powerpc/64: Enable pcibios_after_init hook on ppc64 powerpc/pseries: Allow user-specified PCI resource alignment after init arch/powerpc/include/asm/machdep.h | 6 ++++-- arch/powerpc/kernel/pci-common.c | 9 +++++++++ arch/powerpc/kernel/pci_64.c | 4 ++++ arch/powerpc/platforms/pseries/setup.c | 22 ++++++++++++++++++++++ drivers/pci/pci.c | 9 +++++++-- include/linux/pci.h | 1 + 6 files changed, 47 insertions(+), 4 deletions(-) -- 2.20.1