Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2846060lqp; Mon, 25 Mar 2024 10:50:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUub31e4iZXHjsxt6eQy0EKLZSPnGmE35LQo2a1PG6M/suXZ15Rhxy+NoN4+/kRJ3jF2M7s5uI0cozPfuJp9wCEt0daJyDEhqIQck0iEw== X-Google-Smtp-Source: AGHT+IG6VhoSTpWB0gfoG0vz68xh5rr0ZJ8uXlbWquj5nn7qvkfu/tQXd0GiUd0ZjzHx9Uh2oQax X-Received: by 2002:a17:90a:db08:b0:29b:347f:23ea with SMTP id g8-20020a17090adb0800b0029b347f23eamr5169443pjv.3.1711389052386; Mon, 25 Mar 2024 10:50:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711389052; cv=pass; d=google.com; s=arc-20160816; b=W5sLZFcxEYgeYGCLA6aMZ4zr3/RcbaVgM7IX1+TIRDLWJ6XqvgrdAteH9BOlWnisdP QTsPMTf+pnHwNWOieRFOygZ7GuScZ9Qux7IKif44LfzUXYNI+DfOwW+qAFbV5cqLi0cR 7zPMR0noKbB9BUrfzhpAybsxsEDiYhV4MFnmZqktkQ9Z0DgiRnV7nHl9jQtsTd1I9zPn rv/pePtmiGtSzSs+1njif7fSRmWW5CKrge8JHU1yBsXuxz0VqaXk9YATs+PBdKm0zFDF mAcg64hiqmdt2L11RDcKxqeCkPoC7jW4FcNQE/QlIyrXpRBUCj3Cz9s61eNJnAax5gPK Y5QA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vea42ognBMGcSaAHWG2mdmwkMm3Lc8ado5KZvfpR8+M=; fh=vqFkQQwUBVobPCEVK0QCfPPe7iA9oS0OrLTUD9lhIN8=; b=YfR7JeHPyG1JA5a3zPbfg/P+duIvMKFAIaEXthDoYRWCkVj/W9hKUgGBjcVMXjNdgX QX/ApE/EwLJDOeQGgYxJKfCiYLLpcjIYzqC31t3xeFm5BdAKudNKLhRvWqpTMY8FiIRI dRkV+5eWfKM1rCpADYkpKXZsNBsqA78FqD7s5W7FQv2uHlfVWshGbmfZiVGAU0P8UIpt V7XFwh0hDghKzFqkQk1XuIJ38BcTS+fBRtkAbeKIbqL4iaW3R+PIeuxlHemFAbZt+Cq+ vX1zpHv+OEK7Upjat6TxTMH2dbCjM6QZCLhu88Tn1J6XpBX883hOIssiddkQzipplCv8 8YHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=awcdaXQe; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-116792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116792-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n34-20020a17090a5aa500b0029bb3b8942esi7905986pji.109.2024.03.25.10.50.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 10:50:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=awcdaXQe; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-116792-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116792-linux.lists.archive=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 18321B245A1 for ; Mon, 25 Mar 2024 14:16:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBD3F1836E5; Mon, 25 Mar 2024 10:47:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="awcdaXQe" Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 7105B1966AF for ; Mon, 25 Mar 2024 10:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711361064; cv=none; b=V+myZ87eYTeUrS9izAkkfb5CqOqUuV8g3xSz4x4+Q4MBukg3ayQju1uetxCWWb5vHKtTiDgVUrbFFrPjNfg0RFz0j6OpSoGwZDl3QodzCXYDK7/nAA/TPyyPIDpvwQoQJTnkA8oc26Mbtl1sr4rytiCTetlLi3Y/oLFb0Xs6SSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711361064; c=relaxed/simple; bh=QWs5yD7pCzhRl7RqY1eyIygDCxtu2ITbSn6PwROjTD0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LGnIcDpPsYHbV8Xkf/aMZr93tV87xKJVe3b5P4Ov0aIK9PZe3GgC7dJc6OZyGR4u7eBoJOklO2I9L06QJMm6XLo3iuUxEVmJHkmDD0LEO6QYGc9mvmK+yCaMBHJ9AggP2YFW9O1nLpuI3QZtzGCYJBrTTFIyJF2btixcf/HChCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=awcdaXQe; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-341cce3e5f0so795839f8f.1 for ; Mon, 25 Mar 2024 03:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1711361060; x=1711965860; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vea42ognBMGcSaAHWG2mdmwkMm3Lc8ado5KZvfpR8+M=; b=awcdaXQeFvSmG/GFRsh+dLMO8JexYG9uCvB8cJpIzJY4QwcgmmM85vch2eRfg5o01P Q+XsP04eLMnXDSnINFouUB83z4vQGc4zifpUlSdwHxA5LmHaLypyizYGOym6sNSLb75B l9bOy1U2HDwoNZZmMm1iesR98B140CM9vQchMBx2YGgBNwKoa44Ib6K5U6SL27buHLn1 ZCKD57Gd/0wW8bJDdrAOHIkpWtupWAvHcfxy0MyHsSD8Iq5K+v8i7y7zedGUWt3G4yx0 LxjfhqkmiaEFGTMq38Ykqh8CXQ7OlXwDxch1o2xjyLXXY+zmi3K5kOfrAI6azEcZUHz2 pBWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711361060; x=1711965860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vea42ognBMGcSaAHWG2mdmwkMm3Lc8ado5KZvfpR8+M=; b=BA2ehamcqjH1YDwkVTMRRS0cF8y9bW8WQI+NA9CEvX6k8rMQ1NjSzSVvS399Ie2bYw gEHEewMuVkA5iJu4O5KnCDrgO9p+2OqcRFupk3ZejQ0aY50HPQ9EsA3yi6f0TWse9XrU AD9pHfl+j+wtQxa4lfjZuHLqhfJ3X4gpMbl8glt3/0ZsYijT8TAOTaVAdw7177cn63i2 JFur0ONQrvLTGB7DWhaYXsePtr/3UoQtuLRi5St7m78xn+zDsSGLrNF/C6mIj7sumq6e 9iAHoC5FXRLRiBmVRMOuU4w6nKGk2YgLbfPMgOVh4Xglv28KZ60SLfjWIzfsIGa1qEXr stOw== X-Forwarded-Encrypted: i=1; AJvYcCWu52PEhehbY7saXG8biWaaS47B6e10dpQ8WYs9He7yjtk6YDDWmH26nbEqvAwgn0yNVU1uZ0zVQM4/MmlCuM+SUTOzEc9Q3tTDGuno X-Gm-Message-State: AOJu0Yy8gSSaTV0RnWuG/jkLyttiLcbjSuXpN3posUJytfwxumjssh1W M/ejnREl+9UgzWMmW71qn8Y+TPlczjuDzQvvgnrYwdBGw6izKU5TVHeWznU0CU2l91AnvMcKy9Y k X-Received: by 2002:adf:f483:0:b0:33d:c2cb:c18d with SMTP id l3-20020adff483000000b0033dc2cbc18dmr5631688wro.32.1711361059941; Mon, 25 Mar 2024 03:04:19 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:75a:e000:861d:8b72:a859:4ce9]) by smtp.gmail.com with ESMTPSA id dv13-20020a0560000d8d00b0033e25c39ac3sm9086874wrb.80.2024.03.25.03.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:04:19 -0700 (PDT) From: Bartosz Golaszewski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Elliot Berman , Krzysztof Kozlowski , Guru Das Srinagesh , Andrew Halaney , Maximilian Luz , Alex Elder , Srini Kandagatla , Arnd Bergmann Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@quicinc.com, Bartosz Golaszewski , Deepti Jaggi Subject: [PATCH v9 12/13] firmware: qcom: scm: clarify the comment in qcom_scm_pas_init_image() Date: Mon, 25 Mar 2024 11:03:58 +0100 Message-Id: <20240325100359.17001-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240325100359.17001-1-brgl@bgdev.pl> References: <20240325100359.17001-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bartosz Golaszewski The "memory protection" mechanism mentioned in the comment is the SHM Bridge. This is also the reason why we do not convert this call to using the TZ memory allocator. Signed-off-by: Bartosz Golaszewski Tested-by: Andrew Halaney # sc8280xp-lenovo-thinkpad-x13s Tested-by: Deepti Jaggi #sa8775p-ride Reviewed-by: Elliot Berman --- drivers/firmware/qcom/qcom_scm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c index 7a8d67c7b71c..1972757f8931 100644 --- a/drivers/firmware/qcom/qcom_scm.c +++ b/drivers/firmware/qcom/qcom_scm.c @@ -563,6 +563,13 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size, * During the scm call memory protection will be enabled for the meta * data blob, so make sure it's physically contiguous, 4K aligned and * non-cachable to avoid XPU violations. + * + * For PIL calls the hypervisor creates SHM Bridges for the blob + * buffers on behalf of Linus so we must not do it ourselves hence + * not using the TZMem allocator here. + * + * If we pass a buffer that is already part of an SHM Bridge to this + * call, it will fail. */ mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys, GFP_KERNEL); -- 2.40.1