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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E277C5475B for ; Wed, 6 Mar 2024 12:05:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F1C76B0072; Wed, 6 Mar 2024 07:05:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 793DE6B0074; Wed, 6 Mar 2024 07:05:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65BFE6B0075; Wed, 6 Mar 2024 07:05:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4D9C66B0072 for ; Wed, 6 Mar 2024 07:05:50 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 14232C0C65 for ; Wed, 6 Mar 2024 12:05:50 +0000 (UTC) X-FDA: 81866485260.24.03C77AF Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by imf11.hostedemail.com (Postfix) with ESMTP id 3EA7A4000F for ; Wed, 6 Mar 2024 12:05:47 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=UdHsUVzD; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf11.hostedemail.com: domain of qperret@google.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=qperret@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709726748; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vQBd6ohf0amX1OsSt75FPx0/Dj4ojSvbJw4UdMmdjuQ=; b=JF6ussKpop1HjUUzv4tApCehivC7IjyYfUl1cJHwhJIcqeW3LxYl5Zek9nDlDeCgyw4LPT 1GXBMlnQdqmFJJjt7KD3rHN9vnMUL0PmAlBKZSdlEgF3CiVGoCpnxNACmUm9E+0eg25s0l /H2+Qpodrof6kL3vG0/vNA2gtNhdzi4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=UdHsUVzD; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf11.hostedemail.com: domain of qperret@google.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=qperret@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709726748; a=rsa-sha256; cv=none; b=k67f5sL+0MHoZdQdepOiyshJXtBryQuaMy2Qup9kurg98jbA20jdstjum4yKH4qULSd4lp TlAYRzFSwoVeV/APwd3E9EQqYmBq6sRHonxnpMP9OAnMetHtkwJ3kWvw+IRquS+HXhJFsY NHaAmkaRCAVtm/fQOl/b8TnL9pVsSRc= Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a44e3176120so498569566b.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=kvack.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=UdHsUVzDeQKT5xL2rw4X/jeOx3VCJbgMu8NoBpu/gYSZGUAg6sWPvNj50W2RmvNOF/ 8Ix/F/tC8Al4ULkRW+LUAhmmbdZEFDxtFrSAiDS9tnKVMsg5PXVi+/Ihjq9NQWLI6naU GrizzmAPi2zYFyHciAWEleH5Zxq5VOowCtOgtOrWfo09Z7HZI+kNvYKm1ZPpg0HJB9XW F3MkS+2TuGU6jrgKap1uXPvfjhLOezhk7ERkF1M+PJuCZ4MtpiuXbMSgxglk8gWGJ58r 5MsWcawCWNqP6l/mgBL60kKrZscuGHwIXcisSiKj5eXswo5F9O9atAKLXUiiez3IVksP u+OA== 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=pTflbUVB02PSEy9DqMxNyQjlRgHnH6mvc+aoPYrba9+Oe+gYXpPLBAnVcBx/mbBDDd CGptkj9p9U6OP3eHRJ/ORsp28dtzOeBNIeSzJn5ax1qIPLCqhoLNQqtyEQt/3vv4HowP 8VfQchYfxgqmsN6VHpRFcLhLaQULh91OXzXLQ+6aSnaiNHrVcbLkl5AtBu1TC4Qn4B1J bDOxdF+1M+gnpT9mn8faG0YWfhtYoXyysZJGM1R+KB/hg2oN2xE/AJUmXkJ9rnklRslC Mnhd3dr+eOmymtWpW8t85TZrWxBlAoK4IBtLMCoowuL/iIb41IHnRz1SWC0r0NT3LWtI lkIg== X-Forwarded-Encrypted: i=1; AJvYcCVt/bpOjzsF0J1eCetmAELPPxylGv/sn4+PfWA/8mgMZfB7EGirePsrGUKOVbfKSR0bEL1hoCoQbqgkpQUKjpqxkV4= X-Gm-Message-State: AOJu0Yypo/9DiT1x8eihA4+Rb1PnE76PkmE7A8/uxWFf0Wp/LQ1u4GQJ s3FKr18hDJ7itSqOWSqufa4lV9BdkIAAc9Q4ekpCjaIGlnK9WFSFFxTHbUMxSw== X-Google-Smtp-Source: AGHT+IENvyQtE8JoTg5kWVbQtkdALMsWYIyvhW3MrnxD6N4yBhPGZfzqW1SSMI9IG01/r9t2iOYJ8Q== 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> 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> X-Rspamd-Queue-Id: 3EA7A4000F X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: fwhyxg91qh138qe7g9zfigeggpzu7h4p X-HE-Tag: 1709726747-58972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qcMkDmVGqACKbLu1zr04xRCZ9KV2A5px90KeSxo4R9lx3yCeXxWQ4sp6IKCi61/cbFx5KTDeOUETbvQA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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