From patchwork Sat Aug 7 04:13:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1514545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=WHA2HwG5; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GhTW02Zhzz9sRK for ; Sat, 7 Aug 2021 14:14:04 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GhTW00b0Sz3cSJ for ; Sat, 7 Aug 2021 14:14:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=WHA2HwG5; dkim-atps=neutral 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::1035; helo=mail-pj1-x1035.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=WHA2HwG5; dkim-atps=neutral Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (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 4GhTVw2cMZz308G for ; Sat, 7 Aug 2021 14:13:58 +1000 (AEST) Received: by mail-pj1-x1035.google.com with SMTP id mz5-20020a17090b3785b0290176ecf64922so25533322pjb.3 for ; Fri, 06 Aug 2021 21:13:58 -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=i9k7rH0Hxkl4RgfmSWzO4mBd5SizxvTJAShwtdvH2L4=; b=WHA2HwG5WR+m/yLOde2mvnQJLhzIAMmnlnaCrgui9ZDOfG+zpHUSZLv9GwtRo4/wyz y3wlexzgLMWi2+0cTid2hrCXfiEXtvCqrRlbk5P+faanLK+E9pcu55CV/Dvj8a/5np8g StbBBLUsYL6cuC1Lygx2MluAUyibIG5KC55Op16mZr88TwEfIT1udJa+z7teNw0S/Duh XxsoffO4I1xX29h5OY9gV2Ru19Olk7lS0ff0hx1oUOy2nHx9YBzqAi4q0fgfBoXRQpJd oOVOC5qnE9EU4gVjBPlWS5LwqG3obJc5HS4ey7fdfrnlT3FjWmcxKn5mq5nmjMD90Lko 8mAA== 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=i9k7rH0Hxkl4RgfmSWzO4mBd5SizxvTJAShwtdvH2L4=; b=Fn7pTK2wQADaCIy3N+MWsUSQRqV0LpeoyOxk4d7penDfUc16vHGFwyaDIimn1jnVjQ 3kp9auLajKjVBjOn7LF8ms9G3eacjg4DBP0rx1RlQQ6oZ2OhmlbIJRajtUxTxVmi6mey sj64UvRG3dnH8NJIH4Djyx6gGUIbTcy032lj08Ck63x1NoglvsTqCyquHPCfWygyIOKf l0jekdJ0YWUDj287bmkIifeoBtpzpGLVWwO2fB5vUgr4Op4sE/3Zx8X9xmu9r8s+cJ5p 4oraVjRt8ivGV/PLTJzdr5VgXv8fxP98+lVi4p/axLFc6QZWzDi0UZ55JbuRpVzfr/5t xc0A== X-Gm-Message-State: AOAM530AErSsrtiwr9+3eZkQ/3jNqRXlgXz8FgC+hsXLYYhtF3PjqfN2 IkxPOjVb3sH0d1Xxi/ZHqFI4BRNNofA= X-Google-Smtp-Source: ABdhPJzOzf7AVaLRFVMGVrvDfaIwyaR5aWEuL+tVhFsDDjgjIWb87qEXu30M7F+iMYhw4P+4VqesKQ== X-Received: by 2002:a05:6a00:1307:b029:308:1e2b:a24b with SMTP id j7-20020a056a001307b02903081e2ba24bmr13805474pfu.57.1628309636202; Fri, 06 Aug 2021 21:13:56 -0700 (PDT) Received: from bobo.ozlabs.ibm.com ([118.210.97.79]) by smtp.gmail.com with ESMTPSA id u15sm12470877pfn.91.2021.08.06.21.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 21:13:55 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Sat, 7 Aug 2021 14:13:46 +1000 Message-Id: <20210807041347.395291-2-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210807041347.395291-1-npiggin@gmail.com> References: <20210807041347.395291-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v1 1/2] asm/head: Fix P10 HILE for little endian build 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" Fixes: 891ed8df67 ("Initial POWER10 enablement") Signed-off-by: Nicholas Piggin --- asm/head.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/asm/head.S b/asm/head.S index fa8933b14..b2755344d 100644 --- a/asm/head.S +++ b/asm/head.S @@ -829,8 +829,13 @@ init_shared_sprs: /* HID0: * Boot with PPC_BIT(5) set (dis_recovery). * Leave bit 5 set to disable recovery (due to HW570622) + * Set/clear bit 4 (HILE) depending on skiboot endian */ +#if HAVE_BIG_ENDIAN LOAD_IMM64(%r3, PPC_BIT(5)) +#else + LOAD_IMM64(%r3, PPC_BIT(5) | PPC_BIT(4)) +#endif sync mtspr SPR_HID0,%r3 isync From patchwork Sat Aug 7 04:13:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 1514547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FQ6oTqsT; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (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 4GhTW82cHZz9sCD for ; Sat, 7 Aug 2021 14:14:12 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GhTW81vnZz3d8x for ; Sat, 7 Aug 2021 14:14:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FQ6oTqsT; dkim-atps=neutral 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::636; helo=mail-pl1-x636.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=FQ6oTqsT; dkim-atps=neutral Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (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 4GhTVx1Kr8z302v for ; Sat, 7 Aug 2021 14:14:00 +1000 (AEST) Received: by mail-pl1-x636.google.com with SMTP id bh7so994905plb.5 for ; Fri, 06 Aug 2021 21:14:00 -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=6TEMGHyQ1zKRSoIQ01Rc/G2THqX50pfEZfj9YNUvH7I=; b=FQ6oTqsTEx2k43CxXHyqapsK59Xu2iSmGfzdAz6Z8PrQZ+gqNK7tuHSMCJCf775pLv Sh3LuGxIlxJWPijJQ639lKp+Cv4CmwuFftNH7ei8Tp6Q/zRZaPqyIPOHhXpk6X0AdkUb PCGcdH8RECO1r2nPLUX4/1/Rj49yW8xGCkeRCugBYtEHU8gWXf97dkqyDNiRT5eaSsZC W+wNg3hcxtRpokAcIaXIWO98ujH5PGST1P5fbmkx1hd5Cf6oZnoe7fvaitOsTn6nMsDz c5EFL2wi+RpFxYxeGU2zBXKtxO1BMc74jbxnEvAMUBr8e/QgetQcXxic4D37oxeAKRbM IdMQ== 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=6TEMGHyQ1zKRSoIQ01Rc/G2THqX50pfEZfj9YNUvH7I=; b=kNhkqdZbFVbvHgC/rTudx1yiw/PpmUhBKscg6+6VgV5499ujpV+lYz1CfQbtCn9Yvb qHR6uZeZBTJpQ0wT8iwOHgszjuuwgUrQ0Pry8SfJJo2tY3B5B3OqdgeEqPlWc7IunBZD zI6nogIHkp2l8v7Lf9V1dp0roL4iEIcA6Wic/UYmZTgaESiaWH/dVDELx39U64RkAhIV 13GRUGLoLoqrlcyDSKokC7wMP9Fx/b0t2+vczwiZZs2Tb0khKJB1XoAQ7FAH3g6Sc+xn jTUshitnfvv3Dyfzyr3et+M78TObYF+VUFy6KIi8SqsWcXqEgiQaRPKipJtZKDEk3J8B 8tJQ== X-Gm-Message-State: AOAM5312kPoVQDQOdWuYqnRpcM2R0UL3Beta+sSz5LzlE0V7i0BbFIHi rsjWuOMTTdXDzydxYkmm9uo+Qgj59CA= X-Google-Smtp-Source: ABdhPJwuH3EBLb52E7HIrHuD9A43OFoddy6XpiGLvviT0TlSUxlilwerdHOvHEl19rBnd7b4orj34A== X-Received: by 2002:a05:6a00:2b5:b029:3bc:3183:c370 with SMTP id q21-20020a056a0002b5b02903bc3183c370mr13826526pfs.68.1628309638349; Fri, 06 Aug 2021 21:13:58 -0700 (PDT) Received: from bobo.ozlabs.ibm.com ([118.210.97.79]) by smtp.gmail.com with ESMTPSA id u15sm12470877pfn.91.2021.08.06.21.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 21:13:58 -0700 (PDT) From: Nicholas Piggin To: skiboot@lists.ozlabs.org Date: Sat, 7 Aug 2021 14:13:47 +1000 Message-Id: <20210807041347.395291-3-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210807041347.395291-1-npiggin@gmail.com> References: <20210807041347.395291-1-npiggin@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v1 2/2] Build skiboot little-endian by default 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" LE is the way to go. Significantly smaller, less stack, faster, and with later OPAL calling convention changes, it can avoid endian flips when called from an LE OS, and there are other new features in the pipeline that may initially only be implemented for LE OS and LE skiboot. This reduces skiboot.lid.xz size by 10KiB. Signed-off-by: Nicholas Piggin --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d236df9ec..6e5b91d84 100644 --- a/Makefile +++ b/Makefile @@ -48,12 +48,18 @@ KERNEL ?= # STACK_CHECK ?= $(DEBUG) +BIG_ENDIAN ?= 0 +ifeq ($(BIG_ENDIAN),1) +LITTLE_ENDIAN = 0 +else +LITTLE_ENDIAN ?= 1 +endif + # # Experimental (unsupported) build options # -# Little-endian does not yet build. Include it here to set ELF ABI. -LITTLE_ENDIAN ?= 0 -# ELF v2 ABI is more efficient and compact +# ELF v2 ABI is more efficient and compact. +# This can be set for big-endian builds. Clearing it for LE probably won't work. ELF_ABI_v2 ?= $(LITTLE_ENDIAN) # Discard unreferenced code and data at link-time DEAD_CODE_ELIMINATION ?= 0