From patchwork Thu Aug 22 11:38:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 2848224 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B084A9F271 for ; Thu, 22 Aug 2013 11:40:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8666E20629 for ; Thu, 22 Aug 2013 11:40:43 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30BB520626 for ; Thu, 22 Aug 2013 11:40:42 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCTEu-0002Jm-Gt; Thu, 22 Aug 2013 11:39:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCTEO-0005c2-MK; Thu, 22 Aug 2013 11:39:13 +0000 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VCTEI-0005Zc-BM for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2013 11:39:08 +0000 Received: by mail-la0-f41.google.com with SMTP id ec20so1272756lab.14 for ; Thu, 22 Aug 2013 04:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BQUZn2EaEvRgWd7nuYIKCeEG3nYWAJ5F+78214T8HTc=; b=xyaqZ5tKs/CrcQdZMlt11YmV/bOZtio9OfjFK7yg7uoDWsPfogzQTngQ95hW4PO5sl 0cKegUkmHwABNV7s9q/JUCaKmQi7F9z5E95hsEBZOzJJ9jEOKQqW0O2rJ55zJGByV2uG ilhXKmSlv9RlWpY6lWLJBj8izZXx09YKSt1SGunwybQO/UPLcL7hujvheCZ7HKb8GL0P W6KKDBrVfdulHIFfLmi486xFI4HPAslhJAGucVYh80n8ngNyKCZrCkwuk/ZDGTpJefbW xjKy6QpmA03mWLtuKIbwPRhXjlQmPQ++HG1L5jGfOgwLIwtnWreG6n7i1eouDrIQJEUd tcEA== MIME-Version: 1.0 X-Received: by 10.112.141.98 with SMTP id rn2mr401188lbb.49.1377171522598; Thu, 22 Aug 2013 04:38:42 -0700 (PDT) Received: by 10.112.69.171 with HTTP; Thu, 22 Aug 2013 04:38:42 -0700 (PDT) In-Reply-To: <1374361670-3214-1-git-send-email-andrea.adami@gmail.com> References: <1374361670-3214-1-git-send-email-andrea.adami@gmail.com> Date: Thu, 22 Aug 2013 13:38:42 +0200 Message-ID: Subject: Re: [PATCH] pxa: sharpsl_param: fix invalid memory access in sharpsl_save_param() From: Andrea Adami To: "linux-arm-kernel@lists.infradead.org" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130822_073906_573706_C15B8A93 X-CRM114-Status: GOOD ( 17.13 ) X-Spam-Score: -2.0 (--) Cc: Marko Katic , Will Deacon , Russell King , "linux-kernel@vger.kernel.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I'm bumping this after one month. Will, I put you in copy because you did some observations about the patch last time and you seemingly committe the change which broke boot of sharpsl devices. Is there something wrong with it? Thanks Andrea Was: Devices that call sharpsl_save_param() will hang on boot due to a memcpy call that uses physical addresses that are no longer valid. This is caused by the following commit: commit 72662e01088394577be4a3f14da94cf87bea2591 Author: Will Deacon Date: Wed Nov 23 12:03:27 2011 +0000 ARM: head.S: only include __turn_mmu_on in the initial identity mapping ---------- Forwarded message ---------- From: Andrea Adami Date: Sun, Jul 21, 2013 at 1:07 AM Subject: [PATCH] pxa: sharpsl_param: fix invalid memory access in sharpsl_save_param() To: linux-arm-kernel@lists.infradead.org Cc: Russell King , linux-kernel@vger.kernel.org, Marko Katic From: Marko Katic Unbreak kernel boot (tested with kexecboot) Patch was sent twice upstrream: http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/137284.html Devices that call sharpsl_save_param() will hang on boot due to a memcpy call that uses a physical address that is no longer * accessible. Fix his by converting the physical address into a virtual one. Signed-off-by: Marko Katic [andrea.adami@gmail.com: checkpatch.pl dislikes void * param_start] Signed-off-by: Andrea Adami --- arch/arm/common/sharpsl_param.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) sharpsl_param.comadj=-1; -- 1.8.1.5 diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index d56c932..b70b13a 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* @@ -41,7 +42,8 @@ EXPORT_SYMBOL(sharpsl_param); void sharpsl_save_param(void) { - memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info)); + void *param_start = phys_to_virt(PARAM_BASE); + memcpy(&sharpsl_param, param_start, sizeof(struct sharpsl_param_info)); if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)