From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 079174035BA for ; Tue, 24 Mar 2026 15:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774364680; cv=none; b=QjU7udFXCJEEBlWJ+YmQ4oUdNtAE9qw2thFpSbS48xEp4c+rEgFgW2VOgT4zXguOPm5p8Mt9N8Zf3OcRe2G1/NsGe4UeSiR9qqowTCFLGakEtAlHli9zlxmQRGeK9msZ/HoyYg5FIkRR2EfYqK161A+Hu2GbNz8WUFzEVYKzMbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774364680; c=relaxed/simple; bh=hUPt1yzHQIdBr/atCihsNh26aSwnSxYLRego8dNIzJg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DqJkVAjYUxxez5lQIPi9uDzUdQd0kntLKhkhjemehq5DhoR9yGoOnT+ah5pVISVzYZtQmI5t8583PcUCGvCoJA8tpHIJOSVy6PxM468yYmLSMytzg/y+ktF/uaD8vCqBOpNOs12U8Gd3xAxahZ2j6ZBdRyyCkA6SWhcYi4uiwlA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Xm6DuJnq; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Xm6DuJnq" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4852ef20fe8so68195e9.1 for ; Tue, 24 Mar 2026 08:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774364675; x=1774969475; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=x8Ez8KE3X9ncxAR8sxSpYM0vX0MuKytP0Jw8nmLk1y4=; b=Xm6DuJnqhgIq0zzeH8bgfToXji6K404qMOibI1Me62nzxaRBb6Zpjd2c3IIguwf7C8 eLx9khbLv6juws2sgDInN1Z+h6yWq3sOcnU0XoWa4zuwsD9dnTj/+1YA6XZLhGlIyrvS wocfREJoxmEmhiufEfRIV0MXo+Dd58iG+uN9p90jkkknWDa4wpKhxp0Cy1yaoHkcU1QY zjX+KbQvmD8mmx/4Sf2O0+pWISez62pI2UNVtHIs9MkSrho7i8xduon+0betj1BQ8u9y VLLH5u9Pc8U8vo/IDBijj3ISwSZT8iOLWyEyOQJaPw/lMNq8qby8lmyU5mhaW2x0KHkK H3uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774364675; x=1774969475; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x8Ez8KE3X9ncxAR8sxSpYM0vX0MuKytP0Jw8nmLk1y4=; b=jxUXgRmTHqsA85MO+ddGUmKSyNBYiW125RHLurBuUQPBf5eOPwRY6dMZYSvHAMJ/j4 EYYtULsFNZ0U5xliXWixmW2GDp7vIAkt8sJr+RTMck9W5ugdfyrmKdlG33fOetdQBcGA WKzTu7dH9AKCnZjH55CgrkIYV5dxEec8rfKz8aUCB6EvwyqMeHdv7Ge6/Poog+oum/MF jRRvcM1AdGYJcXN68QBOUBgLNYfWL3XdodZcKRsXoHHJfpcXNSxtYlrrhyMeYTpM3WyR A/opwQJmyP1n/Z3JJ4W+85Aoc72NHvoWMheKWmeMVK/aDI7KsaMCCDMeifJCv5dUnDOa fYiQ== X-Forwarded-Encrypted: i=1; AJvYcCW1Z0k7Uu6sDNub1Km2GnEr0uXH7pQ/Fq3J8n2M7xdQyxnltsE30EEOSZT7CEiDn8vdOkjfl8BaLLVJgEk=@vger.kernel.org X-Gm-Message-State: AOJu0YxvaaAXCWBtDU0n8+5gfjkvn+v5vO7BKtBkLovV2R8iLZ03351U ezSN1DmNFW33nEgaNXI0b0SExbOP/Oa1pU20AgKOCVEzaeC/ooawPR4JPrazLf6TuvqCa5oyp/Y 2jS5X0L72 X-Gm-Gg: ATEYQzxUwPl318pDCLaMH1k22gBlLc5zprUXcAhr/svIPI9twpyGz20x12y0KaKjE6d OwKk6IQOHz9Lu6+zGUDQZNZklsD17qwvHVn2UkCZgw6cMW0Hz8rJh6fekRbWiRuq2nSVDE/JhwS 3MPvZ1R+HADKjR/uJoL4Im39EiwwtDK4Swr0GXZdQRH5Hv5ZDbrDljaHSOqBlKIvjoTx80FscFi sCa2876fg8FW0cZATUwDpTKXWG+/jnZJR4bvXVqt+HhXf7UE5RRsMsZ0uL/LhfzXN9MKpA6RrrN vevgBXhT+aM9h5QZd8lDXNT4v0BIBQ8OhMjP1LtH+QRXy4Heom3BN5iiDtrdNYUC1X+F08OKb4M brEOtp0eGUYXfa6tAvD1+xmRanttE6g/GlOyHNTO04NChnjPFJKsrGgwJnHzzAPFnap5igMAppW nsHTDDzU4+ZIfPX6eEJK8H5LPvd+DcbbXEZ3/R3n35Ta169YyDUdXL9s0o3tig36uA3zA= X-Received: by 2002:a05:600c:6388:b0:486:fd5a:18db with SMTP id 5b1f17b1804b1-48710f55c35mr1233335e9.11.1774364674685; Tue, 24 Mar 2026 08:04:34 -0700 (PDT) Received: from google.com (209.13.205.35.bc.googleusercontent.com. [35.205.13.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48710fd2c4esm38080035e9.4.2026.03.24.08.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 08:04:33 -0700 (PDT) Date: Tue, 24 Mar 2026 15:04:29 +0000 From: Sebastian Ene To: Marc Zyngier 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 Message-ID: References: <20260324135728.3532400-1-sebastianene@google.com> <86tsu547ao.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86tsu547ao.wl-maz@kernel.org> On Tue, Mar 24, 2026 at 02:43:27PM +0000, Marc Zyngier wrote: > 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. Hi Marc, > > 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 for letting me know, I will update the patch to do this. > > Thanks, > > M. > Cheers, Sebastian > -- > Without deviation from the norm, progress is not possible.