[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240308113215616-0800.eberman@hu-eberman-lv.qualcomm.com>
Date: Fri, 8 Mar 2024 11:55:23 -0800
From: Elliot Berman <quic_eberman@...cinc.com>
To: Quentin Perret <qperret@...gle.com>
CC: Christoph Hellwig <hch@...radead.org>, Will Deacon <will@...nel.org>,
Chris Goldsworthy <quic_cgoldswo@...cinc.com>,
Android KVM
<android-kvm@...gle.com>,
Patrick Daly <quic_pdaly@...cinc.com>, Alex Elder
<elder@...aro.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Murali Nalajal <quic_mnalajal@...cinc.com>,
Trilok Soni
<quic_tsoni@...cinc.com>,
Srivatsa Vaddagiri <quic_svaddagi@...cinc.com>,
Carl van Schaik <quic_cvanscha@...cinc.com>,
Philip Derrin
<quic_pderrin@...cinc.com>,
Prakruthi Deepak Heragu
<quic_pheragu@...cinc.com>,
Jonathan Corbet <corbet@....net>, Rob Herring
<robh+dt@...nel.org>,
Krzysztof Kozlowski
<krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Konrad Dybcio
<konrad.dybcio@...aro.org>,
Bjorn Andersson <andersson@...nel.org>,
"Dmitry
Baryshkov" <dmitry.baryshkov@...aro.org>,
Fuad Tabba <tabba@...gle.com>,
"Sean Christopherson" <seanjc@...gle.com>,
Andrew Morton
<akpm@...ux-foundation.org>,
<linux-arm-msm@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-mm@...ck.org>
Subject: Re: Re: Re: Re: Re: [PATCH v17 19/35] arch/mm: Export direct
{un,}map functions
On Wed, Mar 06, 2024 at 12:05:38PM +0000, Quentin Perret wrote:
> 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.
Fair enough. We're building out more use cases where we want to allocate
memory from buddy and donate it to some entity which unmaps it from
Linux (some entity = Gunyah or Qualcomm firmware). Video DRM is an
example we're working on. I imagine OP-TEE might eventually have
use-cases as well since pKVM is doing same. David expressed concerns
about exporting the direct unmap functions. What kind of
framework/restrictions do we want to have instead? I don't think making
drivers like Gunyah a builtin-only module [1] (even a refactored/small
portion) is the best approach, but maybe that is what we want to do.
Thanks,
Elliot
[1]: qcom_scm_assign_mem (d/firmware/qcom/qcom_scm.ko) is an example of
a module that would have to become builtin as we upstream use cases that
lend buddy-allocated memory to firmware
Powered by blists - more mailing lists