Received: by 2002:a17:90a:37a3:0:0:0:0 with SMTP id v32csp13094222pjb; Fri, 26 Jul 2019 05:14:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3z605eXNsrp2meWXdm0etiXp4zhIRo8OSinjno5k1uwWbAUYSzGXM89O2Z4Rkbw8p0wsi X-Received: by 2002:a62:7695:: with SMTP id r143mr22664031pfc.173.1564143249709; Fri, 26 Jul 2019 05:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564143249; cv=none; d=google.com; s=arc-20160816; b=POlHBHHHd2eHEbOqysiRM1u0vqgaJ5kJ8IRvu91fn+Mrrfal63qoTCMh5+j04EgULx +CADqqoeOhjDQlUpSkj7UFMCiQOKpc+du+rqt9NCVR2X9brcg+cAnr5Eda802nruqfa2 DVEEBYub+zXdXIoYobujf/oLzgFlzgio48fQazfodyqgEamy5lSMyVnh0uAwxOVSA2Gr rXCKzVk8EBVD7r1QgWgi2eN36PwPWI6fSG9KzJ3SZMK3Jbuuj/s0d4G/3bMnb5pXwaJa sEmw16pxMaVRYTH3nCrIpd28I3dOdiLBQs9ITNgYDTdsW4I1z98cjuWzd+esQ6/1Xq48 OYEA== 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; bh=Zs/N9itbaR+EyxllwitcuxkS8G4Z0EGsigxlP16J19k=; b=xfGbkyKsOLzOCoZcQUvmU9OuDCOOs/S97iQOvspzj0RumQ/TVyD7kgnMHXw495v7Wm N8ZCcsqLRHjQd3iLf84pv5H1nFzeatRyMUhCVgCOuOpM6WK1JGqhzeHwiL4pk8aMaryF IlHFP0v+b9EcxD5TgAtVqEONdwsoN+tiN8SUyuKpIq4fvJriu9KmHTCDUQrQ9chdDFKI i/6k7Nnwz9JnZsf+IpsqGgL2kisitrn1rhrC6Nr3GFg3kLR0fWqu6MigltVm0+GrUH9y 2t2hotqHQHFRKr4C/QitHK/zCba0/ew6qE/pq09wZN4c4gVSHfcM5Qoxv1t/VGqB43yV 5CUA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az12si17338462plb.5.2019.07.26.05.13.55; Fri, 26 Jul 2019 05:14:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbfGZMLE (ORCPT + 99 others); Fri, 26 Jul 2019 08:11:04 -0400 Received: from foss.arm.com ([217.140.110.172]:42250 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbfGZMLE (ORCPT ); Fri, 26 Jul 2019 08:11:04 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 56453344; Fri, 26 Jul 2019 05:11:03 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 34CC33F694; Fri, 26 Jul 2019 05:11:02 -0700 (PDT) Date: Fri, 26 Jul 2019 13:10:57 +0100 From: Mark Rutland To: Anders Roxell Cc: will@kernel.org, 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: <20190726121056.GA26088@lakrids.cambridge.arm.com> References: <20190726112716.19104-1-anders.roxell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190726112716.19104-1-anders.roxell@linaro.org> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) 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: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. If anything, it fixes: d93512ef0f0e (" Makefile: Globally enable fall-through warning") ... given the commit message for that patch states: Now that all the fall-through warnings have been addressed in the kernel, enable the fall-through warning globally. ... and the existence of this patch implies otherwise. IIUC that patch isn't even in mainline yet, but given this is simple I imagine that Will and Catalin might be happy to pick this up for the next rc. Thanks, Mark. > --- > arch/arm64/kernel/hw_breakpoint.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c > index dceb84520948..ea616adf1cf1 100644 > --- a/arch/arm64/kernel/hw_breakpoint.c > +++ b/arch/arm64/kernel/hw_breakpoint.c > @@ -535,14 +535,17 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, > case 0: > /* Aligned */ > break; > - case 1: > - /* Allow single byte watchpoint. */ > - if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) > - break; > case 2: > /* Allow halfword watchpoints and breakpoints. */ > if (hw->ctrl.len == ARM_BREAKPOINT_LEN_2) > break; > + /* Fall through */ > + case 1: > + case 3: > + /* Allow single byte watchpoint. */ > + if (hw->ctrl.len == ARM_BREAKPOINT_LEN_1) > + break; > + /* Fall through */ > default: > return -EINVAL; > } > -- > 2.20.1 >