From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B86B0C433EF for ; Wed, 15 Jun 2022 13:22:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3815844D3; Wed, 15 Jun 2022 15:21:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="4VgvCgWx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 55FDF844B3; Wed, 15 Jun 2022 15:21:38 +0200 (CEST) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D75EA844A7 for ; Wed, 15 Jun 2022 15:21:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x62b.google.com with SMTP id o7so23219347eja.1 for ; Wed, 15 Jun 2022 06:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1PSFw/GXIunUH9AyDLtTr1daRQcTtBjiK6dcDxt5n/M=; b=4VgvCgWxLP83jAGTBIhqilze7TdVPjE4oRNrMyBn/NwWkSpYW8aK/KT5u7WIzHkkxM 2gcrKVphmwPsBnotaaHT6a/Vgmh5mA2u6w8BuAVh6a49uIjjRoyN2SJUdrJh1yjyD/OE YqMDannndo95V3GEt19OZIUizM61Lfi62LvfsU2Xg7m8qEmPdEoSwgkaQIsvZSOHssIN 5DpgUvdu3lFn8Z/AFAqNiNXPIcnK8aSOw525SrKMA63e2HQCCp959uxG7/xnof4Vq+Ja 2zvnPIRozdhF86QwgM0qqOt7B9zHA1z7SflCAnAwopuGyCxECoS+y9S3dVyNasKDieeO PnRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1PSFw/GXIunUH9AyDLtTr1daRQcTtBjiK6dcDxt5n/M=; b=keo0u6uChYkQOFOkxQBc1V+wpA6+quy2eIXWacKvwydwECLAEEYKY6x3/5hQO6AbFK X8rAjo1d6LZK9GOJw1Y/eUdD+pHohspY3CcA92ONEmadphQgiQQpVvwjKUOStJaRvf90 9P/MStF/3GbDNSnaDD3FYmrk6i4/BQzzbq0KDqAG1bbzI1bWLUbzsHilvZYtQPeuJgPU md5apAn8AtVf6t0YxYjNHWvT55l22FBsgEFTeV592vR/zLk9kktA8qaR4ywPCnkSvujX ZxRN0KoDwo3V/U/Ouy1GKGop7xuesAkrhM7RGjR9/WcwYZIEabHpAwUDgsP5Aas7WVge wyGg== X-Gm-Message-State: AOAM532u01lWqqv5O77NgjLWzKnJSYz5pU4bUcImGHJaiA2FtlrP2hCu U1BoTgK8foG8QLgPUArH/12c2EeI5SoSdg== X-Google-Smtp-Source: ABdhPJxglFAxTT2rwuscch5KLbLWXpr8/SgRw8yCsYNn/7xAwXqRnbxdXe7HcprGoVbPneSv6xkamA== X-Received: by 2002:a17:906:7a5e:b0:6fe:d93d:21a3 with SMTP id i30-20020a1709067a5e00b006fed93d21a3mr8914805ejo.596.1655299295212; Wed, 15 Jun 2022 06:21:35 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id l22-20020aa7c316000000b00431962fe5d4sm9302724edq.77.2022.06.15.06.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 06:21:34 -0700 (PDT) From: Michal Simek X-Google-Original-From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Michal Simek , Ovidiu Panait Subject: [PATCH v4 06/23] microblaze: Fix stack protection behavior Date: Wed, 15 Jun 2022 15:21:02 +0200 Message-Id: <86b9748bad12142659804d6381bc6bbf20be44f1.1655299267.git.michal.simek@amd.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean When U-Boot starts stack protection can be already enabled that's why setup the lowest possible SLR value which is address 0. And the highest possible stack in front of U-Boot. That's why you should never load U-Boot to the beginning of DDR. There must be some space reserved. Code is using this location for early malloc space, early global data and stack. Signed-off-by: Michal Simek --- (no changes since v1) arch/microblaze/cpu/start.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S index 9e00eef1f4b6..715ef37b39d9 100644 --- a/arch/microblaze/cpu/start.S +++ b/arch/microblaze/cpu/start.S @@ -15,8 +15,9 @@ _start: mts rmsr, r0 /* disable cache */ - addi r8, r0, _end - mts rslr, r8 + mts rslr, r0 + addi r8, r0, _start + mts rshr, r8 #if defined(CONFIG_SPL_BUILD) addi r1, r0, CONFIG_SPL_STACK_ADDR -- 2.36.1