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 71BE8C25B75 for ; Thu, 23 May 2024 09:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=F1Hq3Uhh5c8nu+1t+0iVgK4RGRuBJV+JTKa+WoUuU1g=; b=uaM04CNH67HUo6 3miQkhKZuwwCdt5ryOBUqYlZhM8a2u+7pXEP0xKSfLh8kQ57tX/s1ezbokjq1NpxFv31og2rcK2O/ /sF1LcUGDlBYL1aGBvsb2Mxjd7ppT2pOF6mF8gyFI5tNiMRbYykenapVEYpytSM+m+a0rVaGZUMzm ow+IjbO9ya8VHI6aRd9LfKlBr/mumhQ90WknPF4WT4kDqVkNcqDdV9LEMXQgeuvMieRRer6nmPP/n PSYqhsHrmdmP9IGu6hfrt16wwbJvJM/edB7I23yJJVX5GOM5+UWn/Ngvc2BchcYGFmicl0kCVsH7r AXbF4iLdkP0Pl0WOP6EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sA5Cq-00000005mMy-2b9r; Thu, 23 May 2024 09:57:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sA5Cn-00000005mM2-0bxE for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2024 09:57:50 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A3C82F4; Thu, 23 May 2024 02:58:06 -0700 (PDT) Received: from [10.1.30.34] (e122027.cambridge.arm.com [10.1.30.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF8003F766; Thu, 23 May 2024 02:57:39 -0700 (PDT) Message-ID: Date: Thu, 23 May 2024 10:57:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 12/14] arm64: realm: Support nonsecure ITS emulation shared To: Catalin Marinas Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Marc Zyngier , 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 References: <20240412084213.1733764-1-steven.price@arm.com> <20240412084213.1733764-13-steven.price@arm.com> <74011ac1-34e0-4ee3-a00d-f78ad334fce2@arm.com> From: Steven Price Content-Language: en-GB In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240523_025749_288971_461DCF39 X-CRM114-Status: GOOD ( 10.75 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 22/05/2024 18:05, Catalin Marinas wrote: > On Wed, May 22, 2024 at 04:52:45PM +0100, Steven Price wrote: >> On 15/05/2024 12:01, Catalin Marinas wrote: >>> On Fri, Apr 12, 2024 at 09:42:11AM +0100, Steven Price wrote: >>>> @@ -3432,7 +3468,16 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, >>>> nr_ites = max(2, nvecs); >>>> sz = nr_ites * (FIELD_GET(GITS_TYPER_ITT_ENTRY_SIZE, its->typer) + 1); >>>> sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1; >>>> - itt = kzalloc_node(sz, GFP_KERNEL, its->numa_node); >>>> + itt_order = get_order(sz); >>>> + page = its_alloc_shared_pages_node(its->numa_node, >>>> + GFP_KERNEL | __GFP_ZERO, >>>> + itt_order); >>> >>> How much do we waste by going for a full page always if this is going to >>> be used on the host? >> >> sz is a minimum of ITS_ITT_ALIGN*2-1 - which is 511 bytes. So >> potentially PAGE_SIZE-512 bytes could be wasted here (minus kmalloc >> overhead). > > That I figured out as well but how many times is this path called with a > size smaller than a page? > That presumably depends on the number of devices in the guest. For my test guest setup (using kvmtool) this is called 3 times each with sz=511. Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel