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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E3A2C433F5 for ; Tue, 12 Oct 2021 14:20:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BB7760EFE for ; Tue, 12 Oct 2021 14:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236943AbhJLOWZ (ORCPT ); Tue, 12 Oct 2021 10:22:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:56024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230195AbhJLOWY (ORCPT ); Tue, 12 Oct 2021 10:22:24 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 464F4608FE; Tue, 12 Oct 2021 14:20:23 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1maIdh-00GHHb-2V; Tue, 12 Oct 2021 15:20:21 +0100 Date: Tue, 12 Oct 2021 15:20:20 +0100 Message-ID: <87ee8qpbob.wl-maz@kernel.org> From: Marc Zyngier To: Andrew Jones Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kernel-team@android.com Subject: Re: [PATCH] KVM: arm64: Fix reporting of endianess when the access originates at EL0 In-Reply-To: <20211012120040.4tfkzlm7uju2n3sa@gator> References: <20211012112312.1247467-1-maz@kernel.org> <20211012120040.4tfkzlm7uju2n3sa@gator> 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/27.1 (x86_64-pc-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: drjones@redhat.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 12 Oct 2021 13:00:40 +0100, Andrew Jones wrote: > > On Tue, Oct 12, 2021 at 12:23:12PM +0100, Marc Zyngier wrote: > > We currently check SCTLR_EL1.EE when computing the address of > > a faulting guest access. However, the fault could have occured at > > EL0, in which case the right bit to check would be SCTLR_EL1.E0E. > > > > This is pretty unlikely to cause any issue in practice: You'd have > > to have a guest with a LE EL1 and a BE EL0 (or the other way around), > > and have mapped a device into the EL0 page tables. > > I wonder if that's something a usermode network driver might want? I don't know what it wants, but I don't want it the first place! Think of what a kernel would need to do to run its userspace in a different endianness... Userspace device access is just an additional headache. Whoever does this needs urgent medical attention! > Reviewed-by: Andrew Jones Thanks, M. -- Without deviation from the norm, progress is not possible.