Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5526729ybi; Tue, 30 Jul 2019 22:45:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8Yr/ccKWtW5LUq54WH1c7B1Ih3z/IVKdi+DXVs16YmmtyNSwcpkFrbkC9/xhwThfB/OFM X-Received: by 2002:a62:5c47:: with SMTP id q68mr46349253pfb.205.1564551959185; Tue, 30 Jul 2019 22:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564551959; cv=none; d=google.com; s=arc-20160816; b=kC+2MSdX52bfmfXfZy84CZXPg+a90z+owg3WOv5w0Pyk/ziQilslHw6rnmiO/tKb+/ 3N+U42349nT6+UycRcy+c46C5pKFBHnFwBGDRQyrVA5yGyJ/SwyOXopyMVKPcGllF8vI SV9iG/5wWw/tdoXNDyK5nTpxQ7N9rWyrpRvcCVeeZHA83v6Xoh0UXj8J6JSC+lDAeaY0 O51C0YPZlY2csHECsSthV/fecTaNrLKCKEMnX0i3zYqjw6PWn/Dc2zoTAPYuTbrUS+Rm jsm7Z9N42zHpSoRacVKUjr1d4zTtrwzGrLGXiYKD5ggraDxFzO8hs4Y1nQOsVjE2/oV1 a5/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NFVesl0ZnOpQBqtMqV5lpfo1vwR6WRneLNekq2w+A+0=; b=ctFiGVafIFwAagbTZu7NwyeXgcZ/+WJEHdS1tb9SA5Rpu/uYjJhCLh45wrzMdeVZuM JRDnElXpqex2fVSDCAhvZfDhMqASAKIINHBpnYLZJcYEKME10GYRwplqZGkwYQkunggB d9jPeYGzq0RfIQ0eqoQCckXFl9Smt+9VOvcGcb2ipRXCQ1kaDx3FvWx5Y87uXp2nWP3T G6y+Cn4q4Rm9y4ZSLG4IRUE2GlDsfZzibJHHprFmVFtj1X8lpFtd90xngHwOLjMn5rBh I0XKLgE9pDTG2ygh3EU51q1LfUhM48P0JrmKREjTPvtwweHsWhfD9IfyODPLEg1YI9yp yRSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r1wIjjla; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g191si31449037pgc.331.2019.07.30.22.45.43; Tue, 30 Jul 2019 22:45:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r1wIjjla; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727656AbfGaEND (ORCPT + 99 others); Wed, 31 Jul 2019 00:13:03 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:33071 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbfGaENC (ORCPT ); Wed, 31 Jul 2019 00:13:02 -0400 Received: by mail-qk1-f195.google.com with SMTP id r6so48273457qkc.0 for ; Tue, 30 Jul 2019 21:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NFVesl0ZnOpQBqtMqV5lpfo1vwR6WRneLNekq2w+A+0=; b=r1wIjjlaOUYXC9i0CtRzf8gVkGR6i7HDy0I7VVJKls8IoU+bJTFRBj1qe/DGeZNwS3 mgGjvWiGMKJ5bP8brcspcZO4X4V9eenYomQN3tD6rEkVc0vAb+6ZpUSxr5z+Ixu7M5LS C+dQ4sCispoR+WPJbpeV4A3KmqkmKV8aNcP8bUq37kWCpCN8HmKmrmVc8vrmnmmS5a1z pllvWFZjj4465RcciKSuD8r9iNFT9t0DU+fajvZmzT+qVTZnQCeDyTZZLsYvTPcta7Vy 4NaCttjGVF1oboy6iznh59NugAeylu++kg+f7wcyJVdYPc0G39Hhm3wTwrIOxZ+x8oOL cRHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NFVesl0ZnOpQBqtMqV5lpfo1vwR6WRneLNekq2w+A+0=; b=DCnTqnMdb8WX/NLn5qvdUkxc1RpiAUsVpMA/1C13IudOQnSlGgC9wXole3ZnzqUdl6 3jlD7/IwofugdPmzoc9dSOeVqnH5HGJUqp1H8mxfWBzT/4WknsLLgXzZA7AgkZsH6fAj iIOjVI/DZWs0RO5kKUefvnCCSpQvKb2AnoWx1T4J1ykbHJ1+bwlb2k+zrle8zFwFlx7x UmAzmJBpdw143ElLDo2AZlqLJ7SH1Gx6QrGRF1X2ssq7p64iX1hBJqT0NluLnutVsuZw pTFKSeEti2JPXmaRUJDaMCt+RstVnRLv+mo6yVhqek4fXunsNYFQveguo3Q76wIrPHKE pnHg== X-Gm-Message-State: APjAAAUMyXKVhT7la54ZK4CHDmbDsmV2i0jkCQbFe88y3OtnNIqZW6yr UDiQ3jnI4KpUvN3/vADLhpMPbbZLmanqfy7XgyfToUN9 X-Received: by 2002:a37:5942:: with SMTP id n63mr5572295qkb.69.1564546381707; Tue, 30 Jul 2019 21:13:01 -0700 (PDT) MIME-Version: 1.0 References: <20190730044326.1805-1-luaraneda@gmail.com> <20190730104746.GA1330@shell.armlinux.org.uk> In-Reply-To: <20190730104746.GA1330@shell.armlinux.org.uk> From: Luis Araneda Date: Wed, 31 Jul 2019 00:12:11 -0400 Message-ID: Subject: Re: [RFC PATCH] ARM: zynq: Use memcpy_toio instead of memcpy on smp bring-up To: Russell King - ARM Linux admin Cc: Michal Simek , linux-arm-kernel , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Russell, Thanks for reviewing. On Tue, Jul 30, 2019 at 6:47 AM Russell King - ARM Linux admin wrote: > > On Tue, Jul 30, 2019 at 12:43:26AM -0400, Luis Araneda wrote: > > This fixes a kernel panic (read overflow) on memcpy when > > FORTIFY_SOURCE is enabled. [...] > > I'm not convinced that this is correct. It looks like > zynq_secondary_trampoline could be either ARM or Thumb code - there is > no .arm directive before it. If it's ARM code, then this is fine. If > Thumb code, then zynq_secondary_trampoline will be offset by one, and > we will miss copying the first byte of code. You're right, I tested what happens if the zynq_secondary_trampoline is ARM or Thumb by editing the file where it's defined, headsmp.S When the .arm directive is used, the CPU is brought-up correctly, but if I use .thumb, I get the following message (no panic): > CPU1: failed to come online This seems unrelated to solving the panic, as the message even appears with memcpy and FORTIFY_SOURCE disabled. I could add the .arm directive to headsmp.S Is that your expected solution? Should that change be on a separate commit? I'd like to know Michal's opinion, as he wrote the code.