From patchwork Tue Jul 3 06:17:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 938386 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41KYsT44K1z9s2R for ; Tue, 3 Jul 2018 16:21:01 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41KYsT2tBWzF1Nb for ; Tue, 3 Jul 2018 16:21:01 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 41KYp50HdbzF1MY for ; Tue, 3 Jul 2018 16:18:04 +1000 (AEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w636EIBJ019468 for ; Tue, 3 Jul 2018 02:18:03 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k03a7h0ax-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 Jul 2018 02:18:02 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jul 2018 07:18:00 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 3 Jul 2018 07:17:59 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w636HwvC41877544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Jul 2018 06:17:58 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2822B42042; Tue, 3 Jul 2018 09:18:24 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 354594204D; Tue, 3 Jul 2018 09:18:23 +0100 (BST) Received: from hegdevasant.in.ibm.com (unknown [9.199.176.102]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 3 Jul 2018 09:18:22 +0100 (BST) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Tue, 3 Jul 2018 11:47:19 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180703061727.8789-1-hegdevasant@linux.vnet.ibm.com> References: <20180703061727.8789-1-hegdevasant@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18070306-0020-0000-0000-000002A279E9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070306-0021-0000-0000-000020EE8F0E Message-Id: <20180703061727.8789-11-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-03_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807030072 Subject: [Skiboot] [PATCH v4 10/18] hdata: Create ibm,dump DT node X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stewart@linux.vnet.ibm.com MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" We use MPIPL system parameter to detect whether MPIPL is supported or not. If its supported create new device tree node (/ibm,dump) to pass all dump related information to kernel. This patch creates new node and populates below properties: - compatible - ibm,dump version - fw-load-area - Memory used by OPAL to load kernel/initrd from PNOR (KERNEL_LOAD_BASE & INITRAMFS_LOAD_BASE) This is the temporary memory used by OPAL during boot. Later Linux kernel is free to use this memory. We will pass this information to Linux. If Linux kernel is using these memory it will take necessary steps to make sure OPAL stomping these memory doesn't impact kernel dump. Signed-off-by: Vasant Hegde --- hdata/spira.c | 23 +++++++++++++++++++++++ hdata/spira.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hdata/spira.c b/hdata/spira.c index 9d968fbcb..82928af53 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -1030,6 +1030,25 @@ static void dt_init_secureboot_node(const struct iplparams_sysparams *sysparams) dt_add_property_cells(node, "hw-key-hash-size", hw_key_hash_size); } +static void fadump_add_node(void) +{ + u64 fw_load_area[4]; + struct dt_node *node; + + if (proc_gen < proc_gen_p9) + return; + + node = dt_new(dt_root, "ibm,dump"); + assert(node); + dt_add_property_string(node, "compatible", "ibm,opal-dump-v1"); + + fw_load_area[0] = (u64)KERNEL_LOAD_BASE; + fw_load_area[1] = KERNEL_LOAD_SIZE; + fw_load_area[2] = (u64)INITRAMFS_LOAD_BASE; + fw_load_area[3] = INITRAMFS_LOAD_SIZE; + dt_add_property(node, "fw-load-area", fw_load_area, sizeof(fw_load_area)); +} + static void add_iplparams_sys_params(const void *iplp, struct dt_node *node) { const struct iplparams_sysparams *p; @@ -1117,6 +1136,10 @@ static void add_iplparams_sys_params(const void *iplp, struct dt_node *node) if (sys_attributes & SYS_ATTR_RISK_LEVEL) dt_add_property(node, "elevated-risk-level", NULL, 0); + /* Populate fadump node */ + if (sys_attributes & SYS_ATTR_MPIPL_SUPPORTED) + fadump_add_node(); + if (version >= 0x60 && proc_gen >= proc_gen_p9) dt_init_secureboot_node(p); } diff --git a/hdata/spira.h b/hdata/spira.h index ef2aec257..398c1151a 100644 --- a/hdata/spira.h +++ b/hdata/spira.h @@ -363,6 +363,7 @@ struct iplparams_sysparams { __be32 sys_eco_mode; #define SYS_ATTR_MULTIPLE_TPM PPC_BIT32(0) #define SYS_ATTR_RISK_LEVEL PPC_BIT32(3) +#define SYS_ATTR_MPIPL_SUPPORTED PPC_BIT32(4) __be32 sys_attributes; __be32 mem_scrubbing; __be16 cur_spl_value;