From patchwork Wed Jan 29 18:21:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 1231048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 487BdD2nS4z9sPn for ; Thu, 30 Jan 2020 05:21:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 487BdD2M4zzDqTN for ; Thu, 30 Jan 2020 05:21:20 +1100 (AEDT) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=kaod.org (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=groug@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 487Bd526gnzDqKJ for ; Thu, 30 Jan 2020 05:21:13 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00TIEXP1047584 for ; Wed, 29 Jan 2020 13:21:10 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2xtmmxk9cy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Jan 2020 13:21:10 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Jan 2020 18:21:09 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 29 Jan 2020 18:21:07 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00TIL6gB13303814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2020 18:21:06 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 58B2F11C050; Wed, 29 Jan 2020 18:21:06 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2F15111C05B; Wed, 29 Jan 2020 18:21:06 +0000 (GMT) Received: from bahia.lan (unknown [9.145.55.193]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 29 Jan 2020 18:21:06 +0000 (GMT) From: Greg Kurz To: slof@lists.ozlabs.org Date: Wed, 29 Jan 2020 19:21:05 +0100 In-Reply-To: <158032205945.1409918.11941277321888476437.stgit@bahia.lan> References: <158032205945.1409918.11941277321888476437.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20012918-0016-0000-0000-000002E1D6BD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20012918-0017-0000-0000-000033449DFC Message-Id: <158032206541.1409918.14221972113364502700.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-29_05:2020-01-28, 2020-01-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=922 impostorscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1034 bulkscore=0 mlxscore=0 adultscore=0 spamscore=0 priorityscore=1501 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1911200001 definitions=main-2001290147 Subject: [SLOF] [PATCH 1/2] fdt: Fix unit name during CAS update X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" When new nodes are created at CAS, we currently rely on "finish-device" to set the unit name, but it only uses the first entry of the "reg" property. Some nodes, like PHBs for example, do need more entries from "reg" though. In order to support creating these, use "fdt-reg-unit" to fix the unit name of newly created nodes, like we already do when processing the FDT at boot. Signed-off-by: Greg Kurz --- board-qemu/slof/fdt.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs index 193a19e3087f..2ceb366d4f68 100644 --- a/board-qemu/slof/fdt.fs +++ b/board-qemu/slof/fdt.fs @@ -560,6 +560,7 @@ r> drop drop swap ( a1 newnode? ) IF + " reg" get-node get-package-property IF ELSE fdt-reg-unit THEN get-node finish-device set-node fdt-debug IF ." Finished subnode: " pwd get-node ." = " . cr THEN THEN From patchwork Wed Jan 29 18:21:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 1231049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 487BdH4Hqrz9sP6 for ; Thu, 30 Jan 2020 05:21:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 487BdH41XzzDqTW for ; Thu, 30 Jan 2020 05:21:23 +1100 (AEDT) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=kaod.org (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=groug@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 487BdC2wq7zDqTp for ; Thu, 30 Jan 2020 05:21:19 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00TIGuMe133376 for ; Wed, 29 Jan 2020 13:21:16 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2xtfh125x1-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Jan 2020 13:21:16 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Jan 2020 18:21:14 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 29 Jan 2020 18:21:13 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00TILCg553805222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2020 18:21:12 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 46570AE055; Wed, 29 Jan 2020 18:21:12 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1EABFAE051; Wed, 29 Jan 2020 18:21:12 +0000 (GMT) Received: from bahia.lan (unknown [9.145.55.193]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 29 Jan 2020 18:21:12 +0000 (GMT) From: Greg Kurz To: slof@lists.ozlabs.org Date: Wed, 29 Jan 2020 19:21:11 +0100 In-Reply-To: <158032205945.1409918.11941277321888476437.stgit@bahia.lan> References: <158032205945.1409918.11941277321888476437.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 20012918-0016-0000-0000-000002E1D6BF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20012918-0017-0000-0000-000033449DFD Message-Id: <158032207136.1409918.6540598987399205482.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-29_05:2020-01-28, 2020-01-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=1 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 priorityscore=1501 clxscore=1034 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1911200001 definitions=main-2001290147 Subject: [SLOF] [PATCH 2/2] fdt: Fix update of "interrupt-controller" node at CAS X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" Now that QEMU passes a full FDT at CAS without rebooting, a guest that has switched from XICS to XIVE ends up being presented an malformed "interrupt-controller" node in the DT: # dtc -I fs -O dts /proc/device-tree : Warning (unit_address_vs_reg): /interrupt-controller: node has a reg or ranges property, but no unit name ... interrupt-controller { ibm,xive-eq-sizes = <0x10>; device_type = "power-ivpe"; ibm,interrupt-server-ranges = <0x00 0x03>; compatible = "ibm,power-ivpe"; #interrupt-cells = <0x02>; reg = <0x60302 0x31b0000 0x00 0x10000 0x60302 0x31a0000 0x00 0x10000>; phandle = <0xe7448a8>; ibm,xive-lisn-ranges = <0x00 0x03>; interrupt-controller; }; The node should have its unit set to "60302031b0000" as reported by dtc. Also the node still has an "ibm,interrupt-server-ranges" property which only makes sense with XICS. This happens because we find an existing "interrupt-controller" node, which describes a XICS controller, and we _wrongly_ decide to copy all the properties from the new node into it. Delete the existing node instead so that we create a new node with the appropriate properties and unit name. Signed-off-by: Greg Kurz Reviewed-by: Alexey Kardashevskiy --- board-qemu/slof/fdt.fs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/board-qemu/slof/fdt.fs b/board-qemu/slof/fdt.fs index 2ceb366d4f68..1e2378124b09 100644 --- a/board-qemu/slof/fdt.fs +++ b/board-qemu/slof/fdt.fs @@ -465,6 +465,19 @@ r> drop ELSE drop THEN + + fdt-cas-pass 0= IF + \ The guest might have asked to change the interrupt controller type. It doesn't + \ make sense to merge the new node and the existing "interrupt-controller" node + \ in this case. Delete the latter. A brand new one will be created with the + \ appropriate properties and unit name. + 2dup " interrupt-controller" find-substr 0= IF + " interrupt-controller" find-node ?dup 0 <> IF + fdt-debug IF ." Deleting existing node: " dup .node cr THEN + delete-node + THEN + THEN + THEN 2dup find-node ?dup 0 <> IF set-node fdt-debug IF ." Setting node: " 2dup type cr THEN