From patchwork Mon Mar 5 16:04:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 130687 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2854240lja; Mon, 5 Mar 2018 08:07:29 -0800 (PST) X-Google-Smtp-Source: AG47ELsj1eLe4F66f/ptV2sigOPzJ5zLPRtrZKCqDWT+BlU1R3sQNiMSrEm2QGED/P92jqHD3/Co X-Received: by 10.36.211.145 with SMTP id n139mr13509500itg.29.1520266049582; Mon, 05 Mar 2018 08:07:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520266049; cv=none; d=google.com; s=arc-20160816; b=Awlle5y/IuAXYF//JHkqCDTC3fc5+Fs1UsZeckVCircAD4rwNw4YR7/CO+UUwrK0tX CsctY0a7AysnimvXIBMpc/zbwWmkedYL2ZhEFD1DsxhQMMTHIdU22/jgWd+vDHVpLdbw kH/Ga2I3pMACdi+z/cRNjAFMvE2tuvI65x20QJ+FgQreLM4HLXwmCPBIJLRUTXTYELr4 JU1K9YGprWA2MQf8tWxieawFdupVMclXzpRqBqbDgkIEChKGRvCKVeKD0bWpo1h3bcKk RNnUFShaYiL2s0yp8EvZBSWoqgaB+dPjMzXsQ4OZXLXRhz3ygt+1PW3gVQTwVGYjMKsz 4tgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=9x1FyZxIvL8J8lI1vcF97T9qkDVqOMxrYE33WthGfBA=; b=j4nPCG+/qPPKfh1HkCy57NhpV2bMADKhcXkGq7SMrzx5bpVhvcUbPqSZ1qrKxYjVaf IXzqg0MujhzmSS1GmD2MloP90BfcRM8FzPSPnda/gMj4tW11PjIQ94ewZxWBOQg8g3NV qOOEaHU0bLGFbc87lpselgUR5jpEl6Tyf3/Vc/iajNgwxwfDgiSNgEUHAIunrgBRO64/ U973CTDymXpOsZlcK5i2ZaEZr4smhRUhTpOpQIweINoXRS8l+yFxv9rLOqK95QmaUqqE DQCqdG0fqScKo9lXfoyKjsqki1IC+dT2ARouDGF2c/xAFQJLFhQp0xrJfIFEnDuQbcdA EDfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DjeEcJgf; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id d22si8865046ioc.143.2018.03.05.08.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:07:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DjeEcJgf; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1essc6-0000xg-3g; Mon, 05 Mar 2018 16:05:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1essc5-0000tO-DN for xen-devel@lists.xenproject.org; Mon, 05 Mar 2018 16:05:21 +0000 X-Inumbo-ID: d9818c8b-208e-11e8-ba59-bc764e045a96 Received: from mail-wm0-x243.google.com (unknown [2a00:1450:400c:c09::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d9818c8b-208e-11e8-ba59-bc764e045a96; Mon, 05 Mar 2018 17:04:14 +0100 (CET) Received: by mail-wm0-x243.google.com with SMTP id 188so16527035wme.1 for ; Mon, 05 Mar 2018 08:05:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nf1VV4UebM2zY7OV6YJo9gPX6fm4mX4AGxw6OP2Sofw=; b=DjeEcJgftEx1rnEt4N5ncKodwMxfat0xF2MmlyBKZp3xkqAgcVf50rVNqAWRhcEFoB /2n5m/gqsUPSAgkaNu/UZLE9EhQPbKRzOspsKEHNmtLywfylCHNcihaFrWeI1saruc+r qmbYKq56+G3u+dVf/sNGhlU+OVzKiMJwT6ojM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nf1VV4UebM2zY7OV6YJo9gPX6fm4mX4AGxw6OP2Sofw=; b=L/Cmt7qjp20wYhopeFUhAEpJuSA99leh0CPE+U85U0HAp8nNKipgxEZhVy1dla6gh/ WFsw7p6hU1VSIxIYQSzvqVeaX/Nx5IA9KqrWjF8tmVrtMwHjmx9DOjtv+MyqLACP/0dO 0XA+MZFdwVCOekkZkMVveignOfQ7b1U7bJlqJgDxeJd7xXamXDgGIrXUlAdJ8cVe6zd7 DDbEOuMhQjwJdBJzTgghl8D2EUgQCdfaqHKzXnaL6JnGvf4hY3QXUltCl0MTRVcBki8l Cl/5GtL/js9jJP4TSq97FVsajpZvRas8Lr0yISvnuFxFOZ3WV72a2g5vXFtiQR+d+svj dURw== X-Gm-Message-State: AElRT7GkPPGj01B2UpWl+8cdHQCWp45NwM3z+4+RYPMpEF4MUHF/74HA ltvudke+OAAirjJyMIHB96MLQg== X-Received: by 10.28.8.9 with SMTP id 9mr8112327wmi.54.1520265919410; Mon, 05 Mar 2018 08:05:19 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id y6sm6574381wmy.14.2018.03.05.08.05.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 08:05:18 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Mon, 5 Mar 2018 16:04:14 +0000 Message-Id: <20180305160415.16760-57-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180305160415.16760-1-andre.przywara@linaro.org> References: <20180305160415.16760-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 56/57] ARM: allocate two pages for struct vcpu X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment we allocate exactly one page for struct vcpu on ARM, also have a check in place to prevent it growing beyond 4KB. As the struct includes the state of all 32 private (per-VCPU) interrupts, we are at 3840 bytes on arm64 at the moment already. Growing the per-IRQ VGIC structure even slightly makes the VCPU quickly exceed the 4K limit. The new VGIC will need more space per virtual IRQ. I spent a few hours trying to trim this down, but couldn't get it below 4KB, even with the nasty hacks piling up to save some bytes here and there. It turns out that beyond efficiency, maybe, there is no real technical reason this struct has to fit in one page, so lifting the limit to two pages seems like the most pragmatic solution. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - no changes xen/arch/arm/domain.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 11a46aa27f..0bec6aad17 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -502,10 +502,13 @@ void dump_pageframe_info(struct domain *d) struct vcpu *alloc_vcpu_struct(void) { struct vcpu *v; - BUILD_BUG_ON(sizeof(*v) > PAGE_SIZE); - v = alloc_xenheap_pages(0, 0); - if ( v != NULL ) + + BUILD_BUG_ON(sizeof(*v) > 2 * PAGE_SIZE); + v = alloc_xenheap_pages(1, 0); + if ( v != NULL ) { clear_page(v); + clear_page((void *)v + PAGE_SIZE); + } return v; }