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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF5ADC2BD09 for ; Mon, 1 Jul 2024 08:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AMt7mTb63MOoRef5KMAR+OLG9LjGQCs3Iv9eQzbOgVY=; b=O6X5CHKYz8+VbzJaeHxINU3/Z+ 905uU0QJJT2trwBPHKV9uRFLypOxp7AI0bNCLJ8rLQdmcxEJX+DmByGn9iqGLYUfJdH2HbS+rXSTc h/QUE03l/mE/Ao7z9QGtf1s5FST3/3vgnumDtc4NJw5rckxoFvU7KfOtK21+Piif0CMMUlUboYtb4 g58088xw2eh++yIIaSZC5GmHm8SllFjNOpmbpmCHF7rmHO1l7lxQjhm5BFtD8xwaZXFSq+c2KNJBe //xYrF+6AcTNUs54kbK4s8pppjHn6+e/oW/KlGAva5k9Jdnv/tbtygvYQhpHy2tIUQcwxiDVDctds CpeISBfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOCbC-00000002Gdm-15Jr; Mon, 01 Jul 2024 08:41:22 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOCb0-00000002GYV-0peT for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2024 08:41:11 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42562fde108so20178615e9.0 for ; Mon, 01 Jul 2024 01:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719823268; x=1720428068; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AMt7mTb63MOoRef5KMAR+OLG9LjGQCs3Iv9eQzbOgVY=; b=QkcK5xZQAnRnkml6ODHIokd1vKr496K4BsSGZpkxDicqEi1s82cJHsqGKAeeMfRZh2 NvbjUOPSl/bZKOEh8lQdqyKJmkfKMiR+bFqQYRvdb8rYTErMitaYSnRkdC5PW7sbHmU8 E/Y24D6XYsYOEG1+Y6bk3Y1rNwdGKvlDQZOVC4OMzM/U11WGMqgu4EZ5KBPemWShA3Nk dzSs13mUYGBQHEPnMbYWQrLJMPN92ulXMFORkttnX04HjmH03BYrxVKYOLxC4GsdlJBN L2gMYSEWir7xuy9TUnq+HOOmPHLYPpEvvfSaw04lRxzEql5ld/VJdFd5PedrVbOM3FIN 7utA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719823268; x=1720428068; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AMt7mTb63MOoRef5KMAR+OLG9LjGQCs3Iv9eQzbOgVY=; b=AuPLnJvd3IUZeWDBX3ifFVoC/FiYTbbtRySFc/8w3mOFoAxMK9hRyZ5gv8E7TgeZOi 3sRAaxQt8FnukMmmhlp1SQjTi3pjrN3a7OPWkWuHcYPKJ1sqkoWBg7UxsipgY693vKZc wlvAn+t31cYzq7DSeYfjuV/PQAusLZYNEuPCsKAepIcb+gXyFUFF6GuuruuZYDUeC7IM aAH6t0MBeIvdNtNAGWLoRY1ngx3zMpLTZS9WYqK0iXrzPpGGqXkYMt3pswJKFDcexZse TvTRXAlmzZNZ43ZBgQzN23+B8RyzivNvcx9ULYo6ViFfyAeLencBDOg9XbYJykkEzvuw 9C4g== X-Forwarded-Encrypted: i=1; AJvYcCXWeEw/D5z1P4qWX3+q8Ao+6GFrq5KlmXB+HF52xxzsMfutE/I491G32aQjpovOGbZHxpv6dHKl9cr+RxwicQ6mGa9W9wsrxMrmxYhcXfvPpRgPum8= X-Gm-Message-State: AOJu0YxnzLPC1w/EeJS3KsTDApT4AH3a3sC7tSLpG7a/E4RdcfrROJ5m hEsPt4bjo9mX7VDCt8s6/NkqPYe2cXwVE1PI9Szi2CQ82INAGOTr X-Google-Smtp-Source: AGHT+IFVkP4vxt28218+k2V48TYQocy8Fz5i69HcPxCmln5LU4tWH1iaovbS/2p5BgnSrenoOSY/NQ== X-Received: by 2002:a05:600c:6a8d:b0:425:77b4:366d with SMTP id 5b1f17b1804b1-4257a02f3f6mr32722375e9.11.1719823267873; Mon, 01 Jul 2024 01:41:07 -0700 (PDT) Received: from [10.254.108.81] (munvpn.amd.com. [165.204.72.6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256b09a94csm141988335e9.33.2024.07.01.01.41.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Jul 2024 01:41:07 -0700 (PDT) Message-ID: Date: Mon, 1 Jul 2024 10:41:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Linaro-mm-sig] Re: [PATCH v5 2/9] scatterlist: Add a flag for the restricted memory To: Nicolas Dufresne , =?UTF-8?Q?Christian_K=C3=B6nig?= , =?UTF-8?B?SmFzb24tSkggTGluICjmnpfnnb/npaUp?= , "daniel@ffwll.ch" Cc: "quic_vjitta@quicinc.com" , "angelogioacchino.delregno@collabora.com" , "sumit.semwal@linaro.org" , "conor+dt@kernel.org" , "jkardatzke@google.com" , "krzysztof.kozlowski+dt@linaro.org" , "joakim.bech@linaro.org" , =?UTF-8?B?WW91bGluIFBlaSAo6KO05Y+L5p6XKQ==?= , "logang@deltatee.com" , "dri-devel@lists.freedesktop.org" , =?UTF-8?B?S3VvaG9uZyBXYW5nICjnjovlnIvptLsp?= , =?UTF-8?B?SmlhbmppYW8gWmVuZyAo5pu+5YGl5aejKQ==?= , "contact@emersion.fr" , "benjamin.gaignard@collabora.com" , "matthias.bgg@gmail.com" , "linaro-mm-sig@lists.linaro.org" , "willy@infradead.org" , "pavel@ucw.cz" , "akpm@linux-foundation.org" , "Brian.Starkey@arm.com" , "robh+dt@kernel.org" , "linux-media@vger.kernel.org" , "devicetree@vger.kernel.org" , "tjmercier@google.com" , "jstultz@google.com" , "linux-arm-kernel@lists.infradead.org" , "mripard@kernel.org" , "robin.murphy@arm.com" , =?UTF-8?B?WW9uZyBXdSAo5ZC05YuHKQ==?= , "linux-kernel@vger.kernel.org" , "ppaalanen@gmail.com" References: <20240515112308.10171-1-yong.wu@mediatek.com> <20240515112308.10171-3-yong.wu@mediatek.com> <98721904-003d-4d0d-8cfe-1cecdd59ce01@amd.com> <779ce30a657754ff945ebd32b66e1c644635e84d.camel@mediatek.com> <1050c44512374031d1349b5dced228d0efc3fbde.camel@mediatek.com> <3104b765-5666-44e4-8788-f1b1b296fe17@amd.com> <98c11bad7f40bcc79ed7a2039ddb3a46f99908f5.camel@mediatek.com> <75dc1136-7751-4772-9fa7-dd9124684cd2@amd.com> <5739abdb-0234-412a-9f25-49219411bbc6@amd.com> <183f2ae09c2dbcf687e69cd13a9d258fd24fd80c.camel@ndufresne.ca> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <183f2ae09c2dbcf687e69cd13a9d258fd24fd80c.camel@ndufresne.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240701_014110_274521_7163884B X-CRM114-Status: GOOD ( 16.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am 28.06.24 um 22:16 schrieb Nicolas Dufresne: > [SNIP] >>>>> Why can't you get this information from userspace? >>>> Same reason amd and i915/xe also pass this around internally in the >>>> kernel, it's just that for those gpus the render and kms node are the >>>> same >>>> driver so this is easy. >>>> >> The reason I ask is that encryption here looks just like another >> parameter for the buffer, e.g. like format, stride, tilling etc.. > I'm mostly a reader of the thread here, but I'd like to avoid basic mistakes. > The buffer in question are "protected", meaning that the CPU HW does not have > access to the underlying pages (or zone in the case of Meditatek). > > This is different from encrypted buffers, which don't need this level of > protection, as without the security key to decrypt them, their content is close > to random data. Thanks for that clarification, this difference was absolutely not obvious. In that case having a separate heap for this memory is indeed the easiest approach. My question is still what would happen if the CPU tries to access this protected buffer? Or does the CPU not even have an address to do that? Just out of curiosity, I mean the exporting heap should then somehow reject any attempt to mmap() or vmap() the buffer content. Thanks, Christian.