Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1170024lqt; Fri, 7 Jun 2024 09:51:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+boXiFY+QNxYFDwsjZp1GF5u776CAu+Rovcs06DTODBw1teEUciIrfRB/fZG9FjZQBM6ASKa0ISmSQleW/yXAzm2v5CxqXrlOlWA2Dg== X-Google-Smtp-Source: AGHT+IEKa0RhMbPvcnU9oUwn6wFtzy1pgTZju9+K/S9XxKuIt1T5j5PlGKjQNWIlhSCuiENm4b8l X-Received: by 2002:a05:6a00:1786:b0:6f8:b83f:d433 with SMTP id d2e1a72fcca58-7040c649d4amr4290137b3a.8.1717779060834; Fri, 07 Jun 2024 09:51:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717779060; cv=pass; d=google.com; s=arc-20160816; b=NIQqniqTFXX6TZYMZ9q6sPWqwiWVWqWR2bZVnOXaJf35LA7XLdF4OCIH5waHJxcb7+ K4Rlc6lgnE4jQGOplpaLHg9guzmonopYaCbZJQAHfgry2lILo8Nt9+XcWlUnTFXYHR1M KUNgKLLVTx2Gp0XlbrxdG9YeeHqTzc5rbkOnVRbktF7xEkWiS/IBAiCrbmVP28zyR3lj L9hxvH536la39sTymV08zUJVSKPTVAu5kS9lsBrcLIwL5qxEfmXYuy+ygh8FQOr8FHuY FDrE5BQ00MT4h5wyvlOQxROsURx/62+6PLJFk+3BYpK0792w7RinXlvxiSIQJ6VA5vLZ jDvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=bGyoMIPIjjY4VMHmW9dpxw4dYEQPnUvULHX9xJ/tkmo=; fh=ln8246CGMgWIPbzyPrsb42K5d/qfZpdsLSUdMhVAJvo=; b=xI3D38iGUNcN4XiM136PUgBKFuVGy79vGERMmD+ibYGpeQaUA8u8qLfQ9obEawsr2B 1BXoGETj8pjPsGfMgBg6WCvelaz3dT4OtzxhcfHQWMRcL5qopaDxml6RWOIjBR+a/Z7a S5U0LrF/8cjEwmI6YxNQ1lpHHvladcebAEvzVv1jVbBGGM9wNZKU5R49mUqlngm8zPsn 3HHTgKyy9874r7d1VZZ2TLgNHN06USw3WhZeOpR9V+aqHb4bE29jU/tRQ9l6oR3Dnqkv W0MKbW455Tzircxq/WM9iM85cK4miTcqRGnbL4kNu65pgRWhI2/fn887X0r8TIcAPR8C W0qg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-206504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd56f1ecsi2994855b3a.351.2024.06.07.09.50.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 09:51:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206504-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-206504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 290D6B24006 for ; Fri, 7 Jun 2024 16:46:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1655919AD45; Fri, 7 Jun 2024 16:46:49 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 846A81974F7; Fri, 7 Jun 2024 16:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717778808; cv=none; b=PqJVueYseoPOlrKLZ9C3DGOVXKSbk95nR8zm3aiP4FQSzffIAtRrrS8qbB53/Ukuuty54Rf5aDm38HmrNxU3k3iDZofP8ciWXWxsiEmk/laIultEm6aF+sASPkepWUwQBvWs4BD2c8N9WGUu8jvLWKu3UxZtAlsQlPGIWTUCSVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717778808; c=relaxed/simple; bh=/dDdFNzBjblJbkHspj7AhEQS924zK1q7V7UuQ5JIdrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jUsqq0/MPcTputxMKaENcnnpHstUe9qfE7B1JTLTw1AtoKQ7aAVIEYeU8tuMfH+OP/AUXwMvbDv/UikYOFaoMVAlxNEVBvaU+yWBq+jUNz3kSVLyedQiecsqY1quTT0zefSrkvaw+sJvQL9MeVwPEukWXbgiNXcM99J+IbMh8Ko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 216AEC2BBFC; Fri, 7 Jun 2024 16:46:44 +0000 (UTC) Date: Fri, 7 Jun 2024 17:46:42 +0100 From: Catalin Marinas To: Steven Price Cc: Marc Zyngier , kvm@vger.kernel.org, kvmarm@lists.linux.dev, Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni Subject: Re: [PATCH v3 12/14] arm64: realm: Support nonsecure ITS emulation shared Message-ID: References: <20240605093006.145492-1-steven.price@arm.com> <20240605093006.145492-13-steven.price@arm.com> <86a5jzld9g.wl-maz@kernel.org> <4c363476-e5b5-42ff-9f30-a02a92b6751b@arm.com> <867cf2l6in.wl-maz@kernel.org> <0ea597d3-6520-4ab3-8050-d967c173bc23@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ea597d3-6520-4ab3-8050-d967c173bc23@arm.com> On Fri, Jun 07, 2024 at 04:45:14PM +0100, Steven Price wrote: > On 06/06/2024 19:38, Catalin Marinas wrote: > > Anyway, we could do some hacking around gen_pool as a temporary solution > > (maybe as a set of patches on top of this series to be easier to revert) > > and start investigating a proper decrypted page allocator in parallel. > > We just need to find a victim that has the page allocator fresh in mind > > (Ryan or Alexandru ;)). > > Thanks for the suggestions Catalin. I had a go at implementing something > with gen_pool - the below (very lightly tested) hack seems to work. This > is on top of the current series. > > I *think* it should also be safe to drop the whole alignment part with > this custom allocator, which could actually save memory. But I haven't > quite got my head around that yet. Thanks Steven. It doesn't look too complex and it solves the memory wasting. We don't actually free the pages from gen_pool but I don't think it matters much, the memory would get reused if devices are removed and re-added. -- Catalin