From nobody Sun May 5 20:04:23 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1559794269; cv=none; d=zoho.com; s=zohoarc; b=l6zK0bJhr22BJOn98TOE0JBGobOoBs4+dd+1uldbzBNMgfjc1fVkz+WE61tg64tJW0Wg5GL0Mc4lk9iXAKF5BqqypWeq1Dfrvq7Kvh0/JDoF/sWcyU/WOKEcM+Dp2ulahj9uPfPXXNm+2jBEdgifvsvNAr0co3AEm2pYDGpuHYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559794269; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=x8/i37sMMdSVF1C9HKLPxZH+M07IYboeoGxW4Ij9LOE=; b=XMuu+5GIOc3kl+eMUG86JlPQ6RnbE0gilt300f+YgzGOh+N2Hkds7mvpvVG3bWhO/3Wx1F0jl0I8/8xTx4KoXrOl/zg7cBwX4iTc23hp097qmxAyrK+1HEnGVjppb5QbBNbtQW80ZUsFhWejTw9UQy7FM5QPK46EADareBAr9eI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559794269927436.0118558707975; Wed, 5 Jun 2019 21:11:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:54137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYjjq-0006Va-GP for importer@patchew.org; Thu, 06 Jun 2019 00:10:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYjj1-0005zi-8U for qemu-devel@nongnu.org; Thu, 06 Jun 2019 00:10:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYjiz-0002Jg-DL for qemu-devel@nongnu.org; Thu, 06 Jun 2019 00:10:03 -0400 Received: from ozlabs.ru ([107.173.13.209]:48391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYjiz-0002Cr-7t; Thu, 06 Jun 2019 00:10:01 -0400 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 95B7EAE80017; Thu, 6 Jun 2019 00:09:23 -0400 (EDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Thu, 6 Jun 2019 14:09:19 +1000 Message-Id: <20190606040919.110655-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 107.173.13.209 Subject: [Qemu-devel] spapr_pci: Advertise BAR reallocation capability X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , Shawn Anastasio , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The pseries guests do not normally allocate PCI resouces and rely on the system firmware doing so. Furthermore at least at some point in the past the pseries guests won't even be allowed to change BARs, probably it is still the case for phyp. So since the initial commit we have [1] which prevents resource reallocation. This is not a problem until we want specific BAR alignments, for example, PAGE_SIZE=3D=3D64k to make sure we can still map MMIO BARs directly. For the boot time devices we handle this in SLOF [2] but since QEMU's RTAS does not allocate BARs, the guest does this instead and does not align BARs even if Linux is given pci=3Dresource_alignment=3D16@pci:0:0 as PCI_PROBE_ONLY makes Linux ignore alignment requests. ARM folks added a dial to control PCI_PROBE_ONLY via the device tree [3]. This makes use of the dial to advertise to the guest that we can handle BAR reassignments. We do not remove the flag from [1] as pseries guests are still supported under phyp so having that removed may cause problems. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /arch/powerpc/platforms/pseries/setup.c?h=3Dv5.1#n773 [2] https://git.qemu.org/?p=3DSLOF.git;a=3Dblob;f=3Dboard-qemu/slof/pci-phb= .fs;h=3D06729bcf77a0d4e900c527adcd9befe2a269f65d;hb=3DHEAD#l338 [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it/?id=3Df81c11af Signed-off-by: Alexey Kardashevskiy --- hw/ppc/spapr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 6dd8aaac3340..84d16f9edaca 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1209,6 +1209,9 @@ static void spapr_dt_chosen(SpaprMachineState *spapr,= void *fdt) _FDT(fdt_setprop_string(fdt, chosen, "stdout-path", stdout_path)); } =20 + /* We can deal with BAR reallocation just fine, advertise it to the gu= est */ + _FDT(fdt_setprop_cell(fdt, chosen, "linux,pci-probe-only", 0)); + spapr_dt_ov5_platform_support(spapr, fdt, chosen); =20 g_free(stdout_path); --=20 2.17.1