From patchwork Fri Jul 26 11:27:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 169808 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp12908431ilk; Fri, 26 Jul 2019 04:27:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaD+m+p6JiN2HES+EjvA49uEi6keOhVsVZOWn13GLMCpx3FkCHh2ZbNlA6Ch8ykJT+3aSI X-Received: by 2002:a17:90a:2768:: with SMTP id o95mr97332337pje.37.1564140433357; Fri, 26 Jul 2019 04:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564140433; cv=none; d=google.com; s=arc-20160816; b=pQBHr5PqlQMjWCVH+DceBT72hGXn+bhxIkFBl3RRnbKdvEWxeK+nwNuYfCpBbUvKga 5pjpzbUS/K6qcUpNyLZA2i7V2/hqTpyzJW2D9InR4sQSzTlndhrXnpHrunLqNScM/ZJW kfnhZIlz/G8+ct6XM/Lkk/6wzBaeX9XVvldtWwF4Zx1DszpHJzJ4WkP4MYvMf9MqtXv4 6BhnMMliyDCbbiycA76it0h3kDFUhl935C2Iw4o11WlBWRqeGkaBnn9I+hdYmyUgVYOI XrLV2MA7r2XphD3oQ+Ql9FDPxyhBNi/HH3jSs2K5ZWWCDH8Xq5lRqEqPhfLUYBBBgdYn 6S6g== 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=AQ36OOVKHCIPdxorMcETnce0F0t+65n/6Z09aFeN1wQYNTqD+JpNNIBp4CQkGWF+U7 Bg1lnmFfkYn+qAqkW6w1W2UPH2KHFOFCMZ+Yx7TnRPc+oF/dQHU8nME0zW4o82CjMoQj YDDGjUrw4E9mr146iY4KTFlmDI94lPSFnw8Y7f+y2ZGl/2BHJenGVwB+9Cnpo9dqXo81 V/In2sl+Xnm0PavmYFIkgVNpX1rM85iHfENPDooELHHgdYAjrIOnYndzzL5vj0wNh2bW GA+BNVOPygfsZPP/Xsefyp4/zJ9S92o1smbwvB2X7GAYRazqkZavqDT5iKeYSTB147Wh xOTw== 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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 y6si19617628pfl.288.2019.07.26.04.27.13; Fri, 26 Jul 2019 04:27:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1726832AbfGZL1M (ORCPT + 14 others); Fri, 26 Jul 2019 07:27:12 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:47063 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbfGZL1M (ORCPT ); Fri, 26 Jul 2019 07:27:12 -0400 Received: by mail-lj1-f193.google.com with SMTP id v24so51240504ljg.13 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=pRm5P4+kNE8Yi7/kIJp7fzOgFwkFOyOzHKc4rVbFq+2PvoMf5VHXr6pMfRuPne2eTf wRTGejUbXWEy4r9Usqn6HEgTMUpOwGy2x/ZA14NmPfZ7xveNQR2/rwo4eB40OfGWG2l/ fgDNFqpyr4U6fcmGbbHZpSXdSP4Caa/Mx/CUk2Kc5wq4H5cE0xDFWmhzV92zrllqNjGF fkIQME8fzyGC/iN2Lxq7nlf307RHjtVX4gURlkeCSzHzdGeguIM6n2a8O6rG73vB+3fF Bwbz+y9faH43h6wocsD8EeF0qj5evvWBEInyhWy3mTNeC8JyyRwKNohzHTmjpj0Bi6CP x/Ug== X-Gm-Message-State: APjAAAWn9VnMqySxRrGDpDER6DP7YCPKRiE9ibpBHgWRfkpvVJkzsJy1 NvIokkQlBaChcQlCzFPyYUHDNQ== 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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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(+) -- 2.20.1 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; } }