Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp103576lqh; Wed, 27 Mar 2024 16:38:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEGTpruF2d5JJMZNMvy9vs4DTV+X2oBYD9SQg2a/3FF5Jq/du+/xi4sMCki4QqnTZscMUFF7fgAQPDrl0Bk5qgNfbACLD2wv1lxIXCPg== X-Google-Smtp-Source: AGHT+IF95TuIBe0cEsNCMnpu+uzoWCbsJCiiu5Vp6qBo/m4g6EOXfGCDQaBP4htBPfuGfo4Dh9OI X-Received: by 2002:a05:6808:15a3:b0:3c3:ca1c:4f04 with SMTP id t35-20020a05680815a300b003c3ca1c4f04mr1503801oiw.6.1711582700279; Wed, 27 Mar 2024 16:38:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711582700; cv=pass; d=google.com; s=arc-20160816; b=Pmq4DFwFqwjfRe98VNF8Kn45VQL+xw8LhVRVMRZC/6eyuk6KD1+HAFFDYTr1f584Nu gVYgV26+i/xRNr6uPvyAaYUyAEM2Ru2tjxl+ljVVP/n14jvVemputjP1lgVTalXqhKi6 H114Ckvp21o873er3MVqUnO+J+SJj1QbDoPD4/kMx8PrWFvsVkDxp7Xy/pZCJfv1ggq5 eHKPR/fyWwu2zwJEpzmFe8fYKTR+IZlXytqlxEbnT1iLxEsAZI5QxbsHEYCQUY0iigKs M05LqOeJLZJkcW8HWO+qb2DF288jNeMO+7PQ7uzBF2OR/SnzQLSl0oE5W6ZGgGdtA+fv HPcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=9PUNGNkymAHFEOcV0kzGalSNW81dr90U8zDmo0wkwhE=; fh=BqUc7GuNw4foot9jQ+B5+1wf+a5FkZ9iGvELoh6YuBo=; b=oZNY8imIKlPeKusGIspZpJiJmTP2IFZrhsHuNs0LUV2DRETTPfh8iiKbUt/tWXjUzy 6ECP7BTodxESwx+y51fYEkfz/Mx8H+7vGNriGeHGePRotFthg/UvzeRFN7WcG3r/VJ29 dv58ffYAIvldUKkIqReKgX+pJC9JOjER+y/Plkg0BofuJM9R45VBJrjzIda/omUa+Bgr y0jKgg702RPICRXOjB+tbFJ+tpl+PReAvYgFgoxvrDGfmZUQa0WBh9yLozi00bt/MEwb 2jvoGNav28hjGAYzcW57ENkWTehIbIWPBBeh2n8HI3pVueiUSQBnzwAZ8cQtw7xrSXNx +NVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l1H0ixTu; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-122184-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z3-20020aa79903000000b006ead3c04cd3si215452pff.62.2024.03.27.16.38.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 16:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122184-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=@linaro.org header.s=google header.b=l1H0ixTu; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-122184-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 B7E4129D4E4 for ; Wed, 27 Mar 2024 23:29:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA9CE1514CE; Wed, 27 Mar 2024 23:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l1H0ixTu" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 090D212A157 for ; Wed, 27 Mar 2024 23:29:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711582153; cv=none; b=sqDDTQovK7YAKVQ7lygDYlz9sS3xxXneRLB4JkRZ0JWbjYQ6ZLLMUTRCPY6tFteEVmqTP/If7T2Avc+kdXm7I+2vo3a0Zmp93694u9/1m/fGNHHZfHyLO2DV7wLQMcWenzFXw2MyLyv/KPHfN6mV6uKxUhREBsXb3tGK+TtVpAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711582153; c=relaxed/simple; bh=5wZZekYaSMWMCpHNW8cLBKcEHNhySwdHwzgcbhar/Uo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=o+TPey5HjcTYXShI3juUSbfM2PLWbvbbBTfKh4C0OltqYdBquCEqfyoPYpa87HtnoGLgpYamvhYsaUjRKIv1Ucbl+95bTHpTIOS8owvlJHwyPMSMSGFLvJkmIck7LedR/zodUJBdO+9g38/+YLdsL1BPzacHWtwnvAdgdlcw45w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=l1H0ixTu; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-41543b772e6so1947195e9.2 for ; Wed, 27 Mar 2024 16:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711582150; x=1712186950; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9PUNGNkymAHFEOcV0kzGalSNW81dr90U8zDmo0wkwhE=; b=l1H0ixTueK98h/uOlZ2Qexoza3l5kND52ZUwsglcnIeZdIeisd8C5fpGwoZvI55D8x THGPO0HSf16oi4I8Re0N0Vsc4l9FRJVVvLSyXmHxAi7X4M8ymJc4yqIICFkG0ZxBk1mX nB2xo+o1G7ks+iv92e4LD/oEjNWgSmYmqCoyT9pGEjs3YQFtDPXB39kdpiwo82jeubSV alFgFvnKbW/nN0Ad8QVKAVDoUjwCeqifD5xV/NMp4SSv46P79OxRDg61zACFfOfzqyxW mnpFsUFfF2R/2tN5L4mVcLyenkuBYeGNR2zKpCIvVZ+/yXFatBvqnJaquBA0CA6gJIgA fEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711582150; x=1712186950; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9PUNGNkymAHFEOcV0kzGalSNW81dr90U8zDmo0wkwhE=; b=QLi3hP0MG3JHJVoG/WE4YQ6lqNiqPJfKm/hbtUsShZPjWQQXDiglg3MJ9GhQye7mfQ 4/uDMYMemtHjQAOtyykKMR8FCdVAXW6aeDLWSZ16IDe2lKEwuL0OJ01zQis7wuHjykdk rrbjD2ot25iRceBl3FDP3YBEGIz+owOri9vxE4WO+sYvOiL94ygkffQWbcihs4kFOeLg kgPd38fpmq48PRhQT1uy/lAMgXwxLxVGWbLfkhzpA0tfGs+eQ7D/Ba2pRRJ7Kr3aDokx +124hYQdyhpI0psIoAG0TBDuh7bqGn4N+uUdPYXm4shYeJzwlanJemyxtMfPf6xxZS60 JR9Q== X-Forwarded-Encrypted: i=1; AJvYcCXbVSVRYtx74fhsh9/JN1czC0KPYHNQqvt1An4v9ndyUqJUhG2iY1E39BEQ+USPgy0XsfGxwC26oI+cwKFiscpfCqMm2IGiAI5G+K4M X-Gm-Message-State: AOJu0Yxpl/WhKpGmleWk2RzoNrb2TD9ozfnrU2zbxnFN5WgZint2MTrx 1kWHYArQcKp1uXuETr8ie03/YBsJWe00PgDohJ1V2bJw9Wt90agu435ZnapCUX4= X-Received: by 2002:a05:600c:1d02:b0:414:7eca:d9a5 with SMTP id l2-20020a05600c1d0200b004147ecad9a5mr1484707wms.12.1711582150221; Wed, 27 Mar 2024 16:29:10 -0700 (PDT) Received: from [192.168.1.78] (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n18-20020a05600c4f9200b004148c3685ffsm382557wmq.3.2024.03.27.16.29.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Mar 2024 16:29:09 -0700 (PDT) Message-ID: Date: Wed, 27 Mar 2024 23:29:09 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] soc: qcom: cmd-db: map shared memory as WT, not WB Content-Language: en-US To: Konrad Dybcio , Volodymyr Babchuk Cc: Bjorn Andersson , "linux-arm-msm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Douglas Anderson , Rob Clark References: <20240327200917.2576034-1-volodymyr_babchuk@epam.com> <87a5mjz8s3.fsf@epam.com> From: Caleb Connolly In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 27/03/2024 21:06, Konrad Dybcio wrote: > On 27.03.2024 10:04 PM, Volodymyr Babchuk wrote: >> >> Hi Konrad, >> >> Konrad Dybcio writes: >> >>> On 27.03.2024 9:09 PM, Volodymyr Babchuk wrote: >>>> It appears that hardware does not like cacheable accesses to this >>>> region. Trying to access this shared memory region as Normal Memory >>>> leads 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. This patch fixes the issue by mapping the shared memory as >>>> Write-Through. This removes dependency on correct mappings in Stage 2 >>>> tables. >>>> >>>> I tested this on SA8155P with Xen. >>>> >>>> Signed-off-by: Volodymyr Babchuk >>>> --- >>> >>> Interesting.. >>> >>> +Doug, Rob have you ever seen this on Chrome? (FYI, Volodymyr, chromebooks >>> ship with no qcom hypervisor) >> >> Well, maybe I was wrong when called this thing "hypervisor". All I know >> that it sits in hyp.mbn partition and all what it does is setup EL2 >> before switching to EL1 and running UEFI. >> >> In my experiments I replaced contents of hyp.mbn with U-Boot, which gave >> me access to EL2 and I was able to boot Xen and then Linux as Dom0. > > Yeah we're talking about the same thing. I was just curious whether > the Chrome folks have heard of it, or whether they have any changes/ > workarounds for it. Does Linux ever write to this region? Given that the Chromebooks don't seem to have issues with this (we have a bunch of them in pmOS and I'd be very very surprised if this was an issue there which nobody had tried upstreaming before) I'd guess the significant difference here is between booting Linux in EL2 (as Chromebooks do?) vs with Xen. Volodymyr: have you tried booting the kernel directly from U-Boot in EL2? Can you confirm if this issues also happens then? > > Konrad -- // Caleb (they/them)