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 X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00660C433ED for ; Thu, 13 May 2021 16:57:52 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 712766141B for ; Thu, 13 May 2021 16:57:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 712766141B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=deoj5r+1ZQ/r3oJpsH9XukTrqLt7cclVy5znVrWOfxs=; b=g6KknFDBybZSrKfjS58F7rjMb CmuJRXVyZHZJEy9wNF90blroUxDo0QdqmCZFaGvHdZP9Q0piWj2aEFThvfDtXLOVRQZYIarwqNcUk qdSjHp7GAb2a/qQVlNNfeXWnIenjS0q9EZsnSAW59KCiuZaTTvS6VnOLt69FJeCiFq9TO5Vtlc/F4 KGmWvAOzushidXVz/gJE+iV212yzOTk+mKf6Cx3NLVd2WQfCNnx1JUTIVGWydcGM4VlusazJD18co UKP8dAEo+olu+bMJe65wRiGHLQ0Xi8DJe8PvsOZ/9MN3OzZpAgi43duZ+kIL61RLHGz0y9Z4MG3GR qwSXBW3FA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhEdJ-0060uf-FL; Thu, 13 May 2021 16:56:21 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhEdG-0060u2-5P for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 16:56:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OKzWhLh/2ztTaz3pJr9lNRplkx0NJJXUqiJozq9z0pc=; b=y9HEsWjTNJTsuI42UGUxF3NeR9 2el041p39IiNW00GS12AdWeptkrrN8ZmcNPn1DLLBQ5TFAW6rHzWHzsdm3r2k1i8sAiJTJi3uKcW+ 2ejMHWGy/qp6QY68FKDcJ7p8DXdGkdV6yMDESpdxATHt+ULj59N5nTw+cqTYavGmANP0HzJQGdO+j IzJiQvm4wcG4E6l0HoAYFwfk0sVslCvK0IdxB8YHSzjB7PZaxKgOSr7TVWy8RTfh0jT/EGcMZLPjq FDfaayLhXA6P63yZd3c0Mvir3mD75cAupfijsFKDHQg9mP0tmWwYjD6pqz3yVSL0fKIdGwITBLbM8 1Prt07PQ==; Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhEdD-00BOmW-FG for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 16:56:16 +0000 Received: by mail-il1-x130.google.com with SMTP id p15so23578288iln.3 for ; Thu, 13 May 2021 09:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OKzWhLh/2ztTaz3pJr9lNRplkx0NJJXUqiJozq9z0pc=; b=HrBK4JSIDwj7xZ7TRw9Xi+sb4qhE9sTDpGTRlJu8s8aWgm4gGecupIaxgG/hg5iFw9 npwvyRfNNXvE5nTOuJX/gE6URNgpbc4iFPjlyzSTS3mZ8C35Q/0HOwXZg0Iv20qjJCsR 9xRpBFSJnMi1MYzUcluiXhaMJSdxcy0X5cYlgFcZjHQc2EpBmFGzwdx93YdTYjn8Ldas ih4wz/YPxAz1oX1Bs6iVHn0c3N4ln0g1n2E5nDxz0jPGjJ0IHLBzS29FSEzpbymy7Ntz bT/62Tq5/egzC7zktE01jWYyOtRKR3frvbQC8e00P1OFUTIdM1IedAQoEFpbEH4Zv/Wd W8qw== 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=OKzWhLh/2ztTaz3pJr9lNRplkx0NJJXUqiJozq9z0pc=; b=FyCpUgRqASkrF+b8Fb3Y5SkfnyE6d8CZ9HCNz/3Zrc8VuMtr6IADK48D6Bx1LfEaxS 4EAzKC5wfzBGNgRPToJKsixqnPUy/o+g8f2p8eMWtdQ2rfZEcV95zoD9LTdlYzp5ONW8 MLxiyYBEuwWOP8Mey6ac/7cSNTrBdg9+Mj7U+9XWX2IXxhdiuU019wQABHqvpVEAtXza Px6nC5ek7tMj4dXaJdsdjgsanx86VEpsV/VUNfiO8/7w6Wfm4LBg9YIibKww4XkfRjGo Oyxi8vk15wcIZPduXM8/+7JSm9Uy9byCvEvZ9nPmXvwr+6WyTHeZI1XvZSOqfZXdbZWM IzFQ== X-Gm-Message-State: AOAM532x4diQbNRTNHG5pvhMwUoqosB6FC4mYNoJY+KEeuk+7EyHoVny MpG5fD+1uPkB4e3/+06Vu08Cc5XgPCCmsTpYu5jxPA== X-Google-Smtp-Source: ABdhPJxmf6DeQlzaXgQrqYxdZx++pVu5vIs2llJHC71T37Ts/d666Ni1ltLnrjcTUGpM19pzMjstAdCoTbQGcY4/YNE= X-Received: by 2002:a92:d1ce:: with SMTP id u14mr25927513ilg.61.1620924974187; Thu, 13 May 2021 09:56:14 -0700 (PDT) MIME-Version: 1.0 References: <20210513022709.983982-1-pcc@google.com> <20210513022709.983982-2-pcc@google.com> <20210513091633.GA10886@C02TD0UTHF1T.local> In-Reply-To: <20210513091633.GA10886@C02TD0UTHF1T.local> From: Peter Collingbourne Date: Thu, 13 May 2021 09:56:02 -0700 Message-ID: Subject: Re: [PATCH v4 2/3] arm64: stacktrace: Relax frame record alignment requirement to 8 bytes To: Mark Rutland Cc: Mark Brown , Will Deacon , Catalin Marinas , Andrey Konovalov , Evgenii Stepanov , Ard Biesheuvel , Linux ARM , Andrey Konovalov X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_095615_546655_D8F4A701 X-CRM114-Status: GOOD ( 25.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 13, 2021 at 2:16 AM Mark Rutland wrote: > > Hi Peter, > > On Wed, May 12, 2021 at 07:27:08PM -0700, Peter Collingbourne wrote: > > The AAPCS places no requirements on the alignment of the frame > > record. In theory it could be placed anywhere, although it seems > > sensible to require it to be aligned to 8 bytes. With an upcoming > > enhancement to tag-based KASAN Clang will begin creating frame records > > located at an address that is only aligned to 8 bytes. Accommodate > > such frame records in the stack unwinding code. > > > > As pointed out by Mark Rutland, the userspace stack unwinding code > > has the same problem, so fix it there as well. > > > > Signed-off-by: Peter Collingbourne > > Link: https://linux-review.googlesource.com/id/Ia22c375230e67ca055e9e4bb639383567f7ad268 > > Acked-by: Andrey Konovalov > > Reviewed-by: Mark Rutland > > Tested-by: Mark Rutland > > --- > > v4: > > - rebase to 5.13rc1 > > I think the rebase went slightly wrong; note below. > > > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c > > index 2fecbf152e80..020e575e5cd3 100644 > > --- a/arch/arm64/kernel/stacktrace.c > > +++ b/arch/arm64/kernel/stacktrace.c > > @@ -68,7 +68,11 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) > > unsigned long fp = frame->fp; > > struct stack_info info; > > > > - if (fp & 0xf) > > + /* Terminal record; nothing to unwind */ > > + if (!fp) > > + return -ENOENT; > > + > > + if (fp & 0x7) > > return -EINVAL; > > The terminal record check got moved later in the function by commit: > > 8533d5bfad41e74b ("arm64: stacktrace: restore terminal records") > > ... so this patch shouldn't re-add it. With that gone (and this just > changing the alignemnt check), this looks good to me. Thanks, fixed in v5. Peter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel