From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607700574; cv=none; d=zohomail.com; s=zohoarc; b=ZuZq+WpTk3kFtn6dJcGRYwlVCI+kuXsi19NFQpcQ2Z+hN47qDQwt3F2IvzU9CZ2Fs/WyYW7Ib8FSzqIhA6yY2b1gtlGGIXcVpV82tQyAifPSHqqOSbhnAlL00pHIT0h7VW6mWq6l/0TtSGy3uTWdeb2mI4LajO7de8Iqm0qTGzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607700574; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DdwlKdc8b3ZF0MgVlSA+4QtNJ7CUlNJsKC5XrmkCd7Y=; b=Nd3d6nsR0dfQUhwCZz0mJFj2lH3W0tz5KbiNoKKYTEpng67POBvciFvzifaagVKa+Xcp5T6ckz6etLpSssfVpy8svfDe/MMTPNt7kRAlLGNiOQw80mhNKaftp6jphhoAPum/sUKCURfXL8RRjKpoFwtCI0mqf/dk7j+z7aG1Ags= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607700574257740.666495380405; Fri, 11 Dec 2020 07:29:34 -0800 (PST) Received: from localhost ([::1]:54632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkMN-0001KP-LV for importer@patchew.org; Fri, 11 Dec 2020 10:29:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHh-0004NU-JA for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHe-0005yS-Ng for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:41 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-331-lKMBOd0lMRWk1FJktGG4KA-1; Fri, 11 Dec 2020 10:24:34 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5AFB87300D; Fri, 11 Dec 2020 15:24:32 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4820710023B4; Fri, 11 Dec 2020 15:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DdwlKdc8b3ZF0MgVlSA+4QtNJ7CUlNJsKC5XrmkCd7Y=; b=QdBGNSJHuQnpKK4UXR9sS85cZTb/PJdN8i7fHx5A9T4H4XzpvfmF0j3LSlz4/LCUM9zbIb Gx+rNl3GLjxKe7fyc1+96EvxUYV7wTm1YfOtVDUyFhHhueWVNMicUnmoxRJD/4elyXGzG/ ynuQWDmUSns3jNlPQ2aFMeZ7V2rUA5w= X-MC-Unique: lKMBOd0lMRWk1FJktGG4KA-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 01/12] disas/libvixl: Fix fall-through annotation for GCC >= 7 Date: Fri, 11 Dec 2020 16:24:15 +0100 Message-Id: <20201211152426.350966-2-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" For compiling with -Wimplicit-fallthrough we need to fix the fallthrough annotations in the libvixl code. This is based on the following upstream vixl commit by Martyn Capewell: https://git.linaro.org/arm/vixl.git/commit/?id=3Dde326f850f736c3a337 "GCC 7 enables switch/case fallthrough checking, but this fails in VIXL, because the annotation we use is Clang specific. Also, fix a missing annotation in the disassembler." Signed-off-by: Thomas Huth Reviewed-by: Peter Maydell --- disas/libvixl/vixl/a64/disasm-a64.cc | 4 ++++ disas/libvixl/vixl/globals.h | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/disas/libvixl/vixl/a64/disasm-a64.cc b/disas/libvixl/vixl/a64/= disasm-a64.cc index 7a58a5c087..f34d1d68da 100644 --- a/disas/libvixl/vixl/a64/disasm-a64.cc +++ b/disas/libvixl/vixl/a64/disasm-a64.cc @@ -2985,6 +2985,10 @@ int Disassembler::SubstituteImmediateField(const Ins= truction* instr, } return 3; } + default: { + VIXL_UNIMPLEMENTED(); + return 0; + } } } case 'C': { // ICondB - Immediate Conditional Branch. diff --git a/disas/libvixl/vixl/globals.h b/disas/libvixl/vixl/globals.h index 61dc9f7f7e..7099aa599f 100644 --- a/disas/libvixl/vixl/globals.h +++ b/disas/libvixl/vixl/globals.h @@ -108,10 +108,12 @@ inline void USE(T1, T2, T3, T4) {} #define __has_warning(x) 0 #endif =20 -// Note: This option is only available for Clang. And will only be enabled= for -// C++11(201103L). +// Fallthrough annotation for Clang and C++11(201103L). #if __has_warning("-Wimplicit-fallthrough") && __cplusplus >=3D 201103L #define VIXL_FALLTHROUGH() [[clang::fallthrough]] //NOLINT +// Fallthrough annotation for GCC >=3D 7. +#elif __GNUC__ >=3D 7 + #define VIXL_FALLTHROUGH() __attribute__((fallthrough)) #else #define VIXL_FALLTHROUGH() do {} while (0) #endif --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607700417; cv=none; d=zohomail.com; s=zohoarc; b=SMhWnt9ueuRfKPEIPSWf5TRe6qBWUkpqIY/UxYItR4zdjsYAVvewZfZ6Rg/DbEslEcU1ixjNqwpOwau/+Z4Y4Y23iBcdUNgFKd//fzX/N9g+q5V3h7ctvikjvJqwcL3/LgbGmVxYcBpFWmtQ4o8mHQoNlTxnOy+o7lFTfiNI/bw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607700417; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NaFhRfQq/5LFDHPgAWQ09PoAb6csJ4S8LYMgJKquWiw=; b=G7vA0k6+087by5JR6KTsY6I5UgxeLtmm5HdU6VWchU0jbCVbGZvcXpqmUe2inON6cYae08iV8HHND4rk06zCNWlglTrg/Nv1vmrdMoJrxFMxSLpm05zFIYRRgNTpDJUhqwhlJtU08zimUBA+8P8VM9kNWyLWWwd+TFTvRK44xfE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16077004173571004.1637435278145; Fri, 11 Dec 2020 07:26:57 -0800 (PST) Received: from localhost ([::1]:46202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkJq-0006KR-4V for importer@patchew.org; Fri, 11 Dec 2020 10:26:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHi-0004Pk-IE for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHg-0005yZ-LQ for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:42 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-122-FqGr6uCUNTGFLd5jh9v4Mg-1; Fri, 11 Dec 2020 10:24:36 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 030C6800D62; Fri, 11 Dec 2020 15:24:35 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4689E100239F; Fri, 11 Dec 2020 15:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NaFhRfQq/5LFDHPgAWQ09PoAb6csJ4S8LYMgJKquWiw=; b=CXlEYfA/cUcbPVzGQQJzhjygNuNhTkiwRzdq+XVhjYfhfjjxNYc2sxMWpOTKvoPR0yPInV uGIv8dNvjgsICDGYWZ2Re+ELlraPOJ6MWLH9RXcjoYky81tmj4JQKdQfg+4QN6yF+SAwHx drhDwK5oaANPAT0VjWPqff8UL3kf/aE= X-MC-Unique: FqGr6uCUNTGFLd5jh9v4Mg-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 02/12] target/unicore32/translate: Add missing fallthrough annotations Date: Fri, 11 Dec 2020 16:24:16 +0100 Message-Id: <20201211152426.350966-3-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Looking at the way the code is formatted here (there is an empty line after break statements, but none where the break is missing), and the instruction set overview at https://en.wikipedia.org/wiki/Unicore the fallthrough is very likely intended here. So add a fallthrough comment to make the it compilable with -Werror=3Dimplicit-fallthrough. Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- target/unicore32/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/unicore32/translate.c b/target/unicore32/translate.c index d4b06df672..962f9877a0 100644 --- a/target/unicore32/translate.c +++ b/target/unicore32/translate.c @@ -1801,6 +1801,7 @@ static void disas_uc32_insn(CPUUniCore32State *env, D= isasContext *s) do_misc(env, s, insn); break; } + /* fallthrough */ case 0x1: if (((UCOP_OPCODES >> 2) =3D=3D 2) && !UCOP_SET_S) { do_misc(env, s, insn); @@ -1817,6 +1818,7 @@ static void disas_uc32_insn(CPUUniCore32State *env, D= isasContext *s) if (UCOP_SET(8) || UCOP_SET(5)) { ILLEGAL; } + /* fallthrough */ case 0x3: do_ldst_ir(env, s, insn); break; --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607705899; cv=none; d=zohomail.com; s=zohoarc; b=UpiZQ2wctfD/OjNSo++Vg5Us+5DPQAPQYlQnE+LATnYTpC3fOYRaDSGj3OH2IBvcZMyCv7JxORQX0mmE1K+IjB6AtXixMA2SihfP74IlSyYKonHCmCd2jNxMtNjlGC7GQBB4dPiA4G7lAvc/LtH2LiVYHt6qDkSs4ggFDOohudA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607705899; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AEsf0f+DfbeaxGosLWLxrImcvGCVpEGSYni5DdQ4U0M=; b=A+5yub8T6cleh/08iZm0udPSKLh5Xlu0uVOKqu5PlqWIT0yPy3XTjR6vKMKMonmO4xAAGoUYinN44DT1c8Toln6BCntj9s+fQhrRvq/DRS1U7y6j03wGS1kq9NY23PB9aA7KUNLUMIug+SYykdyOCW8TliyTVIhz9Kyk48Nac8w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160770589981035.199449322497685; Fri, 11 Dec 2020 08:58:19 -0800 (PST) Received: from localhost ([::1]:34868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkP5-0004tA-Pr for importer@patchew.org; Fri, 11 Dec 2020 10:32:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHi-0004PT-Dh for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHg-0005zM-Ig for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:42 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-qPYLt1zwPeuWlHOfJE131A-1; Fri, 11 Dec 2020 10:24:38 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB6CB187653B; Fri, 11 Dec 2020 15:24:36 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B20A10016FE; Fri, 11 Dec 2020 15:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AEsf0f+DfbeaxGosLWLxrImcvGCVpEGSYni5DdQ4U0M=; b=DAo9ECZNIkFm+P/CSNeraxoNQO4bUQxn8AXTxsNBHU/C6f3lBQuNbE1rF+o/3PzD+sZBo2 XqpmzVyzsnockLEX18f2yF7M/ktt1PwFfR/gHFYXv5/ZZGztUNVCmU1ei/DwjtSS8oKSq7 KR2tH4fC1iVv4WtJuSewbNr9SmH5T9I= X-MC-Unique: qPYLt1zwPeuWlHOfJE131A-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 03/12] hw/rtc/twl92230: Silence warnings about missing fallthrough statements Date: Fri, 11 Dec 2020 16:24:17 +0100 Message-Id: <20201211152426.350966-4-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When compiling with -Werror=3Dimplicit-fallthrough, gcc complains about missing fallthrough annotations in this file. Looking at the code, the fallthrough is indeed wanted here, but instead of adding the annotations, it can be done more efficiently by simply calculating the offset with a subtraction instead of increasing a local variable one by one. Signed-off-by: Thomas Huth Reviewed-by: Peter Maydell --- hw/rtc/twl92230.c | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c index f838913b37..a787bd247d 100644 --- a/hw/rtc/twl92230.c +++ b/hw/rtc/twl92230.c @@ -271,37 +271,23 @@ static void menelaus_gpio_set(void *opaque, int line,= int level) static uint8_t menelaus_read(void *opaque, uint8_t addr) { MenelausState *s =3D (MenelausState *) opaque; - int reg =3D 0; =20 switch (addr) { case MENELAUS_REV: return 0x22; =20 - case MENELAUS_VCORE_CTRL5: reg ++; - case MENELAUS_VCORE_CTRL4: reg ++; - case MENELAUS_VCORE_CTRL3: reg ++; - case MENELAUS_VCORE_CTRL2: reg ++; - case MENELAUS_VCORE_CTRL1: - return s->vcore[reg]; + case MENELAUS_VCORE_CTRL1 ... MENELAUS_VCORE_CTRL5: + return s->vcore[addr - MENELAUS_VCORE_CTRL1]; =20 - case MENELAUS_DCDC_CTRL3: reg ++; - case MENELAUS_DCDC_CTRL2: reg ++; - case MENELAUS_DCDC_CTRL1: - return s->dcdc[reg]; - - case MENELAUS_LDO_CTRL8: reg ++; - case MENELAUS_LDO_CTRL7: reg ++; - case MENELAUS_LDO_CTRL6: reg ++; - case MENELAUS_LDO_CTRL5: reg ++; - case MENELAUS_LDO_CTRL4: reg ++; - case MENELAUS_LDO_CTRL3: reg ++; - case MENELAUS_LDO_CTRL2: reg ++; - case MENELAUS_LDO_CTRL1: - return s->ldo[reg]; + case MENELAUS_DCDC_CTRL1 ... MENELAUS_DCDC_CTRL3: + return s->dcdc[addr - MENELAUS_DCDC_CTRL1]; + + case MENELAUS_LDO_CTRL1 ... MENELAUS_LDO_CTRL8: + return s->ldo[addr - MENELAUS_LDO_CTRL1]; =20 - case MENELAUS_SLEEP_CTRL2: reg ++; case MENELAUS_SLEEP_CTRL1: - return s->sleep[reg]; + case MENELAUS_SLEEP_CTRL2: + return s->sleep[addr - MENELAUS_SLEEP_CTRL1]; =20 case MENELAUS_DEVICE_OFF: return 0; @@ -395,10 +381,8 @@ static uint8_t menelaus_read(void *opaque, uint8_t add= r) case MENELAUS_S2_PULL_DIR: return s->pull[3]; =20 - case MENELAUS_MCT_CTRL3: reg ++; - case MENELAUS_MCT_CTRL2: reg ++; - case MENELAUS_MCT_CTRL1: - return s->mmc_ctrl[reg]; + case MENELAUS_MCT_CTRL1 ... MENELAUS_MCT_CTRL3: + return s->mmc_ctrl[addr - MENELAUS_MCT_CTRL1]; case MENELAUS_MCT_PIN_ST: /* TODO: return the real Card Detect */ return 0; @@ -418,7 +402,6 @@ static void menelaus_write(void *opaque, uint8_t addr, = uint8_t value) { MenelausState *s =3D (MenelausState *) opaque; int line; - int reg =3D 0; struct tm tm; =20 switch (addr) { @@ -496,9 +479,9 @@ static void menelaus_write(void *opaque, uint8_t addr, = uint8_t value) s->ldo[7] =3D value & 3; break; =20 - case MENELAUS_SLEEP_CTRL2: reg ++; case MENELAUS_SLEEP_CTRL1: - s->sleep[reg] =3D value; + case MENELAUS_SLEEP_CTRL2: + s->sleep[addr - MENELAUS_SLEEP_CTRL1] =3D value; break; =20 case MENELAUS_DEVICE_OFF: --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607700586; cv=none; d=zohomail.com; s=zohoarc; b=SU4ijBcHFukfsdU+3DZpO2N5MI3w+XFREWDnHY9vC+qAPobGrV8sFJV5+WUFVXIqkmhBIerAZ3hv7tMfbYLHTtM4voBPZ0XseNJuzJAdabp1ysgd0hk4uGlm7gUnc69VaGEiZg/nx3KH4DYNxJNrLko4kqvhtrHV30FcV6crz6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607700586; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QKGET8JhqD9ZgSuigyjjHiI44cUVf9bx8v+tId07svs=; b=MzNNF4kRl7tLpjp0fGCYlsm1sE+EvTsoKxoEBeeZUlcd13SSVGthKyD/316AwO25+Teob/cWMBNGL4QPgrjF+KAKGLRFUflnjZergqFP8ZruVZyNoD/HEN5ALiRJdTHL13VGggIhIVXma75RvtRJ6IZtiK1R+CzqKDz2xNqhsbY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607700586633477.70639498322976; Fri, 11 Dec 2020 07:29:46 -0800 (PST) Received: from localhost ([::1]:54976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkMb-0001Sx-FZ for importer@patchew.org; Fri, 11 Dec 2020 10:29:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHl-0004U3-BB for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHi-00060K-M1 for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:45 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-277-toTzmIYRNOmTWwF3Qj6Qmg-1; Fri, 11 Dec 2020 10:24:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DF1B18C43CF; Fri, 11 Dec 2020 15:24:38 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35147100239F; Fri, 11 Dec 2020 15:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QKGET8JhqD9ZgSuigyjjHiI44cUVf9bx8v+tId07svs=; b=TcHT1xl40qJy8UMrIESCvU+G1kKbpXEF364uCKHT/B+SMiBdL6LTdSlJspWs/lk2QVVGRQ a8m5wrii81BMbE+V25R49WBhMo6NVmNCc1+LiPZp5FwQmqPKWHtHnKYq1XNOxYKHxabrY+ 54XPbWdppvb2rdMOkcJsqEgureVKG3M= X-MC-Unique: toTzmIYRNOmTWwF3Qj6Qmg-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 04/12] hw/timer/renesas_tmr: silence the compiler warnings Date: Fri, 11 Dec 2020 16:24:18 +0100 Message-Id: <20201211152426.350966-5-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Chen Qun When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warnin= g: ../hw/timer/renesas_tmr.c: In function =E2=80=98tmr_read=E2=80=99: ../hw/timer/renesas_tmr.c:221:19: warning: this statement may fall through = [-Wimplicit-fallthrough=3D] 221 | } else if (ch =3D=3D 0) {i | ^ ../hw/timer/renesas_tmr.c:224:5: note: here 224 | case A_TCORB: | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun Message-Id: <20201028041819.2169003-10-kuhn.chenqun@huawei.com> Signed-off-by: Thomas Huth --- hw/timer/renesas_tmr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/timer/renesas_tmr.c b/hw/timer/renesas_tmr.c index 446f2eacdd..e03a8155b2 100644 --- a/hw/timer/renesas_tmr.c +++ b/hw/timer/renesas_tmr.c @@ -221,6 +221,7 @@ static uint64_t tmr_read(void *opaque, hwaddr addr, uns= igned size) } else if (ch =3D=3D 0) { return concat_reg(tmr->tcora); } + /* fall through */ case A_TCORB: if (size =3D=3D 1) { return tmr->tcorb[ch]; --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607706039; cv=none; d=zohomail.com; s=zohoarc; b=lqlEba8qhbD06Yfd83SSa6Mq6oeJWCdQxBPJybTJtpdmkapKY7Kv4S1RyQzVycy8IoRETGf0KsGRbIe0DKOEGVsCcAIh95Beg8ajUGPMyvzIdcIRN4Kx9Nl967CKAbJnLwgcwjOMGJZVa+P7RJrPQW9x7I5xJuDOj8oDEUIXvbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607706039; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ynz+NF3wqknfz0B2Ut8E/9qZJ9FPq6qcYfbYsdobs2I=; b=bUTzgD1vToSlGImNjqPcRlSrHYMugt8S7kwK8UNW5a7z8rspx6yzR63PbFiGWjztsq7bY+g1CFX5/RIhFdHjTnaT60cx9h4Y5pfUNIKdgDfkDCKk39GkPHBjQnXik6NR+YTQWEAoOc5ZfxyqXCWPLRNKYD9XYsKFzBYszv4tzL0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607706039291352.7663540277256; Fri, 11 Dec 2020 09:00:39 -0800 (PST) Received: from localhost ([::1]:41646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkT4-0007kl-1w for importer@patchew.org; Fri, 11 Dec 2020 10:36:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHq-0004bD-CS for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHn-00062j-M5 for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:50 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-8tNU0ETTNQGGL9pSv7mAYQ-1; Fri, 11 Dec 2020 10:24:41 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E84580205E; Fri, 11 Dec 2020 15:24:40 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E715100239F; Fri, 11 Dec 2020 15:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ynz+NF3wqknfz0B2Ut8E/9qZJ9FPq6qcYfbYsdobs2I=; b=V6Y/sZNrAcTDcjbKAQ+JBo10YTByNyZhYSF5nNJb08LWSF3s9WhgVk5a5/Wsn2d3dPX0JX urKs3uc/NmkP/9B/QgkAH9Rz//bfOiW8k9ogk/PpHKwY94ni7M0osheiVvDx90yqmJuLmb apmkXy4eVGBcQo1ncp+nZn/So+nAC20= X-MC-Unique: 8tNU0ETTNQGGL9pSv7mAYQ-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 05/12] target/i386: silence the compiler warnings in gen_shiftd_rm_T1 Date: Fri, 11 Dec 2020 16:24:19 +0100 Message-Id: <20201211152426.350966-6-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Chen Qun The current "#ifdef TARGET_X86_64" statement affects the compiler's determination of fall through. When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warnin= g: target/i386/translate.c: In function =E2=80=98gen_shiftd_rm_T1=E2=80=99: target/i386/translate.c:1773:12: warning: this statement may fall through [= -Wimplicit-fallthrough=3D] if (is_right) { ^ target/i386/translate.c:1782:5: note: here case MO_32: ^~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-Id: <20201030004046.2191790-2-kuhn.chenqun@huawei.com> Signed-off-by: Thomas Huth --- target/i386/translate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 4c57307e42..dcf48f053f 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -1777,9 +1777,12 @@ static void gen_shiftd_rm_T1(DisasContext *s, MemOp = ot, int op1, } else { tcg_gen_deposit_tl(s->T1, s->T0, s->T1, 16, 16); } - /* FALLTHRU */ -#ifdef TARGET_X86_64 + /* + * If TARGET_X86_64 defined then fall through into MO_32 case, + * otherwise fall through default case. + */ case MO_32: +#ifdef TARGET_X86_64 /* Concatenate the two 32-bit values and use a 64-bit shift. */ tcg_gen_subi_tl(s->tmp0, count, 1); if (is_right) { --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607705059; cv=none; d=zohomail.com; s=zohoarc; b=V8enS8LXyboZQtP46J7GjnvZ/JmGfRqt0kqLA9xH0I2HpvekGidFWFOP8Xt61aS+ptYAiXNWbnUMx2jbkC8vDWTBE4yKwF7etRd75UW3rsTKhdM0gbZy1O7s/fVhAHjBN++S54QV3mmom/40Tp9YbsPWlI/+zDA856b0C5LLb90= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607705059; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eM4NuSpdy1J6QD1xN54nG1XH5xLDLId2qqtMUhbNwOc=; b=GxF77JKrES8ZkGqRXWs3MUOKsFZeqsT0faOyuFtfSCt3a6nE6dzElmfOz45x29yirL6Ko5b1N63LGPXTFovoDoJUaJxx/YV3kOYZpZnP1Lh/aleUXx6aaK1KK1YhRuLlT1FPvXUu2N6lOckBA9DLBGQrymxTkyRI0j8Iq8dJjog= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607705059728265.78883129399526; Fri, 11 Dec 2020 08:44:19 -0800 (PST) Received: from localhost ([::1]:34916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkP7-0004uF-7B for importer@patchew.org; Fri, 11 Dec 2020 10:32:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHv-0004fO-Qz for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHq-00063f-Hq for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:53 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-o-n6BrdRNDSKptiCWc8BLg-1; Fri, 11 Dec 2020 10:24:43 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57B7E59; Fri, 11 Dec 2020 15:24:42 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id D370D10016FE; Fri, 11 Dec 2020 15:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eM4NuSpdy1J6QD1xN54nG1XH5xLDLId2qqtMUhbNwOc=; b=Yn4NwIis19CX+VuRCwI9sgwhB31tyz5VwyUeX3hqNIUNf0GxCquEI/LMKb1x1NS2U15YZK zUMLjhoSslnRm1Mgw1dqMMQaJhtQvutSuUqciuikq14Ekg2Z1vzs0055ut0FTnpnL35nW3 VhxiXNzAHm4DyZePNF9Rby8qUS8Tt8s= X-MC-Unique: o-n6BrdRNDSKptiCWc8BLg-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 06/12] hw/intc/arm_gicv3_kvm: silence the compiler warnings Date: Fri, 11 Dec 2020 16:24:20 +0100 Message-Id: <20201211152426.350966-7-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Chen Qun When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warnin= g: hw/intc/arm_gicv3_kvm.c: In function =E2=80=98kvm_arm_gicv3_put=E2=80=99: hw/intc/arm_gicv3_kvm.c:484:13: warning: this statement may fall through [-= Wimplicit-fallthrough=3D] kvm_gicc_access(s, ICC_AP0R_EL1(1), ncpu, ®64, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hw/intc/arm_gicv3_kvm.c:485:9: note: here default: ^~~~~~~ hw/intc/arm_gicv3_kvm.c:495:13: warning: this statement may fall through [-= Wimplicit-fallthrough=3D] kvm_gicc_access(s, ICC_AP1R_EL1(2), ncpu, ®64, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hw/intc/arm_gicv3_kvm.c:496:9: note: here case 6: ^~~~ hw/intc/arm_gicv3_kvm.c:498:13: warning: this statement may fall through [-= Wimplicit-fallthrough=3D] kvm_gicc_access(s, ICC_AP1R_EL1(1), ncpu, ®64, true); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hw/intc/arm_gicv3_kvm.c:499:9: note: here default: ^~~~~~~ hw/intc/arm_gicv3_kvm.c: In function =E2=80=98kvm_arm_gicv3_get=E2=80=99: hw/intc/arm_gicv3_kvm.c:634:37: warning: this statement may fall through [-= Wimplicit-fallthrough=3D] c->icc_apr[GICV3_G0][2] =3D reg64; ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ hw/intc/arm_gicv3_kvm.c:635:9: note: here case 6: ^~~~ hw/intc/arm_gicv3_kvm.c:637:37: warning: this statement may fall through [-= Wimplicit-fallthrough=3D] c->icc_apr[GICV3_G0][1] =3D reg64; ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ hw/intc/arm_gicv3_kvm.c:638:9: note: here default: ^~~~~~~ hw/intc/arm_gicv3_kvm.c:648:39: warning: this statement may fall through [-= Wimplicit-fallthrough=3D] c->icc_apr[GICV3_G1NS][2] =3D reg64; ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ hw/intc/arm_gicv3_kvm.c:649:9: note: here case 6: ^~~~ hw/intc/arm_gicv3_kvm.c:651:39: warning: this statement may fall through [-= Wimplicit-fallthrough=3D] c->icc_apr[GICV3_G1NS][1] =3D reg64; ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ hw/intc/arm_gicv3_kvm.c:652:9: note: here default: ^~~~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Peter Maydell Message-Id: <20201030004046.2191790-3-kuhn.chenqun@huawei.com> Signed-off-by: Thomas Huth --- hw/intc/arm_gicv3_kvm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 187eb054e0..d040a5d1e9 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -478,9 +478,11 @@ static void kvm_arm_gicv3_put(GICv3State *s) kvm_gicc_access(s, ICC_AP0R_EL1(3), ncpu, ®64, true); reg64 =3D c->icc_apr[GICV3_G0][2]; kvm_gicc_access(s, ICC_AP0R_EL1(2), ncpu, ®64, true); + /* fall through */ case 6: reg64 =3D c->icc_apr[GICV3_G0][1]; kvm_gicc_access(s, ICC_AP0R_EL1(1), ncpu, ®64, true); + /* fall through */ default: reg64 =3D c->icc_apr[GICV3_G0][0]; kvm_gicc_access(s, ICC_AP0R_EL1(0), ncpu, ®64, true); @@ -492,9 +494,11 @@ static void kvm_arm_gicv3_put(GICv3State *s) kvm_gicc_access(s, ICC_AP1R_EL1(3), ncpu, ®64, true); reg64 =3D c->icc_apr[GICV3_G1NS][2]; kvm_gicc_access(s, ICC_AP1R_EL1(2), ncpu, ®64, true); + /* fall through */ case 6: reg64 =3D c->icc_apr[GICV3_G1NS][1]; kvm_gicc_access(s, ICC_AP1R_EL1(1), ncpu, ®64, true); + /* fall through */ default: reg64 =3D c->icc_apr[GICV3_G1NS][0]; kvm_gicc_access(s, ICC_AP1R_EL1(0), ncpu, ®64, true); @@ -631,9 +635,11 @@ static void kvm_arm_gicv3_get(GICv3State *s) c->icc_apr[GICV3_G0][3] =3D reg64; kvm_gicc_access(s, ICC_AP0R_EL1(2), ncpu, ®64, false); c->icc_apr[GICV3_G0][2] =3D reg64; + /* fall through */ case 6: kvm_gicc_access(s, ICC_AP0R_EL1(1), ncpu, ®64, false); c->icc_apr[GICV3_G0][1] =3D reg64; + /* fall through */ default: kvm_gicc_access(s, ICC_AP0R_EL1(0), ncpu, ®64, false); c->icc_apr[GICV3_G0][0] =3D reg64; @@ -645,9 +651,11 @@ static void kvm_arm_gicv3_get(GICv3State *s) c->icc_apr[GICV3_G1NS][3] =3D reg64; kvm_gicc_access(s, ICC_AP1R_EL1(2), ncpu, ®64, false); c->icc_apr[GICV3_G1NS][2] =3D reg64; + /* fall through */ case 6: kvm_gicc_access(s, ICC_AP1R_EL1(1), ncpu, ®64, false); c->icc_apr[GICV3_G1NS][1] =3D reg64; + /* fall through */ default: kvm_gicc_access(s, ICC_AP1R_EL1(0), ncpu, ®64, false); c->icc_apr[GICV3_G1NS][0] =3D reg64; --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607700462; cv=none; d=zohomail.com; s=zohoarc; b=LGTUB65qV/Y+HD96niWT+SNPkMUcQ5wCqB/FQhbY3J5lL0SA8i0lpf9gbc+NB6EpTQwvY/xuPmrVJNB1dwnOFaMhCJclutIx6lmYjcyVj83w0cG2bghIadoNKGjxtVGCHsRojnH1QGaQvYd3okIOYbfNSyk6yGQtMuvzhXF0Fao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607700462; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+Z0RQvRtJ7hMk7gfMe6Bddm/jnUXve9GIhF/VDyih1Y=; b=hm23ToWovJMAfQnP5IM1HGzoLMpmbqpoJOFjQWvw5s33P6aBG4Lq/u0PwxKHjsPu2wxxZ5w+eF+0EUi8T6QWdNTqJtIaG8ANRtbnBkuzd1KYDPmp9xFTDkV04fMf6e+0Scz2RSXVZIypZ0kOgHzsetOUML+ZM3yAyX2YSxo5AKU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160770046217299.44677374092475; Fri, 11 Dec 2020 07:27:42 -0800 (PST) Received: from localhost ([::1]:48448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkKa-0007F3-QO for importer@patchew.org; Fri, 11 Dec 2020 10:27:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHu-0004dU-5f for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHp-00062s-Ep for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:50 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-tS0UXVGXN-K0Oegk_Wew2Q-1; Fri, 11 Dec 2020 10:24:45 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B125800D53; Fri, 11 Dec 2020 15:24:44 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id B669D10016FE; Fri, 11 Dec 2020 15:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Z0RQvRtJ7hMk7gfMe6Bddm/jnUXve9GIhF/VDyih1Y=; b=GXfNl3nkC6T5uto6Nueb549i2nsadDqQDzIaqHdqGL71it+TRh/mwTDr2sDry+z0WWFBuv 0WmIyF5Fq4xleVv1r5oeAAn7GeSFo3fJoxFrg/ykmhBN7YiinRQ1ERVlaIfiWhAwvk4OCe rMobJ/VBsRudPot0BKtjvt0RbDIZAN8= X-MC-Unique: tS0UXVGXN-K0Oegk_Wew2Q-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 07/12] accel/tcg/user-exec: silence the compiler warnings Date: Fri, 11 Dec 2020 16:24:21 +0100 Message-Id: <20201211152426.350966-8-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Chen Qun When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warnin= g: ../accel/tcg/user-exec.c: In function =E2=80=98handle_cpu_signal=E2=80=99: ../accel/tcg/user-exec.c:169:13: warning: this statement may fall through [= -Wimplicit-fallthrough=3D] 169 | cpu_exit_tb_from_sighandler(cpu, old_set); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../accel/tcg/user-exec.c:172:9: note: here 172 | default: Mark the cpu_exit_tb_from_sighandler() function with QEMU_NORETURN to fix i= t. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-Id: <20201030004046.2191790-4-kuhn.chenqun@huawei.com> Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Thomas Huth --- accel/tcg/user-exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 4ebe25461a..293ee86ea4 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -49,7 +49,8 @@ __thread uintptr_t helper_retaddr; /* exit the current TB from a signal handler. The host registers are restored in a state compatible with the CPU emulator */ -static void cpu_exit_tb_from_sighandler(CPUState *cpu, sigset_t *old_set) +static void QEMU_NORETURN cpu_exit_tb_from_sighandler(CPUState *cpu, + sigset_t *old_set) { /* XXX: use siglongjmp ? */ sigprocmask(SIG_SETMASK, old_set, NULL); --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607702163; cv=none; d=zohomail.com; s=zohoarc; b=AZXUjp+72JzwfEpl1qV6LOEZmWytO1NBgQSvchAev9DFAPPmz6D65r3sE3QqGj+Czk2U4kRhzrIM+rB9TvX4MJRt3VIAUB1aVaYYz0EEmY4+WubGmU9fCosVYu5RI6cJgMxj8+w772M8ahTRt1jbR5jokfK2j/0pCyJmDFVkYnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607702163; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ETkviDoS0sSEt8TvkS32nDVZw6oCU/Om8bI8qrLo5fU=; b=BedV560rkWLGuoyXs18MyNpXwdeHoNROXReps8VYzfDp/39xT0SFObGHNzxUPuKrJuRK6D5P+ZjIyTsO2UyV4vjjqg5TP+5ErDWiYVhcWY9ROuF8qNyKnX4Sdpccl9AlUGZgY/xtyrxDXFBf+aKrLkIm1dzmc7GYNG2kLjScidU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607702163354758.3272466575755; Fri, 11 Dec 2020 07:56:03 -0800 (PST) Received: from localhost ([::1]:41820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkTG-0007ud-EX for importer@patchew.org; Fri, 11 Dec 2020 10:36:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHx-0004fm-E0 for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51718) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHs-000646-Jy for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:55 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-434-7FtVjrpkOna9Ip2Bw7DWlA-1; Fri, 11 Dec 2020 10:24:47 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0B9A31014E63; Fri, 11 Dec 2020 15:24:46 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FB47100239F; Fri, 11 Dec 2020 15:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ETkviDoS0sSEt8TvkS32nDVZw6oCU/Om8bI8qrLo5fU=; b=TLAdTZ25FNdJGdN4wdzSIotYpWckoEUnY9s72qGrNDdGQQ2CNflPeau56bYh3A02RphAkP CoMZ1wHpGzCvpvwn1X/2H8246QuktwPW97AOqQT/rGxO/nayYOp2Uxi/H2w1tBqAvpqvH7 lEvdLTLGVh5Ks2ip1VgPOapGrjcQ2hM= X-MC-Unique: 7FtVjrpkOna9Ip2Bw7DWlA-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 08/12] target/sparc/translate: silence the compiler warnings Date: Fri, 11 Dec 2020 16:24:22 +0100 Message-Id: <20201211152426.350966-9-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Chen Qun When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warnin= g: target/sparc/translate.c: In function =E2=80=98gen_st_asi=E2=80=99: target/sparc/translate.c:2320:12: warning: this statement may fall through = [-Wimplicit-fallthrough=3D] 2320 | if (!(dc->def->features & CPU_FEATURE_HYPV)) { | ^ target/sparc/translate.c:2329:5: note: here 2329 | case GET_ASI_DIRECT: | ^~~~ The "fall through" statement place is not correctly identified by the compi= ler. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Artyom Tarasenko Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201030004046.2191790-6-kuhn.chenqun@huawei.com> Signed-off-by: Thomas Huth --- target/sparc/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 30c73f8d2e..4bfa3179f8 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2324,8 +2324,8 @@ static void gen_st_asi(DisasContext *dc, TCGv src, TC= Gv addr, } /* in OpenSPARC T1+ CPUs TWINX ASIs in store instructions * are ST_BLKINIT_ ASIs */ - /* fall through */ #endif + /* fall through */ case GET_ASI_DIRECT: gen_address_mask(dc, addr); tcg_gen_qemu_st_tl(src, addr, da.mem_idx, da.memop); --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607700618; cv=none; d=zohomail.com; s=zohoarc; b=hWEJ7gJ8GxKIsFnbKXLrHfOZspHu2pCUHMJw1XXvsm5U8A0yB+yYE/+cTE7SlYDK4cEh0r0Lk2vWbhFBn55z23FsRFgNo5WM9z8UkbUH1TAIh8fSGSoOXUOoHyqH8ZOSwTeW0rGBqOdTArC/NcGSg5ilVQL21ctQE9BmkvEMxOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607700618; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uD3bwiLfZSeE77ZhrfiaGPQPE9beiYi3hGOaOFdxX/Q=; b=fL3lPRVdvp0GAPIzszSYO0BFjWCGoqduC4f+mwmjOkw/rIxyB32XZYCzsghHaBCtCeG0SBx/2+8mUzAPddj2Q7Q0g2M+bvOcFjQHu1jzDhXTvMcfepQRZU1iPoVIDrzgBY+zroq4hm1qfmWBpyfnCfpRQp2HTXdMZfnVZHPNpk8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607700618768306.9075903860604; Fri, 11 Dec 2020 07:30:18 -0800 (PST) Received: from localhost ([::1]:56950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkN6-0002IR-0f for importer@patchew.org; Fri, 11 Dec 2020 10:30:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkIA-0004sm-LC for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:25:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHy-00064B-Ec for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:25:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-160-uwW6qcfSMN66xwv_zX-U_w-1; Fri, 11 Dec 2020 10:24:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC5FC801817; Fri, 11 Dec 2020 15:24:47 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D8C5100239F; Fri, 11 Dec 2020 15:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uD3bwiLfZSeE77ZhrfiaGPQPE9beiYi3hGOaOFdxX/Q=; b=HsnOCfl93NjU/0YChJKF9pfLowrAOWtyhlLLnhslTjSRBgt8sKgmLbYYrsL4fySMggB8zI h4u9w/JdHxFu8gd1o+ErCGjfTa+gYsSw43gj6Yfnz0nO+UcO9ppWOUCecqNqZYxS/yCWlv 18+adnC3a9oO2AOXSRQjf9sB1BUOk7c= X-MC-Unique: uwW6qcfSMN66xwv_zX-U_w-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 09/12] target/sparc/win_helper: silence the compiler warnings Date: Fri, 11 Dec 2020 16:24:23 +0100 Message-Id: <20201211152426.350966-10-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Chen Qun When using -Wimplicit-fallthrough in our CFLAGS, the compiler showed warnin= g: target/sparc/win_helper.c: In function =E2=80=98get_gregset=E2=80=99: target/sparc/win_helper.c:304:9: warning: this statement may fall through [= -Wimplicit-fallthrough=3D] 304 | trace_win_helper_gregset_error(pstate); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ target/sparc/win_helper.c:306:5: note: here 306 | case 0: | ^~~~ Add the corresponding "fall through" comment to fix it. Reported-by: Euler Robot Signed-off-by: Chen Qun Reviewed-by: Artyom Tarasenko Message-Id: <20201030004046.2191790-7-kuhn.chenqun@huawei.com> Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- target/sparc/win_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/win_helper.c b/target/sparc/win_helper.c index 5b57892a10..3a7c0ff943 100644 --- a/target/sparc/win_helper.c +++ b/target/sparc/win_helper.c @@ -302,7 +302,7 @@ static inline uint64_t *get_gregset(CPUSPARCState *env,= uint32_t pstate) switch (pstate) { default: trace_win_helper_gregset_error(pstate); - /* pass through to normal set of global registers */ + /* fall through to normal set of global registers */ case 0: return env->bgregs; case PS_AG: --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607702145; cv=none; d=zohomail.com; s=zohoarc; b=OUGrswswyjMZdd96KDg29qDQLgBjkHwFdIuNpQPjlrjmiXpQedxoGBrnfvrcUYdEqmBuWbXIIjiC4uZ6owNJaLje2im0mXarKlG+nS9M1aqgm/CQeFXTK8l/Z6IcgXayp6BhUtb7PCBHH4EQ8rA84CIs9/BZTk3162+WpPFOXk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607702145; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3dIalpcSMDQ2tujojEC45a7JfPv9bzaYZwv1aq4jd5k=; b=KOBsPczPjf//YjNLZb95xRzToSklfPVI4xqqZAbpAcdFkDXBVclPA0EauuhxXNzFl+7V/xG3ABPOCXl/SCXXBm/59gkjZnKuTEHne331NDHetjqc+xl4PXNs9yaR/yKYwgjl/Q0k4I+fQg/NLCMXi/hUvoiD6ZLyIlgJIjiqFbU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607702145414111.47550309444341; Fri, 11 Dec 2020 07:55:45 -0800 (PST) Received: from localhost ([::1]:48068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkVN-0002D5-HL for importer@patchew.org; Fri, 11 Dec 2020 10:38:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkHz-0004if-Bm for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHw-00065A-KZ for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:24:59 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-519-rfd2RDYwOVyYJa1-OkicQQ-1; Fri, 11 Dec 2020 10:24:51 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5261800D62; Fri, 11 Dec 2020 15:24:49 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8697B100239F; Fri, 11 Dec 2020 15:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3dIalpcSMDQ2tujojEC45a7JfPv9bzaYZwv1aq4jd5k=; b=b9v35EtlW+EpZrMhYDTU/R8o83p/QR0A6UTZJF/nYXGYTtXs5g7d9zV+ZsktXY5lw9es/U HyBUlKu155zKkdh+wsEwLy9rpxX3yQzd8HxqnqPj8ddJ+RnU6HH8DujYTSjAPljroBcmkU Sf26VK++pINtKSjLn/VLzPDSZ3WaQrU= X-MC-Unique: rfd2RDYwOVyYJa1-OkicQQ-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 10/12] tcg/optimize: Add fallthrough annotations Date: Fri, 11 Dec 2020 16:24:24 +0100 Message-Id: <20201211152426.350966-11-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" To be able to compile this file with -Werror=3Dimplicit-fallthrough, we need to add some fallthrough annotations to the case statements that might fall through. Unfortunately, the typical "/* fallthrough */" comments do not work here as expected since some case labels are wrapped in macros and the compiler fails to match the comments in this case. But using __attribute__((fallthrough)) seems to work fine, so let's use that instead (by introducing a new QEMU_FALLTHROUGH macro in our compiler.h header file). Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson --- include/qemu/compiler.h | 11 +++++++++++ tcg/optimize.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c76281f354..d831a25da4 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -243,4 +243,15 @@ extern void QEMU_NORETURN QEMU_ERROR("code path is rea= chable") #define qemu_build_not_reached() g_assert_not_reached() #endif =20 +/** + * In most cases, normal "fallthrough" comments are good enough for + * switch-case statements, but sometimes the compiler has problems + * with those. In that case you can use QEMU_FALLTHROUGH instead. + */ +#if __has_attribute(fallthrough) +# define QEMU_FALLTHROUGH __attribute__((fallthrough)) +#else +# define QEMU_FALLTHROUGH do {} while (0) /* fallthrough */ +#endif + #endif /* COMPILER_H */ diff --git a/tcg/optimize.c b/tcg/optimize.c index 220f4601d5..7ca71de956 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -855,6 +855,7 @@ void tcg_optimize(TCGContext *s) if ((arg_info(op->args[1])->mask & 0x80) !=3D 0) { break; } + QEMU_FALLTHROUGH; CASE_OP_32_64(ext8u): mask =3D 0xff; goto and_const; @@ -862,6 +863,7 @@ void tcg_optimize(TCGContext *s) if ((arg_info(op->args[1])->mask & 0x8000) !=3D 0) { break; } + QEMU_FALLTHROUGH; CASE_OP_32_64(ext16u): mask =3D 0xffff; goto and_const; @@ -869,6 +871,7 @@ void tcg_optimize(TCGContext *s) if ((arg_info(op->args[1])->mask & 0x80000000) !=3D 0) { break; } + QEMU_FALLTHROUGH; case INDEX_op_ext32u_i64: mask =3D 0xffffffffU; goto and_const; @@ -886,6 +889,7 @@ void tcg_optimize(TCGContext *s) if ((arg_info(op->args[1])->mask & 0x80000000) !=3D 0) { break; } + QEMU_FALLTHROUGH; case INDEX_op_extu_i32_i64: /* We do not compute affected as it is a size changing op. */ mask =3D (uint32_t)arg_info(op->args[1])->mask; --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607702151; cv=none; d=zohomail.com; s=zohoarc; b=QMSJ+JGdSQyRNTq2IxwU69odKgRe/pZTw2ThYNZo+VreaePIw+YYfK7kJMGlnMXp5baoti7vXx4XIL3t4Wwdaw0/xQHnK0ez4ZsP1kgu23FIxJE1IVIRYJXvyr/jVDF1XVBEliqqZOw4X/DBF7g4JmXkEt+8j8gEO8UFEyccTjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607702151; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eSXVuy2gjjuoz3TvNpAYLxx4gHiT38HfLArFEh3HKF4=; b=YEmezlLSB5t5k023Utznd3f2M4fWmz098Cn7ZqEtPur/T8fmfQn4TE9S0Y4/Y7NH8RjnQP4t0rRzR+XcxcdYq191T2ZiRuYKZJNQZC7yU/3jnh2M8lxPPfE90hjXcuTwC5ScxP6T+e/510+xkVCm1y424Vv96uMiwF5DgmWXVW0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607702151662280.2800574967865; Fri, 11 Dec 2020 07:55:51 -0800 (PST) Received: from localhost ([::1]:47922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkVE-00029b-0V for importer@patchew.org; Fri, 11 Dec 2020 10:38:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkI7-0004rO-VO for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:25:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHz-00065I-8S for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:25:07 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-582-ob5OXXoVP7KlYr1H6FnEUQ-1; Fri, 11 Dec 2020 10:24:52 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE3D2802B46; Fri, 11 Dec 2020 15:24:51 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4851710016FE; Fri, 11 Dec 2020 15:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eSXVuy2gjjuoz3TvNpAYLxx4gHiT38HfLArFEh3HKF4=; b=WpmlBXS5zPA2taJGX6orKA07qJ2ouhpXk88WvPdSu7OhxmMnVGx/5qUmJJPQvJqstnV8to Vw80xlRYeJS+EvUE88zOJy3owuz7Ez7RhL4B8RF2Z/ocapSaKN9T+/ch/us3N+hKvsjU39 42oajkWLhCKsMJso3tJislBPcnx72ww= X-MC-Unique: ob5OXXoVP7KlYr1H6FnEUQ-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 11/12] tests/fp: Do not emit implicit-fallthrough warnings in the softfloat tests Date: Fri, 11 Dec 2020 16:24:25 +0100 Message-Id: <20201211152426.350966-12-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The softfloat tests are external repositories, so we do not care about implicit fallthrough warnings in this code. Signed-off-by: Thomas Huth Reviewed-by: Chen Qun Reviewed-by: Richard Henderson --- tests/fp/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fp/meson.build b/tests/fp/meson.build index 3d4fb00f9d..8d739c4d59 100644 --- a/tests/fp/meson.build +++ b/tests/fp/meson.build @@ -27,6 +27,7 @@ tfdir =3D 'berkeley-testfloat-3/source' sfinc =3D include_directories(sfdir / 'include', sfspedir) =20 tfcflags =3D [ + '-Wno-implicit-fallthrough', '-Wno-strict-prototypes', '-Wno-unknown-pragmas', '-Wno-uninitialized', @@ -209,6 +210,7 @@ libtestfloat =3D static_library( ) =20 sfcflags =3D [ + '-Wno-implicit-fallthrough', '-Wno-missing-prototypes', '-Wno-redundant-decls', '-Wno-return-type', --=20 2.27.0 From nobody Fri May 17 08:39:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607704828; cv=none; d=zohomail.com; s=zohoarc; b=IidHNQ6f7Vb4yOCIdCe7aKoJc7oOfIT/l8v5ltbjmlbmMNV1bPGF/TkOB3goaOzRHZCO0znmGm0ul30F+6hjw+OxbEvSaClGt1fru7sOO3uzvaNc7OZfcuF9gCf0YjVDzEotl6sYkQnY5sn5vbnCIA9zV2NjbSuw84sg5wji07k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607704828; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=akm8zx7kP+fw1agXeXqa7qQpah8d4APvnhSn0siOey0=; b=gHAn6OBv1vCnGkWwwhPxDCyMPH6STe8/Eb9K9nbH+lcmxSGYnQCAfClMj2kz0iavVh3Ju2VcOg02L42Q4PutlGb+0ShywlU/6hAPzb1/uebFWvbqvjkoZUSBIcvDRH75XwabxqAAILhmLIMGs1OL7SNph2zfp9aPSHhaykRwj5A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607704828698473.0553682074592; Fri, 11 Dec 2020 08:40:28 -0800 (PST) Received: from localhost ([::1]:42502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knkTQ-0008Dr-Ts for importer@patchew.org; Fri, 11 Dec 2020 10:36:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knkI2-0004kI-6V for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:25:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knkHy-000668-KL for qemu-devel@nongnu.org; Fri, 11 Dec 2020 10:25:01 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-UmRNNHBAPVOP_wwlkigXGg-1; Fri, 11 Dec 2020 10:24:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1391800D62; Fri, 11 Dec 2020 15:24:53 +0000 (UTC) Received: from thuth.com (ovpn-113-76.ams2.redhat.com [10.36.113.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 289C010016F5; Fri, 11 Dec 2020 15:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607700297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=akm8zx7kP+fw1agXeXqa7qQpah8d4APvnhSn0siOey0=; b=RarOL3jN+y+hLTwUCClwQmZdqXTRyeg1waz2s8Hg6eHYI/Nf59QsjTEMJn18PTta31os7i V8NZF8RBzbPiwj1JguIUOXumtJmot1v0xXdCB2uMAbM/fCIOuSBcKL+dbPcJsErsMaLBqP GEjLq4iMuEg1nJH5msPgZ3lMKWKTI9A= X-MC-Unique: UmRNNHBAPVOP_wwlkigXGg-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Subject: [PATCH 12/12] configure: Compile with -Wimplicit-fallthrough=2 Date: Fri, 11 Dec 2020 16:24:26 +0100 Message-Id: <20201211152426.350966-13-thuth@redhat.com> In-Reply-To: <20201211152426.350966-1-thuth@redhat.com> References: <20201211152426.350966-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chen Qun , Richard Henderson , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Coverity always complains about switch-case statements that fall through the next one when there is no comment in between - which could indicate a forgotten "break" statement. Instead of handling these issues after they have been committed, it would be better to avoid them in the build process already. Thus let's enable the -Wimplicit-fallthrough warning now. Signed-off-by: Thomas Huth Reviewed-by: Chen Qun Reviewed-by: Peter Maydell --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 18c26e0389..dc2bc3c2f0 100755 --- a/configure +++ b/configure @@ -2007,6 +2007,7 @@ add_to warn_flags -Wempty-body add_to warn_flags -Wnested-externs add_to warn_flags -Wendif-labels add_to warn_flags -Wexpansion-to-defined +add_to warn_flags -Wimplicit-fallthrough=3D2 =20 nowarn_flags=3D add_to nowarn_flags -Wno-initializer-overrides --=20 2.27.0