Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp41772ybi; Fri, 26 Jul 2019 05:52:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2Np/maytnPgR4NkgtePQJM2wjgchmdbThhvzCdV6azGkgE3rpWKA3vQoUe7lXLfe1YY2u X-Received: by 2002:a63:6c7:: with SMTP id 190mr90073521pgg.7.1564145545740; Fri, 26 Jul 2019 05:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564145545; cv=none; d=google.com; s=arc-20160816; b=hRdG9QjNPc7rFnkI8Qf5YsbSeWQ4GiwrtMScwX+e1zdUGxDyz2jfpPiT1CIA/dyrj4 3Uv8FIq1LrvxxaJpqC/waOowdj2ydkc99YWoh0l7rKFLqoM7tRok4U05dfyPoAbkn4rq TtkMRUBd5jEI8YyGgfO7Rq6SD92xFmM5rUs6h9ZIKG4D0lAfeHXgemq9ypLPns7e+38i F5UJFtKs8BykM8PUnBLHuBunCfUeYEsxN0eIq+UsopLE8+k/q3AT4aOq6fLAWCdpL8N2 F3CJdD3/izHGzcTnRtNDMO06j22OBwk9gdxtYqzhBlp9VSYSAZU31LS726qRMrfoEP5I bKRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kt6BXJD3ZuJvlYKXb8Fd1sHs8NHamXa5xOo26Vrwnc4=; b=ypfsVUWqW3dhbt6z/wpM3yqOQjrWrR/n9MuHbrTpQ2w1d8H3u5OtZjOEOmYGqr3++c u9hR/6sbFUObPDzD+nUwB6oEfxHZOfU03i/EB8XOq8wOTEeix5yfByzqE1rX+rb2yabj Jv2UKcYYdbAVfN00YNgHhQtDedhFChSBgm4+QcdFE04aywbT/CLie16STIhS6m/y7ec4 b9P9l6Hcn/OboZI5GdJGzDcOMvVQM3QwVp4YomoARxmOADYNAaqp+1wlJZAjiiTtgDG0 3gFDM1sg0KHWm5mvfe7sApqiYmMzM9VoGCZ93fljNagVaUMB7nF4Cqbe/Gb696JzNEQ7 bc8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XI94dtPG; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si20501384pgg.489.2019.07.26.05.52.10; Fri, 26 Jul 2019 05:52:25 -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=@kernel.org header.s=default header.b=XI94dtPG; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726900AbfGZM1f (ORCPT + 99 others); Fri, 26 Jul 2019 08:27:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:33158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbfGZM1e (ORCPT ); Fri, 26 Jul 2019 08:27:34 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82A4D22ADA; Fri, 26 Jul 2019 12:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564144054; bh=OZObsaiWD9C6Z4j0R2E6zW92OcmQ4NJIcSACVpKktp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XI94dtPGA09qzd+pPmSHGSws7MyNVI5CHU+LlA3L/oabxDaPBS25r/b8kvkbzzsWR /tS3yisVZV+qWyrvZ1rmXxYU+Z9oXdzXzsFQ4pZxGyFPOB8BqdW/TLE0yAiHOs/+lF kOjaQ6gZpQr9EJcTdi9mn8n8+55oCIJ/90x1cw9o= Date: Fri, 26 Jul 2019 13:27:29 +0100 From: Will Deacon To: Mark Rutland Cc: Anders Roxell , catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, "Gustavo A. R. Silva" , Kees Cook Subject: Re: [PATCH 1/3] arm64: perf: Mark expected switch fall-through Message-ID: <20190726122728.jhn4e6wq7rcowyi4@willie-the-truck> References: <20190726112716.19104-1-anders.roxell@linaro.org> <20190726121056.GA26088@lakrids.cambridge.arm.com> <20190726121354.GB26088@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190726121354.GB26088@lakrids.cambridge.arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 26, 2019 at 01:13:54PM +0100, Mark Rutland wrote: > On Fri, Jul 26, 2019 at 01:10:57PM +0100, Mark Rutland wrote: > > On Fri, Jul 26, 2019 at 01:27:16PM +0200, Anders Roxell wrote: > > > When fall-through warnings was enabled by default, commit d93512ef0f0e > > > ("Makefile: Globally enable fall-through warning"), the following > > > warnings was starting to show up: > > > > > > ../arch/arm64/kernel/hw_breakpoint.c: In function ‘hw_breakpoint_arch_parse’: > > > ../arch/arm64/kernel/hw_breakpoint.c:540:7: warning: this statement may fall > > > through [-Wimplicit-fallthrough=] > > > if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) > > > ^ > > > ../arch/arm64/kernel/hw_breakpoint.c:542:3: note: here > > > case 2: > > > ^~~~ > > > ../arch/arm64/kernel/hw_breakpoint.c:544:7: warning: this statement may fall > > > through [-Wimplicit-fallthrough=] > > > if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) > > > ^ > > > ../arch/arm64/kernel/hw_breakpoint.c:546:3: note: here > > > default: > > > ^~~~~~~ > > > > > > Rework so that the compiler doesn't warn about fall-through. Rework so > > > the code looks like the arm code. Since the comment in the function > > > indicates taht this is supposed to behave the same way as arm32 because > > > > Typo: s/taht/that/ > > > > > it handles 32-bit tasks also. > > > > > > Cc: stable@vger.kernel.org # v3.16+ > > > Fixes: 6ee33c2712fc ("ARM: hw_breakpoint: correct and simplify alignment fixup code") > > > Signed-off-by: Anders Roxell > > > > The patch itself looks fine, but I don't think this needs a CC to > > stable, nor does it require that fixes tag, as there's no functional > > problem. > > Hmm... I now see I spoke too soon, and this is making the 1-byte > breakpoint work at a 3-byte offset. I still don't think it's quite right though, since it forbids a 2-byte watchpoint on a byte-aligned address. I think the arm64 code matches what we had on 32-bit prior to d968d2b801d8 ("ARM: 7497/1: hw_breakpoint: allow single-byte watchpoints on all addresses"), so we should have one patch bringing us up to speed with that change, and then another annotating the fallthroughs. Will