From patchwork Fri Nov 1 06:54:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1187794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 474Cbx6rZtz9sRD for ; Fri, 1 Nov 2019 17:54:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dg9ZyNy8"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 474Cbx5QxDzF6cS for ; Fri, 1 Nov 2019 17:54:37 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dg9ZyNy8"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 474Cbk24DZzF6cF for ; Fri, 1 Nov 2019 17:54:25 +1100 (AEDT) Received: by mail-pg1-x543.google.com with SMTP id e10so5866208pgd.11 for ; Thu, 31 Oct 2019 23:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=umhZmAJvRlTzQkvI3+O1dqpEgU+uLoX5fWvLI0wx8jg=; b=dg9ZyNy8DGbqmZvb676FwB12WarV3rjufwRxXDXMLINuUiy3KAGIR24F4BEzVdXOV7 SOT9icgHmwdr/Ys9mA9iDeHo1zKYJCRQCGfOEGP/nbIjWR/2q88JHEga5BpCKl/eoz8O O0wzRfOGaHYjQhLEe0307QXll5gx21kz1Pb2c3nRmJMI3cjkfcLEMEWpUeHfRrrHJJFI GsdEKjv6RwjD7byz0bXIbrJbEod1hArWgXOSl9uNTNj/sHT4bGYBRSWwveY786lxLBl6 uid2ZPqu2sp8hHsfXZ4ZPOhn1eJ5/IC9/jT+K9Yf1Oea7GkDNOu+P5S9gVvuyhQ2K9PG wMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=umhZmAJvRlTzQkvI3+O1dqpEgU+uLoX5fWvLI0wx8jg=; b=PYuP2dz6nZimcx/IK/96YEUbqIKBgSOk9Tmc7NO+pRO/1LkDckZmsbbL79JagHE/Lx Z/KCnICmzXjjh77P91imedv+uWAbVYDPh25TF+ObIJU4CBL3TTR7JYxvbKPpWTEoBkNy TwzC9CIoH+D6YDJNyzc9wStvUqTRTBrjMIRw+NA9Yx/GmTQKDZeXmzTHB7kh7TUdD6Ol QPQaJ4Lew68q0FWs8j18fHTQgKWvhbsKdScXznMEMIQVr44zNKVOeXSsyPqnEysbLQ/r 5lGdihh0PvOPyzrrtNxBArhZpEx1N88v3qvls6NcuAgWt4gHVDnTMUoNlAwAZXpbXMas Rfhg== X-Gm-Message-State: APjAAAUExzKEZ2HVxwi9/3V+s98Ll1yt6P2pZ7GAoWougCgLifmSfqxl q93j1glhv9UUOzs/5w4iMUek3I1W7eg= X-Google-Smtp-Source: APXvYqxbTkZAiIIUPVwO3agWqJxO1I82a4I2ez2xWixEQNw0wQ1cKuP5/cvWZQ7i2x/LSwmne2XuJw== X-Received: by 2002:a63:ff46:: with SMTP id s6mr11560521pgk.337.1572591262238; Thu, 31 Oct 2019 23:54:22 -0700 (PDT) Received: from wafer.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 127sm6214699pfy.56.2019.10.31.23.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 23:54:21 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 1 Nov 2019 17:54:09 +1100 Message-Id: <20191101065410.4804-1-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Skiboot] [PATCH 1/2] core/trace: Move trace buffer exports to a subnode X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The top level exports node is getting a bit crowded. Move the trace entries into their own directory since there's a lot of them and there (currently) isn't any hard dependencies on them being in the top level node so we can move them into a sub-node. Cc: Jordan Niethe Signed-off-by: Oliver O'Halloran --- core/trace.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/trace.c b/core/trace.c index 614be08d7de1..a3739eba5a17 100644 --- a/core/trace.c +++ b/core/trace.c @@ -157,14 +157,21 @@ void trace_add(union trace *trace, u8 type, u16 len) static void trace_add_dt_props(void) { + struct dt_node *exports, *traces; unsigned int i; u64 *prop, tmask; - struct dt_node *exports; char tname[256]; + exports = dt_find_by_path(opal_node, "firmware/exports"); + if (!exports) + return; + + traces = dt_new(exports, "traces"); + if (!exports) + return; + prop = malloc(sizeof(u64) * 2 * debug_descriptor.num_traces); - exports = dt_find_by_path(opal_node, "firmware/exports"); for (i = 0; i < debug_descriptor.num_traces; i++) { prop[i * 2] = cpu_to_fdt64(debug_descriptor.trace_phys[i]); prop[i * 2 + 1] = cpu_to_fdt64(debug_descriptor.trace_size[i]); @@ -172,7 +179,7 @@ static void trace_add_dt_props(void) snprintf(tname, sizeof(tname), "trace-%x-%"PRIx64, debug_descriptor.trace_pir[i], debug_descriptor.trace_phys[i]); - dt_add_property_u64s(exports, tname, debug_descriptor.trace_phys[i], + dt_add_property_u64s(traces, tname, debug_descriptor.trace_phys[i], debug_descriptor.trace_size[i]); } From patchwork Fri Nov 1 06:54:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1187795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 474CcP64Zcz9sRD for ; Fri, 1 Nov 2019 17:55:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Fkr3NHo5"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 474CcP3QgPzF6cM for ; Fri, 1 Nov 2019 17:55:01 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::643; helo=mail-pl1-x643.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Fkr3NHo5"; dkim-atps=neutral Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 474Cbl0YN9zF6cG for ; Fri, 1 Nov 2019 17:54:26 +1100 (AEDT) Received: by mail-pl1-x643.google.com with SMTP id q16so3935608pll.11 for ; Thu, 31 Oct 2019 23:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=12FDad1f6M6KGSS/rdQMwwMS8oE2li1GDwddOPboiwo=; b=Fkr3NHo5W2F3t2XtXypg8ojToyxyAjUNt1319HAvCWf1SjASXZle7sBciv+jGg5vFL 4FeskfpSZ3LJdMMCCpj1T3BCWrB6Ql63TQGoRH2wUwGWACC487uDnBGXBWmZrHPNqoAa HwKbXXNzq4+ZYUwM/vaEnu9ZbZ669TPNaGt10ecNis+zjhTzWoNzJMoWW3Yhv/MAM1H1 1JDcsV6Z6KXPlYQd2lue1fmuwVWi79yTnJaXYvLK58DDi/glgFlpshfw3iBR9G5kJ0fM 8zF6kFXV+E9lVeLHv6gRKfbrqGsXJ7VrqMCU0WujNfaVrMJ4hlWaIGWVwa2dkFXPHn64 TRUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=12FDad1f6M6KGSS/rdQMwwMS8oE2li1GDwddOPboiwo=; b=rlsg8yHe+XumeApTc3cEm3dMH3wJ/cH+SsXKSPk0i2UKHTllzEwF/b/vCcMe7/kgZ2 qs+kI9hqLpZrP4nb+EUwO1HBgqnboIbkB0bDGVuYxNwioI3HKGeN+6CphgW1/BjoQQi9 21Pg0mIhyrFKg5uh/LDhEY40Vi744Z7VhnwUbz2foVrtbvSwCd2OmiCa5wI39S16wWDu eKq8CMlpBDEJBog2EGB274feBsZtwDofiTaRn5aGP/+uoXWCFsOjFap0I4Bc+wzq5OSg fVmSwk4kZhzPETLrNen+pZtkvqofy0Ohyie2cS5FMaJ7czO5nL7fKupIp1UkeclQ3pPV PWFQ== X-Gm-Message-State: APjAAAVySNfN7VYGogtfK/61JsFRGCXHagF62a3EogiKW5yj3sfsegfl qG8zPXGmwlRrJ6bP3jbFKVRlsyy+NPM= X-Google-Smtp-Source: APXvYqxEO6x0c3/kVZxctUeff6h/EiNKRPfNvQFlcEyFf1xff+vEWTU7LQZXU0+mm7AmI88JaRngGA== X-Received: by 2002:a17:902:a610:: with SMTP id u16mr11266295plq.130.1572591264331; Thu, 31 Oct 2019 23:54:24 -0700 (PDT) Received: from wafer.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 127sm6214699pfy.56.2019.10.31.23.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2019 23:54:23 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 1 Nov 2019 17:54:10 +1100 Message-Id: <20191101065410.4804-2-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191101065410.4804-1-oohall@gmail.com> References: <20191101065410.4804-1-oohall@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 2/2] core/trace: Rename boot trace buffer X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Right now we name the trace buffers: trace-- The physical address is only really required to differentiate the boot-time trace buffer from the runtime trace buffer associated with the same PIR. Rename the boot trace buffer to boot- to better differentiate it. Cc: Jordan Niethe Signed-off-by: Oliver O'Halloran --- core/trace.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/trace.c b/core/trace.c index a3739eba5a17..5388972f30c6 100644 --- a/core/trace.c +++ b/core/trace.c @@ -157,6 +157,7 @@ void trace_add(union trace *trace, u8 type, u16 len) static void trace_add_dt_props(void) { + uint64_t boot_buf_phys = (uint64_t) &boot_tracebuf.trace_info; struct dt_node *exports, *traces; unsigned int i; u64 *prop, tmask; @@ -173,14 +174,19 @@ static void trace_add_dt_props(void) prop = malloc(sizeof(u64) * 2 * debug_descriptor.num_traces); for (i = 0; i < debug_descriptor.num_traces; i++) { - prop[i * 2] = cpu_to_fdt64(debug_descriptor.trace_phys[i]); - prop[i * 2 + 1] = cpu_to_fdt64(debug_descriptor.trace_size[i]); - - snprintf(tname, sizeof(tname), "trace-%x-%"PRIx64, - debug_descriptor.trace_pir[i], - debug_descriptor.trace_phys[i]); - dt_add_property_u64s(traces, tname, debug_descriptor.trace_phys[i], - debug_descriptor.trace_size[i]); + uint64_t addr = debug_descriptor.trace_phys[i]; + uint64_t size = debug_descriptor.trace_size[i]; + uint32_t pir = debug_descriptor.trace_pir[i]; + + prop[i * 2] = cpu_to_fdt64(addr); + prop[i * 2 + 1] = cpu_to_fdt64(size); + + if (addr == boot_buf_phys) + snprintf(tname, sizeof(tname), "boot-%x", pir); + else + snprintf(tname, sizeof(tname), "trace-%x", pir); + + dt_add_property_u64s(traces, tname, addr, size); } dt_add_property(opal_node, "ibm,opal-traces",