Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1017647lqs; Wed, 6 Mar 2024 04:06:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUj9VZdyLZZY4CnlPQJSULssKPuVmtkuciSr6s2atx3uhWPa3mUwBU7W0Vl4mK8WzNgZtFU+Le2tP5B8CrMwqzLLP/J3WuT7hWPOO9U3g== X-Google-Smtp-Source: AGHT+IHRhbQmou6c0dnuJixK36yMFgDWuYJ185TFQ0i/2pd82DuPDArxk1Iv2Us2jKO0Zdx1BIOX X-Received: by 2002:a17:903:22c6:b0:1db:fc05:9596 with SMTP id y6-20020a17090322c600b001dbfc059596mr5597546plg.67.1709726762211; Wed, 06 Mar 2024 04:06:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709726762; cv=pass; d=google.com; s=arc-20160816; b=uYrSRRNEtfYuw1x3pygJUcsiC82ZNGHTgKraMPcXM2tMRvm5LZyh6gKlZ55Bh3HsJV WDaXik/LS9n2Q7zG80c9x8vorYSIha3mFO5P8/r0QaZpDkwl8JhJKwbVk9oWP8XV51hP ka+cqHSOR0hrbB9EAAAbsoba+YAoPz2q4bSgvK725Njuzg0fzcu3s8BAUSsBw4meWJez 6jnHjEOxLxGZnVUaYckYSm0Q8b88eNkjvizwUWUZ/pTQ+er9ZRgjtr2xbaNDnks25COd 3sjPN+XtPTbHBDtm8YBdssidcBEmuncg11SqbKRXgIv5iuS2iC6nAfIpgA+7WGesqohz uT4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:to :from:date:dkim-signature; bh=vQBd6ohf0amX1OsSt75FPx0/Dj4ojSvbJw4UdMmdjuQ=; fh=pPrndI0jtGBBdigjfNQPlI5Q/FlA2ah05K529QNJx4Y=; b=uRF+gTKfTGlHGkpteboO64oiE72Nds/Q286keusEW+koW8ry0dsT4VyGIAXUZgP8hz 0Mifx8dOHai5t0FvxZ3TxKOyqml6K0YIQvNhBtZwNbZ/zPIp+zh5stJm64kJnsprYomu X8HLOfnNrc6cj/e7o41lKHwtyWLODjtoqhEkJWk0GA3cQdZxT7rE5hOuFDaX+lwKYlZ4 +rz9FT94WK2ci81IOjgncgqRwils3gdvT5Ew1h6Rq5aHGZFhh6sfa8cIli9d4Xs+y8w4 y3882Azp8ER5PWlMFiQ5RzcLfRWsQF8kb4n+i+q0A8E244a5/pUORaqXpZbZLSyCwJqP yCKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fCgebXBY; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-93868-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93868-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m16-20020a170902f65000b001dba7e06c0dsi12092957plg.127.2024.03.06.04.06.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:06:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93868-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fCgebXBY; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-93868-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93868-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D789A285B76 for ; Wed, 6 Mar 2024 12:06:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE0897FBC8; Wed, 6 Mar 2024 12:05:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="fCgebXBY" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 2B7097FBC1 for ; Wed, 6 Mar 2024 12:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709726749; cv=none; b=Wt76Jk0WB0VO2qO6R9aF0IG47lrvoWLfTtLFab4s0h/S70esUOgeL1BSyWvbyNTIUOTNLr3UMNVIP7s8NfXFi4S6E0nUorv9GQ9zwb9iEg3BkVO8Ab7qLgrrMLnNNUGgHe+oIsJ5UxVK80dQFMw0VYs1eTHbmI/VCf+0sLq25gc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709726749; c=relaxed/simple; bh=G2h6GxpF5//h2blrI86hP/+PhlQEWBbGNRiIcqGjf/8=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mFuNQ7WRmb5tJmXYSbNchVtcvmwUfrGq1y/vAEPibP+PX0fV0dtsQVtKGdzlCqDmUFULUprD37Al2jIn+nnBYDXfx5mqY2XMqzcp7DonivgrwiXhHGgDP1qAHueIY8fKiMGKscgQdUfB1GDW3MJU4ICrNkc3+5CbBimvEAhjbf0= 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=fCgebXBY; arc=none smtp.client-ip=209.85.218.53 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 Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a44e3176120so498569466b.1 for ; Wed, 06 Mar 2024 04:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709726746; x=1710331546; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vQBd6ohf0amX1OsSt75FPx0/Dj4ojSvbJw4UdMmdjuQ=; b=fCgebXBYJimHJMxp00O/23sjiuNFitpMjZsaJr+t6q6WsXMP4XPGS4Lz5IjYEjB7kN c2DnCATa1OzElDPifJZjjvufaKVJfGOqdwNRU2CeOaZdYCWzzCMlsIQ8ajx1TuxKI+fQ ev65ybWNwJUFOE3Yh24ECvFK24u4ebuM/duhXeVoKxLSjWXIkRn2cMx6QcMxGV8WEYpj TS/nLoCvrcxajaNtl83q3/2ebk3YVBA3Dlc1+V/QTIr2CZXSkP9y1Rek5NtWM+kp9Au5 3qkdO2btEyrw5IdlG6zugk3VnzNKpr2CxlGi1yrL83W6XGhbIGsWdt+FQpdbtvjPhoMY ZJkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709726746; x=1710331546; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vQBd6ohf0amX1OsSt75FPx0/Dj4ojSvbJw4UdMmdjuQ=; b=RYf9opSZCF0pi48X5fQO1sfGhjUQudBO62ObGJuEKIxhkb2DoIFIP1vRAUbJ9i/lSP p62stmCVhQy95Cg43Yiwj8gAKJPUkXcudeBf0r7/WfIhTlaHhrWBVsBaSPSIY/5rnmFh LeyES8dpp6uonPlJH5QVeUyv+fUc/sEpzzn/C22rqP+EmM+1qSTp0YpWI44+N3Id8XjJ HfiAZrDDfjsV6WTA94cPFb6uiTXtOCb98iTNJY49bqRW0DoTc30BSRL7mm532TGa3pxA Bb3sHp+HdzcflKvdv+al9RNuDkeVHAh6gjq5OJM4WuB7enPtTqKeCoxEm1uEi45pGmDk fi2A== X-Forwarded-Encrypted: i=1; AJvYcCVtsmvB3U/Sl4idmlwQFFu3GZXfKhwFZJtbyxjO5IwP2/k9bJAg+wLOOSHQFkBqdBgKtfVXoUKT7JDXIX6gKOeiU5BuV2chZZie4P5n X-Gm-Message-State: AOJu0YwWqHmyWno6QdurbeRxKYfd1+0P0NR3E99Yy0Dor81ocuFAhs+e aCeWj9KVN3El4+UKizMuDY5nG5f8W2+4i6ZQtjUkOsPoWJDf58JKIRmAzRCAJw== X-Received: by 2002:a17:906:b850:b0:a45:ad29:72e7 with SMTP id ga16-20020a170906b85000b00a45ad2972e7mr2827372ejb.36.1709726746372; Wed, 06 Mar 2024 04:05:46 -0800 (PST) Received: from google.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id h20-20020a170906591400b00a3d5efc65e0sm7072616ejq.91.2024.03.06.04.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 04:05:45 -0800 (PST) Date: Wed, 6 Mar 2024 12:05:38 +0000 From: Quentin Perret To: Christoph Hellwig , Will Deacon , Chris Goldsworthy , Android KVM , Patrick Daly , Alex Elder , Srinivas Kandagatla , Murali Nalajal , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Philip Derrin , Prakruthi Deepak Heragu , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Konrad Dybcio , Bjorn Andersson , Dmitry Baryshkov , Fuad Tabba , Sean Christopherson , Andrew Morton , linux-arm-msm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: Re: Re: Re: Re: [PATCH v17 19/35] arch/mm: Export direct {un,}map functions Message-ID: References: <20240222-gunyah-v17-0-1e9da6763d38@quicinc.com> <20240222-gunyah-v17-19-1e9da6763d38@quicinc.com> <20240223071006483-0800.eberman@hu-eberman-lv.qualcomm.com> <20240304094828133-0800.eberman@hu-eberman-lv.qualcomm.com> <20240305093131473-0800.eberman@hu-eberman-lv.qualcomm.com> 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: <20240305093131473-0800.eberman@hu-eberman-lv.qualcomm.com> On Tuesday 05 Mar 2024 at 12:26:59 (-0800), Elliot Berman wrote: > I still disagree that this is a Gunyah-specific problem. As far as we > can tell, Arm doesn't specify how EL2 can tell EL1 its S2 page tables > couldn't give a validation translation of the IPA from stage 1. IMO, > downstream/Android pKVM is violating spec for ESR_EL1 by using the > S1PTW bit (which is res0 for everyone except EL2 [1]) and this means > that guests need to be pKVM-enlightened. Not really, in pKVM we have a very clear distinction between host Linux and guests, and only the host needs to be enlightened. But luckily, since pKVM is part of Linux, this is pretty much an internal kernel thing, so we're very flexible and if the S1PTW trick ever conflicts with something else (e.g. NV) we can fairly easily switch to another approach. We can tolerate non-architectural tricks like that between pKVM and host Linux because that is not ABI, but we certainly can't do that for guests. > If we are adding pKVM > enlightment in the exception handlers, can we add Gunyah enlightment to > handle the same? If you mean extending the Linux SEA handler so it does what Gunyah wants, then I'm personally not supportive of that idea since the 'contract' between Linux and Gunyah _is_ the architecture. The only ways I could see Gunyah delegate stage-2 fault handling to Linux cleanly is: - either talk to Arm to introduce a new ESR specifically for this, which doesn't sound entirely crazy to me; - or have Gunyah and Linux negotiate in software the location of the handlers. That probably means SDEI or equivalent which is a can of worm in itself I presume, and I'm not sure how feasible it would be for this handler to live in the Gunyah driver (that too probably requires exporting kernel symbols we don't want to export). Thanks, Quentin