Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp12080805ybi; Fri, 26 Jul 2019 04:29:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvIreKogDX7HBSCqY9r4DKRjKnFlLFA/0/PTk1raex1ng+56pCWo/aZjxfNCVBJDaJTiWk X-Received: by 2002:a63:ff20:: with SMTP id k32mr91230198pgi.445.1564140551619; Fri, 26 Jul 2019 04:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140551; cv=none; d=google.com; s=arc-20160816; b=TzA/CuG1k2PpkbZ0vRZhbbMzSN0UDOMwr6p8jsYVXhl9TGzRAQxpJsaGN4iCB85Zdk JYMcNps1NwnXvLOz66p4nru4Ddoq3zyWdJfDj+duRVbHCVEJGDQiW81hofMzh9CItyKq yVUud744+THeIWf3AtYMCFJeCYV4HUhe1iIq0PiUjRi0+XxV5c0CNqCmTekghgNns3VG M4XDJMp5uBCYL9CTRKytN4/ia7IRY3z2JylfRw+Mub7Q4QX2gSYK6meJOKz42akERykg qfGM1QFjVKNRAOeK/OhBpKU8uwS/EKlJGycEBlZhX1gp6C4BE1f7D6HDFkhI+vaepfzd G6Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/ZeEPeRDOknxPoC0/mlXSl8BxnaCt+PLZvPwsv+/Wqg=; b=KG2f7RFrAC80HQh46+UmCi1475Ph5/pNhXr7FzA6dTWKQqc24gG7bQUglfvazPT1ks kWXOGiolguhjsPHqpuBjGLAQNu3d4l0uxkH5MSnurC1QP0WhNmwCnpducaiB6HbeOXdw elSubUxyYazXisy4fTjuRJIisvx+H/PBh896BF4nwJuaeZa0pdD6INeXoRai+IczQlxv ezshyJwEhbzSYkYCYNFBSXP1fGghuo67zacN1HX/q/CsMMrVzKopIOFD07y15UkBfvSw SaqEPqBJU0p3f1SA2DNO1fXTYm7XDmLTSuZkCXT6GRQd6INO2HQ7JruNnaV9fL1WeFDn GOSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oFWvs4Mv; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o93si19728472pje.38.2019.07.26.04.28.56; Fri, 26 Jul 2019 04:29:11 -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=@linaro.org header.s=google header.b=oFWvs4Mv; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbfGZL1M (ORCPT + 99 others); Fri, 26 Jul 2019 07:27:12 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:33053 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfGZL1M (ORCPT ); Fri, 26 Jul 2019 07:27:12 -0400 Received: by mail-lj1-f195.google.com with SMTP id h10so51160930ljg.0 for ; Fri, 26 Jul 2019 04:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/ZeEPeRDOknxPoC0/mlXSl8BxnaCt+PLZvPwsv+/Wqg=; b=oFWvs4MvlL5GP1gOZX6EZCUM2DYpnzic9Y3aW+lbwp2ZlxCnqCK7T5Bah4HG/joNOs hV63e0w5+svVL8XhftgWoWP/xCsWoblTf6/31WWKzPb/CwML3ON89eWY42RteRNyjwNS I197pa9xb3Qz6rxDm9hDLNq5ZbkJvSiwlFXcR8fDGrI/kDNBHrhXDuf88fagsz5HwmT7 MpJtdv/j3qYcrqljuvU0aunOcizbibYaxbPC/XFelw2VXEj2hKS0CyZoB45ls2x83PYh RbSW/E8DfU+T4TjCdPusX2d4I4gsNutKuwZXekucTrsBKtxPwVCvIaPHjB+M/RwiEKaA KCVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/ZeEPeRDOknxPoC0/mlXSl8BxnaCt+PLZvPwsv+/Wqg=; b=opDWQkU8pbcfPHlFJilFHE47kFE5W7W6zeQu/EGrRdarEI9LbTLKeGbB85ldJBQ0Zu MMQvbZas9pk/if4aAdykAXWPtcAA8Xzpk/QNIGKgl2CtV5LDq9sis6BYJ/p8B67y7sia hVUB3BCoIRsEYocGH9qDlMQc51+Lua8Tg60mirpRtZH+jdFbBNtqAREvwCbNkAMNuwYi dnAPvEnD07ymOaLWKr8+/d1sqJiu0iE+3uyUwzOKOL4fZXvf5AilNL9xG0CWh+vserJf FdmlAFsmgPZC/hjorO7D+J9YCScApSvDQre5vdDZSAKfnyrCw2+zxtSyee+dcU60qv1f Xl7Q== X-Gm-Message-State: APjAAAUnbdRyeqxWV4Uygd7uLeuvGgLCppP0iElxWy2wfze+Ct5E6qSZ X1SYgSeE8gVL2IqhJvm9AFxb2g== X-Received: by 2002:a2e:9593:: with SMTP id w19mr1978301ljh.69.1564140430346; Fri, 26 Jul 2019 04:27:10 -0700 (PDT) Received: from localhost (c-243c70d5.07-21-73746f28.bbcust.telenor.se. [213.112.60.36]) by smtp.gmail.com with ESMTPSA id q2sm8196273lfj.25.2019.07.26.04.27.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 04:27:09 -0700 (PDT) From: Anders Roxell To: maz@kernel.org, catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Anders Roxell , stable@vger.kernel.org Subject: [PATCH 1/2] arm64: KVM: regmap: Mark expected switch fall-through Date: Fri, 26 Jul 2019 13:27:05 +0200 Message-Id: <20190726112705.19000-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When fall-through warnings was enabled by default, commit d93512ef0f0e ("Makefile: Globally enable fall-through warning"), the following warnings was starting to show up: In file included from ../arch/arm64/include/asm/kvm_emulate.h:19, from ../arch/arm64/kvm/regmap.c:13: ../arch/arm64/kvm/regmap.c: In function ‘vcpu_write_spsr32’: ../arch/arm64/include/asm/kvm_hyp.h:31:3: warning: this statement may fall through [-Wimplicit-fallthrough=] asm volatile(ALTERNATIVE(__msr_s(r##nvh, "%x0"), \ ^~~ ../arch/arm64/include/asm/kvm_hyp.h:46:31: note: in expansion of macro ‘write_sysreg_elx’ #define write_sysreg_el1(v,r) write_sysreg_elx(v, r, _EL1, _EL12) ^~~~~~~~~~~~~~~~ ../arch/arm64/kvm/regmap.c:180:3: note: in expansion of macro ‘write_sysreg_el1’ write_sysreg_el1(v, SYS_SPSR); ^~~~~~~~~~~~~~~~ ../arch/arm64/kvm/regmap.c:181:2: note: here case KVM_SPSR_ABT: ^~~~ In file included from ../arch/arm64/include/asm/cputype.h:132, from ../arch/arm64/include/asm/cache.h:8, from ../include/linux/cache.h:6, from ../include/linux/printk.h:9, from ../include/linux/kernel.h:15, from ../include/asm-generic/bug.h:18, from ../arch/arm64/include/asm/bug.h:26, from ../include/linux/bug.h:5, from ../include/linux/mmdebug.h:5, from ../include/linux/mm.h:9, from ../arch/arm64/kvm/regmap.c:11: ../arch/arm64/include/asm/sysreg.h:837:2: warning: this statement may fall through [-Wimplicit-fallthrough=] asm volatile("msr " __stringify(r) ", %x0" \ ^~~ ../arch/arm64/kvm/regmap.c:182:3: note: in expansion of macro ‘write_sysreg’ write_sysreg(v, spsr_abt); ^~~~~~~~~~~~ ../arch/arm64/kvm/regmap.c:183:2: note: here case KVM_SPSR_UND: ^~~~ Rework to add a 'break;' in the swich-case since it didn't have that. That also made the compiler happy and didn't warn about fall-through. Cc: stable@vger.kernel.org # v3.16+ Fixes: a892819560c4 ("KVM: arm64: Prepare to handle deferred save/restore of 32-bit registers") Signed-off-by: Anders Roxell --- arch/arm64/kvm/regmap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kvm/regmap.c b/arch/arm64/kvm/regmap.c index 0d60e4f0af66..a900181e3867 100644 --- a/arch/arm64/kvm/regmap.c +++ b/arch/arm64/kvm/regmap.c @@ -178,13 +178,18 @@ void vcpu_write_spsr32(struct kvm_vcpu *vcpu, unsigned long v) switch (spsr_idx) { case KVM_SPSR_SVC: write_sysreg_el1(v, SYS_SPSR); + break; case KVM_SPSR_ABT: write_sysreg(v, spsr_abt); + break; case KVM_SPSR_UND: write_sysreg(v, spsr_und); + break; case KVM_SPSR_IRQ: write_sysreg(v, spsr_irq); + break; case KVM_SPSR_FIQ: write_sysreg(v, spsr_fiq); + break; } } -- 2.20.1