From patchwork Mon Mar 16 02:29:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 1255264 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 48ggHf1lfcz9sPk for ; Mon, 16 Mar 2020 13:29:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48ggHf190KzDqLX for ; Mon, 16 Mar 2020 13:29:50 +1100 (AEDT) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.ru (client-ip=107.174.27.60; helo=ozlabs.ru; envelope-from=aik@ozlabs.ru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Received: from ozlabs.ru (unknown [107.174.27.60]) by lists.ozlabs.org (Postfix) with ESMTP id 48ggHW2ltgzDqLG for ; Mon, 16 Mar 2020 13:29:39 +1100 (AEDT) Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 588B9AE80048; Sun, 15 Mar 2020 22:27:21 -0400 (EDT) From: Alexey Kardashevskiy To: slof@lists.ozlabs.org Date: Mon, 16 Mar 2020 13:29:02 +1100 Message-Id: <20200316022902.12891-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 Subject: [SLOF] [PATCH slof] rtas: Move FWNMI log space reservation to QEMU 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: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" This reverts commit 674d0d0cf66d4 ("rtas: Reserve space for FWNMI log") which expanded the RTAS blob size to match the QEMU expectation about the RTAS area available for FWNMI logs. Instead, it relies on QEMU passing the "rtas-size" property and passes it through untouched. This adds a check that QEMU allocated enough for RTAS blob. This adds a fallback to the default 20 bytes "rtas-size" if none specified by QEMU. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Greg Kurz --- board-qemu/slof/rtas.fs | 9 ++++++++- lib/libhvcall/hvcall.S | 9 --------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/board-qemu/slof/rtas.fs b/board-qemu/slof/rtas.fs index 90efe602f5d7..6d8090fe6f9f 100644 --- a/board-qemu/slof/rtas.fs +++ b/board-qemu/slof/rtas.fs @@ -153,7 +153,14 @@ rtas-node set-node ; hv-rtas-get -dup encode-int s" rtas-size" s" /rtas" find-node set-property +s" rtas-size" rtas-node get-property +IF + dup encode-int s" rtas-size" rtas-node set-property +ELSE + decode-int nip nip + over 2dup < IF ." No enough space for RTAS: " . . cr abort THEN + 2drop +THEN to rtas-size to rtas-base diff --git a/lib/libhvcall/hvcall.S b/lib/libhvcall/hvcall.S index 9f23624d3add..b19f6dbeff2c 100644 --- a/lib/libhvcall/hvcall.S +++ b/lib/libhvcall/hvcall.S @@ -134,13 +134,6 @@ ENTRY(hv_rtas) ori r3,r3,KVMPPC_H_RTAS@l HVCALL blr - /* - * A space reserved for a RTAS log from Firmware Assisted - * Non-Maskable Interrupts Option (FWNMI) feature. - * - * The QEMU implementation uses 0x30..0x800 for the log. - */ - .space 2048 - (. - hv_rtas) .globl hv_rtas_size hv_rtas_size: .long . - hv_rtas; @@ -151,8 +144,6 @@ ENTRY(hv_rtas_broken_sc1) ori r3,r3,KVMPPC_H_RTAS@l .long 0x7c000268 blr - /* See the FWNMI note above */ - .space 2048 - (. - hv_rtas_broken_sc1) .globl hv_rtas_broken_sc1_size hv_rtas_broken_sc1_size: .long . - hv_rtas_broken_sc1;