From patchwork Thu Oct 26 01:19:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 117165 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp209382qgn; Wed, 25 Oct 2017 18:20:15 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q6wmdwXz/baejpns2hg/81DK3+Yw+0Ij2u2Sfragwg7Bf5lFETWeqiAXXuBxko6lFIfnJX X-Received: by 10.101.67.137 with SMTP id m9mr3566013pgp.63.1508980815629; Wed, 25 Oct 2017 18:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508980815; cv=none; d=google.com; s=arc-20160816; b=KTFQk0SJ/07nvAgHJetCD53ClpGHyUJTRluWTZI8FifqIzqSjpQVtvhTeq4vHVzHlV CLxejr5YyUr7IqVtJo4YaCcuNUdmJI4yFTmeVPX12exA/30z5ZUVTgiI/fYWqKSGp2uJ WwR4YSAcUdshKKnR8V9hDuzOcN7ynXEkmDjDD38EowRHRp/25A7PNK2KDqw6Ljo+oQ2/ J9eV0+P+wim77sQEJYkh0mVwjSDl1Ux5Ku0jRAo+2Bq1CdktKqV65dm+BIKlMsMf6bLN vmWHywKpAJTqh6Fsc/guL7Gkk/w8QQYLAzFtBfRDcev6xSgJF2YpAQ9vJPdp2DFKHmHV PA/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=9XAcvaokad9lVTckRS1UZeO8cFpVMWCOcHSLDsjcFtY=; b=GStQFF3owK5fFP8NICdRNFmiJrFKHGENmyKO5dB0jJm/7VDLMm5cSPYaigaNcWYvzN qQg7xbuSEJWJehGUCyxDJ8NNoAhjQZllBdA7p1hipSSRQoSOWNyzo+qEpoVrWVy5QvB4 1+GUghdcootNoUnGA39xTOcoBIhb+ijcZAG50GpxA95Zk5F6ELI8AbRoFWyrXHWobiti +3wihPD0FL6oKnYLRlpadEs0789IVjc2a0HBCiL5vjxMforCxioY27qX3qemB2nqFhn4 Bc5CoxRmQ/B+cXYWTSVisT7vqjNYfg6Qj3DL//n+4wKH7be7tQQkmWXds8a667kdT43Q VFzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=dLsGOSd7; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id k4si2572912pgp.727.2017.10.25.18.20.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 18:20:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=dLsGOSd7; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8E361203525E9; Wed, 25 Oct 2017 18:16:21 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::242; helo=mail-lf0-x242.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9FD3A2034A7B8 for ; Wed, 25 Oct 2017 18:16:19 -0700 (PDT) Received: by mail-lf0-x242.google.com with SMTP id l23so1914951lfk.10 for ; Wed, 25 Oct 2017 18:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PGSMb6osvv878jP+7KCx5d73pHqnezDsF/JTd4nmtJQ=; b=dLsGOSd7C5MzbYsBacIUhcE+a+nJcG/OUZYvVAkkS0LG0xy2s+4nZuHBbO9y6dm1ds oU4p/gtH4IFsef9pIGg4ORS0MbRAPAkNMvLR1Msd3ur8c5aCpgj3FGBlCvLrc4hbWxlH yAh8A4L4xLbOXcfz4lKVOkttuTl1ZMrsFw4IUlRn8r7vB0mMkfae8Vm1VpQtfyZiL6LY ngH0nAihvFKoWo/b3YnYPQCU1oKnlFuqytcDSmca/D3doG4HZ3Y5Y/gWG6k9GRSP3qBV PtyU90anWBNMK+o4UfBMvbTJLMpT/R5dXdRCYOHwuDzUNQvKC7AI7ucnUH5Z/wxzSZhT kK3w== 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; bh=PGSMb6osvv878jP+7KCx5d73pHqnezDsF/JTd4nmtJQ=; b=HEUzCUGN22iK5Ugxw2TtXCrS3MJkKieFmSv/mBekbJ45mwbEeAiIjNEOGS2Wk5UDCE 4bb4lR5nrF3T7RThJv/7eWhdNs3ebe9bLzNlLqVo9xb8n5H+IG6JuQfkh0MBolKAtScG sl2Lop85vHDyZbgGYlQ069OGBu77N8pD91wZiKcA+K3gZiLDD94iw2E/R/JQHMWuEylY zxodk+N+M/P1EuTWv6Ma2SdZoKDzfBn3YvCeS0obhJIas10Ng+4EXDbjUr2lvZIK6+zs xC5VhMPMeV6OQ8f3Lvvpisd8tz5L+VUYp2MEve/5Ty7TbsqccUCCTswJmvA1eF1fAy5V 2BGg== X-Gm-Message-State: AMCzsaU89r8FgVI1Ms/wONUraiI1jVOrKDTbA2mRS8td7YlhZ5WA88rc uS4WMRFv4QeCS6bjsFvBBRS0dGfRXw4= X-Received: by 10.25.89.206 with SMTP id n197mr7104024lfb.96.1508980803475; Wed, 25 Oct 2017 18:20:03 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:02 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:32 +0200 Message-Id: <1508980777-29006-6-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 05/10] Marvell/Library: MppLib: Disable the stack protector X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Ard Biesheuvel MppLib may be used very early (in SEC), at which point stack protection measures are more likely to cause harm than help, given that not even the UART has been configured to the point where we can complain usefully. So just disable it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Signed-off-by: Marcin Wojtas --- Platform/Marvell/Library/MppLib/MppLib.inf | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/Platform/Marvell/Library/MppLib/MppLib.inf b/Platform/Marvell/Library/MppLib/MppLib.inf index 2de9cd0..1268542 100644 --- a/Platform/Marvell/Library/MppLib/MppLib.inf +++ b/Platform/Marvell/Library/MppLib/MppLib.inf @@ -106,3 +106,6 @@ gMarvellTokenSpaceGuid.PcdChip3MppSel7 gMarvellTokenSpaceGuid.PcdPciESdhci + +[BuildOptions] + *_*_*_CC_FLAGS = -fno-stack-protector From patchwork Thu Oct 26 01:19:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 117166 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp209421qgn; Wed, 25 Oct 2017 18:20:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SqPEw2ks7M1CzEno57VuNAqjaC+XWhCULrK5MKQtUjc4EnuXr4DCzgYb3bjZN6HKQCqfnq X-Received: by 10.98.0.206 with SMTP id 197mr3852356pfa.194.1508980818852; Wed, 25 Oct 2017 18:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508980818; cv=none; d=google.com; s=arc-20160816; b=MiHgC/xNb454v8TXGjl+IagQfH28cXKRb4Z3HIhWMJJ94YS8l33dIbmERDMCdkqowW ULI0cpVMxIabGVR5x+uhAY0KjybcvMMlTh5n/xiIqZc4tmPNuFoquElUw/o3YayQ33ph ybqH2ko0O7FFuMbxdtcmyjY7X2RZz1phbFeppgdXuU8P2+qo2C93p+H/jen901Geqefz 9fcfjpr14nBthhgoAMNdrS1NS3ZWyEaOI1E3WMUrr6gYQdRVxXz23R5I3WvN23nB0Nr+ rBVQ4s6yW1fk2+lyBRrI72dyH46V/bJHYUgbj5Ff1ImeW/V0y1d3ASQvMMwuXCnH5H3q DzKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=sFVmVrE4+sFgawPxrFpVGHSJMy+tCXv8jl31xrNeS/U=; b=eHj0MXIFo1qj98QhClkFgPJdkHypsxQ6fIH95E/4lklJyHtJHtlGrxufrPnHKdLoQJ IhvomXF5kdBsW4lQOKZxhDlL1P7jeanLoyARv9oy5fir3auEb5wu/kVeEDru/ItROyh/ rolJ6gyPQcvQ6gAwApPqLRZx+kpQunYhoNJWdxD7A79V8BqeVvZk7x3gGG04UetD1WXc AH9oJJfxheem18NsggVEmhxz7lekZz1jopg2L3wP8mdlzA0kfhlkdEjKqg1ujvcDciBy yzPxPTvCYPosAKccZTXxr/Sa6dIRhgcZk8YjGe4Z6JdC7Os9FTmIMwXFoTXCpr5ooD5I qfqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=LBDo0wth; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id z100si2285129plh.355.2017.10.25.18.20.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 18:20:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=LBDo0wth; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C5A15203525EE; Wed, 25 Oct 2017 18:16:23 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4010:c07::244; helo=mail-lf0-x244.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 097EE2034CF85 for ; Wed, 25 Oct 2017 18:16:20 -0700 (PDT) Received: by mail-lf0-x244.google.com with SMTP id a16so1955037lfk.0 for ; Wed, 25 Oct 2017 18:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IbWJkKgQEEoKEyONm2oA23Q1NdAKtg79W2BuT3BphZU=; b=LBDo0wthF0ASo1+V10FN2h5VZMZbuA8FIdcIzdsrPZZhBUSpG0upFEbqPfe3X2cuZF tINaOIN37OOI5cmbRtyBMyHCyYQ8a0u/vTG2sy48to8bOPnGuHWdTxAtnQ3PSY3xJ49n 055MrV5D0yfUvAjrmtvAfEEM6efoJOgOg9Z0P2QnBTxLu9+zgRqHuYCqWyjM1G1Js+6K N0KLnSG8tn/BrUprap/ewC2pfIA6p+ZX1yFAf8NU8sR3JKRSs9mdl3oXqBg4BEa+LqrK g0/lvsEDYTLqGEcdWgxWufggofv2PN/gTo4H13rr+/ou1I5C5vhotS87abAiPdMyHG4g mZrg== 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; bh=IbWJkKgQEEoKEyONm2oA23Q1NdAKtg79W2BuT3BphZU=; b=glKn2XnB9npFGHc7d1zZRK6aGlqKd28CzQGDvqmKkzXPHWzZwZFWXese0/9SqHggWH czFGhYhsDRIj+lvXtdkcL3a+jYsRRcyeqx8OAwrja6udRosX8NE6XULZKL0KoDyF5yGY Rfvpdhxso/ZucnbH5qk69jcQ/HtMT8KspwYTFIFzn2QMAY4ZlJx6OowrCU4oqiG/a8nZ voW3msdu9wMlmxrwzcfEGk4iDv9GH6knHI0055d2a/m32SA54XnETpV42eB22QYIb+Uo u3SGfJmTWnYPrfvDx1e5F/YghS71xin1EfqzAA/fNbboOW+lMz1Ezk5C1//GCxPrpfNN Xeag== X-Gm-Message-State: AMCzsaU8FO0kTR8S5fC5eC0wHirkwvRtTC8Df9lAbxUdKUavoHpiqJLS SsXH7ho1g713x1Adpgjtfdn9vMjbstY= X-Received: by 10.25.22.28 with SMTP id m28mr7634963lfi.185.1508980804694; Wed, 25 Oct 2017 18:20:04 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h26sm1053428lja.69.2017.10.25.18.20.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 18:20:04 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Date: Thu, 26 Oct 2017 03:19:33 +0200 Message-Id: <1508980777-29006-7-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508980777-29006-1-git-send-email-mw@semihalf.com> References: <1508980777-29006-1-git-send-email-mw@semihalf.com> Subject: [edk2] [platforms: PATCH 06/10] Marvell/Library: MppLib: Take 0xFF placeholders into account X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jinghua@marvell.com, ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Ard Biesheuvel The MppSel definition PCDs contain 0xFF placeholders for values that should be left untouched. MppLib needs to be taught how to take those into account. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Signed-off-by: Marcin Wojtas --- Platform/Marvell/Library/MppLib/MppLib.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/Marvell/Library/MppLib/MppLib.c b/Platform/Marvell/Library/MppLib/MppLib.c index 383c820..9e42f08 100644 --- a/Platform/Marvell/Library/MppLib/MppLib.c +++ b/Platform/Marvell/Library/MppLib/MppLib.c @@ -79,18 +79,22 @@ SetRegisterValue ( BOOLEAN ReverseFlag ) { - UINT32 i, j, CtrlVal; + UINT32 i, j, CtrlVal, CtrlMask; INTN Sign; Sign = ReverseFlag ? -1 : 1; for (i = 0; i < RegCount; i++) { CtrlVal = 0; + CtrlMask = 0; for (j = 0; j < MPP_PINS_PER_REG; j++) { - CtrlVal |= MPP_PIN_VAL(7 * (UINTN) ReverseFlag + j * Sign, - MppRegPcd[i][7 * (UINTN) ReverseFlag + j * Sign]); + if (MppRegPcd[i][7 * (UINTN) ReverseFlag + j * Sign] != 0xff) { + CtrlVal |= MPP_PIN_VAL(7 * (UINTN) ReverseFlag + j * Sign, + MppRegPcd[i][7 * (UINTN) ReverseFlag + j * Sign]); + CtrlMask |= MPP_PIN_VAL(7 * (UINTN) ReverseFlag + j * Sign, 0xf); + } } - MmioWrite32 (BaseAddr + 4 * i * Sign, CtrlVal); + MmioAndThenOr32 (BaseAddr + 4 * i * Sign, ~CtrlMask, CtrlVal); } }