<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/soc/qcom/cmd-db.c, branch linux-5.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-09-04T11:15:04Z</updated>
<entry>
<title>soc: qcom: cmd-db: Map shared memory as WC, not WB</title>
<updated>2024-09-04T11:15:04Z</updated>
<author>
<name>Volodymyr Babchuk</name>
</author>
<published>2024-07-18T06:03:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0ee9594c974368a17e85a431e9fe1c14fb65c278'/>
<id>urn:sha1:0ee9594c974368a17e85a431e9fe1c14fb65c278</id>
<content type='text'>
commit f9bb896eab221618927ae6a2f1d566567999839d upstream.

Linux does not write into cmd-db region. This region of memory is write
protected by XPU. XPU may sometime falsely detect clean cache eviction
as "write" into the write protected region leading to secure interrupt
which causes an endless loop somewhere in Trust Zone.

The only reason it is working right now is because Qualcomm Hypervisor
maps the same region as Non-Cacheable memory in Stage 2 translation
tables. The issue manifests if we want to use another hypervisor (like
Xen or KVM), which does not know anything about those specific mappings.

Changing the mapping of cmd-db memory from MEMREMAP_WB to MEMREMAP_WT/WC
removes dependency on correct mappings in Stage 2 tables. This patch
fixes the issue by updating the mapping to MEMREMAP_WC.

I tested this on SA8155P with Xen.

Fixes: 312416d9171a ("drivers: qcom: add command DB driver")
Cc: stable@vger.kernel.org # 5.4+
Signed-off-by: Volodymyr Babchuk &lt;volodymyr_babchuk@epam.com&gt;
Tested-by: Nikita Travkin &lt;nikita@trvn.ru&gt; # sc7180 WoA in EL2
Signed-off-by: Maulik Shah &lt;quic_mkshah@quicinc.com&gt;
Tested-by: Pavankumar Kondeti &lt;quic_pkondeti@quicinc.com&gt;
Reviewed-by: Caleb Connolly &lt;caleb.connolly@linaro.org&gt;
Link: https://lore.kernel.org/r/20240718-cmd_db_uncached-v2-1-f6cf53164c90@quicinc.com
Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: cmd-db: Fix an error code in cmd_db_dev_probe()</title>
<updated>2019-03-28T04:32:26Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2019-02-28T05:48:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93b260528020792032e50725383f27a27897bb0f'/>
<id>urn:sha1:93b260528020792032e50725383f27a27897bb0f</id>
<content type='text'>
The memremap() function doesn't return error pointers, it returns NULL.
This code is returning "ret = PTR_ERR(NULL);" which is success, but it
should return -ENOMEM.

Fixes: 312416d9171a ("drivers: qcom: add command DB driver")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: cmd-db: Stop memcpy()ing in cmd_db_read_aux_data()</title>
<updated>2018-11-14T18:06:24Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2018-09-26T18:02:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed3cafa79ea756be653d22087c017af95ea78a49'/>
<id>urn:sha1:ed3cafa79ea756be653d22087c017af95ea78a49</id>
<content type='text'>
Let's change the function signature to return the pointer to memory or
an error pointer on failure, and take an argument that lets us return
the size of the aux data read. This way we can remove the
cmd_db_read_aux_data_len() API entirely and also get rid of the memcpy
operation from cmd_db to the caller. Updating the only user of this code
shows that making this change allows us to remove a function and put the
lookup where the user is.

Cc: Mahesh Sivasubramanian &lt;msivasub@codeaurora.org&gt;
Cc: Lina Iyer &lt;ilina@codeaurora.org&gt;
Cc: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: Evan Green &lt;evgreen@chromium.org&gt;
Cc: Jordan Crouse &lt;jcrouse@codeaurora.org&gt;
Cc: Rob Clark &lt;robdclark@gmail.com&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: cmd-db: Remove memcpy()ing from cmd_db_get_header()</title>
<updated>2018-11-14T18:05:50Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2018-09-26T18:02:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84fa36eb30f2e02ebf07a22fea2550a7a3938bec'/>
<id>urn:sha1:84fa36eb30f2e02ebf07a22fea2550a7a3938bec</id>
<content type='text'>
The cmd_db_get_header() function is a static local function that doesn't
need to copy anything from one place to another. Instead, it can just
point into the region by returning pointers to what we're looking for.
If we do that, we should mark what we're returning as const so that code
can't modify cmd-db without an obvious cast.

Cc: Mahesh Sivasubramanian &lt;msivasub@codeaurora.org&gt;
Cc: Lina Iyer &lt;ilina@codeaurora.org&gt;
Cc: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: cmd-db: Make endian-agnostic</title>
<updated>2018-05-25T20:53:52Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2018-04-19T18:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36b0aefdee6e203f3130d7444bf5103139ecbe25'/>
<id>urn:sha1:36b0aefdee6e203f3130d7444bf5103139ecbe25</id>
<content type='text'>
This driver deals with memory that is stored in little-endian format.
Update the structures with the proper little-endian types and then
do the proper conversions when reading the fields. Note that we compare
the ids with a memcmp() because we already pad out the string 'id' field
to exactly 8 bytes with the strncpy() onto the stack.

Cc: Mahesh Sivasubramanian &lt;msivasub@codeaurora.org&gt;
Cc: Lina Iyer &lt;ilina@codeaurora.org&gt;
Cc: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>drivers: qcom: add command DB driver</title>
<updated>2018-05-25T20:53:52Z</updated>
<author>
<name>Mahesh Sivasubramanian</name>
</author>
<published>2018-04-10T17:57:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=312416d9171a1460b7ed8d182b5b540c910ce80d'/>
<id>urn:sha1:312416d9171a1460b7ed8d182b5b540c910ce80d</id>
<content type='text'>
Command DB is a simple database in the shared memory of QCOM SoCs, that
provides information regarding shared resources. Some shared resources
in the SoC have properties that are probed dynamically at boot by the
remote processor. The information pertaining to the SoC and the platform
are made available in the shared memory. Drivers can query this
information using predefined strings.

Signed-off-by: Mahesh Sivasubramanian &lt;msivasub@codeaurora.org&gt;
Signed-off-by: Lina Iyer &lt;ilina@codeaurora.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
</feed>
