From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A585E3E3DBE; Tue, 24 Mar 2026 14:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363410; cv=none; b=tBT7Ofz7OYfOCqikjc8abQPpE9/iivzlQvGcPp/oyuGDpyC2XQx7XCSB2T7VJyGdemtFdXgdOp0+s3FdOkrdqQy9rYaEV2VTvjBbxRXP5gCizZyCQyPz/7wDvHoFOEgZxRrFaxT1mKZFBVhVxaJsh4uqFORBT/nhVHoAjUn93AY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774363410; c=relaxed/simple; bh=dTzqwHUwJjx23yBT/T2PZMHiFC+SFcUAQiUhmXgvGUU=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=A97wE5MdkbXlZ6oyjiQD2I4toPc6IMPqNZ9QExqiMzoQKV85JgdwXAXGxAEcYyDdFh/JBnYSVFmAqNMYMJLmp5UpRehjTtZELsolksRFZMsG3RmewEbRoEHL/ew2Bsu/IlGMNrArSuubEb9U4dlGehXItQdMW4kpg7wlcVUntQA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bvOspPMZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bvOspPMZ" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.