From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D6C2F54AC6 for ; Tue, 24 Mar 2026 14:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ypL71TbUO3ACDIQ6ajKBTtI6yVSQ9R9Xf5ADCoEtURs=; b=oL7ggLllyqZpiI/MZ3kD+jquPm DLNumIbyGdo2/S0YBgzkds4FohaGh+qtS394F5kZYMld0tAzHAYz5w/4bLXk3mDRSGX/K58PsJZH4 SkLrVxsNCybqikqsCXXgDHt5nEnOjwZJo61BEu21xXBQXvZaYSNgfsZXNpVTwnWO23zaRkE9gnrRT vJU/7FzxdiOxuixDtI/XfSQBTgviB0lsXwg27R+tnb48rcSqThoMNWimv0bLXfCfLyJ7244PGgYw3 c8aa3wuzx7z2/C4WnWsCTHbq3zZVmiRCdD2CRYt2wFcvtuRraQDsk4tuRn3qa4Xpx5KObsoXF/B2P UfrLIUaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w52yj-00000001g6K-148l; Tue, 24 Mar 2026 14:43:33 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w52yh-00000001g5i-1P3o for linux-arm-kernel@lists.infradead.org; Tue, 24 Mar 2026 14:43:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 669AA43F1A; Tue, 24 Mar 2026 14:43:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39051C2BC87; Tue, 24 Mar 2026 14:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774363410; bh=dTzqwHUwJjx23yBT/T2PZMHiFC+SFcUAQiUhmXgvGUU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bvOspPMZsQjbmvms/frf9JCzh8WBrN8Pa4xVrl6TVCrAL/lK9kaKzBcMpHk5lJNmO B5SMWSbtuOyJYeI+KV/Xh3p66/GVHMnm1W2lt9K0MphR/dvJiTcFtK60D93juHNLZD jk383JxcOO8nFC1O31+xWLLI6q6mLD+ZrygJiHWUwqj2cblGkAyc8SqKNyQH5+4Aoy eskez4cFmyN3Lpm67cZKXQYSB3wfwG9yMJ8qb60d/dUSCUYjaRo856mCGu1Xnzd8hY Qv0oZ/umTlePQgofbsKZESaviN9oSvhE/UF4h7WPTfmyg5R5cB+tihEmhsv6xy78Gs QZO/StQieIyaQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w52yd-00000005Cna-3lE9; Tue, 24 Mar 2026 14:43:28 +0000 Date: Tue, 24 Mar 2026 14:43:27 +0000 Message-ID: <86tsu547ao.wl-maz@kernel.org> From: Marc Zyngier To: Sebastian Ene Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, android-kvm@google.com, catalin.marinas@arm.com, joey.gouly@arm.com, mark.rutland@arm.com, oupton@kernel.org, suzuki.poulose@arm.com, tabba@google.com, vdonnefort@google.com, will@kernel.org, yuzenghui@huawei.com Subject: Re: [PATCH] KVM: arm64: Inject UNDEF when host is executing an smc with imm16 != 0 In-Reply-To: <20260324135728.3532400-1-sebastianene@google.com> References: <20260324135728.3532400-1-sebastianene@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sebastianene@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, android-kvm@google.com, catalin.marinas@arm.com, joey.gouly@arm.com, mark.rutland@arm.com, oupton@kernel.org, suzuki.poulose@arm.com, tabba@google.com, vdonnefort@google.com, will@kernel.org, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260324_074331_389590_C7098CCE X-CRM114-Status: GOOD ( 13.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 24 Mar 2026 13:57:28 +0000, Sebastian Ene wrote: > > The ARM Service Calling Convention (SMCCC) specifies that the function > identifier and parameters should be passed in registers, leaving the > 16-bit immediate field of the SMC instruction un-handled. > Currently, our pKVM handler ignores the immediate value, which could lead > to non-compliant software relying on implementation-defined behavior. > Enforce the host kernel running under pKVM to use an immediate value > of 0 by decoding the ISS from the ESR_EL2 and inject an undefined > instruction exception back to the caller. No, that's completely wrong. SMC never UNDEFs, unless EL3 isn't implemented. You can't just decide to generate an UNDEF because you don't like the immediate. All you are allowed to do is to return an error code. Thanks, M. -- Without deviation from the norm, progress is not possible.