From patchwork Fri Feb 9 14:39:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 127833 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp679744ljc; Fri, 9 Feb 2018 06:42:07 -0800 (PST) X-Google-Smtp-Source: AH8x224OxkqBU9k0x0t4b3szuOWAu2GAycLhNJVPUGUbg0vBUjqj2yZhhvGNMs5zdCYnR34SbIGr X-Received: by 10.36.13.5 with SMTP id 5mr3715821itx.68.1518187327112; Fri, 09 Feb 2018 06:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518187327; cv=none; d=google.com; s=arc-20160816; b=W1CEY0gM1+97lAXkmxXcMwpc+4df3bJJKThstVk0RqHLwRIDr1ZpqatLLSxOmH4l1i +eWoKxBATUEHwRp6I/mWhbMrcIjjgIcRY5ZpYH4UpvILsoUDtTkcL1W+M6/pOP7CCod1 irmpdlc52NE1A/iTAuiIysL0cKRe6z0iRRYIEaP5Eo8eI0cdLVleQ+2v3gxFdBWSlhq9 RssbdudDJ75GBl9NO+QUIaY3BMRVG2wibHIHed3WwrKE5b8c0yiZcWz7y5Rk4xCXmydQ 9oT+ufO/2hTNuNQHy43v1WkAcE+HXD+RUdKjTXd7UdzqYldjtoH4hqlm5sJtE1Wj/xRv VWaA== 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:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=pJAuWXq1KUZ+5VMQUb7aEmSdFwIPcQBKGZ1i0lSw9k8=; b=NMBq6r+tGQ1RhlDvtGpshNyncjNKqGgXBv2LIdThTAtOdTEuzFiUotxfuB0mBFqH6N gFBrpFvsPICpVGeVL1uNbiVGqNr8YxDLUzhRZE7zI3WVfrm7xihmehHqhHykQrpVu1og X2BYRsZQq7txuKfaAso3mXemmqLJH78Sf3621khPNcmh1FdhOfoG6SKxvilKJWyqNNa+ IYXwtH9l8JX4aDODm2ATmSUSQI5NU2mxLAoRs3L71idljNHxFcKH4n6A464Kr28ut78z p9JEWvnX7xZn4X/stfNDfs2fNExZbiCCLE0z302ZOcl+5pZ4Shv6rSwrFp7HU8piSV1+ Od3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kTYgMy2l; 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 n132si1573794ita.144.2018.02.09.06.42.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:42:07 -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=kTYgMy2l; 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 1ek9qy-0002HT-1W; Fri, 09 Feb 2018 14:40:40 +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 1ek9qw-0002CD-T3 for xen-devel@lists.xenproject.org; Fri, 09 Feb 2018 14:40:38 +0000 X-Inumbo-ID: 202a90e2-0da7-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 202a90e2-0da7-11e8-ba59-bc764e045a96; Fri, 09 Feb 2018 15:40:09 +0100 (CET) Received: by mail-wm0-x243.google.com with SMTP id i186so15775429wmi.4 for ; Fri, 09 Feb 2018 06:40:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=z4LDY4kAvA/vDkYwhx9bzRdr7FC3jGkP1sL3mslrZvQ=; b=kTYgMy2lw6EGvAikBucl72LAdJ5Jn9uxvQLAL2A5xl/mbggskSDK3CmRUK0a0wlaqD SGJgJMz33e94CgwP282nYi0q37buXm010ON4HFu7hb7RI/KHstDNR5hXX4loIMVB3jCR t6qQ+fALXV7c/BhuNpVUjVxN7mJhsS0sbUQTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=z4LDY4kAvA/vDkYwhx9bzRdr7FC3jGkP1sL3mslrZvQ=; b=S/2xtehYVRh4oclZuYnsSZphDv/V20PDC8OzNNpL3S+ejvBH8YduBgkhPirqFoBIMb kDmp89KgwGGF2sEA5MceCctFNwxsb0cAAsip9s1LxOg4hxx8dvYB+gR3wsbbWnPdyO2F L8UrOX9AnYpaG10GLT+gGchUY5MkUFVsXASxHhXUhtjL0n73ahQwvmAUmp65WFzm9PBh XaJkn69K/7QrT6wlu0ORozvri2a5TJY4v0b37g+vqxZkgCNtgwkMqZcvihCqEo6lnj+8 I1bvOB2ILug4d1nyF5fsTeV5+IeHtvpRpxQhFN+Thlq7WO+2BscW8PVLm7nArP1IJVPk luCg== X-Gm-Message-State: APf1xPAIczWlmaFXnDpWVW98GYaJrciOvYw0N/MDEW8jtWxJuwxRwAPy MbcZ8DngChwaMO2aMsyZQJz/Sg== X-Received: by 10.28.159.7 with SMTP id i7mr2396237wme.57.1518187236296; Fri, 09 Feb 2018 06:40:36 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id b35sm2552229wra.13.2018.02.09.06.40.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Feb 2018 06:40:35 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall , xen-devel@lists.xenproject.org Date: Fri, 9 Feb 2018 14:39:36 +0000 Message-Id: <20180209143937.28866-49-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180209143937.28866-1-andre.przywara@linaro.org> References: <20180209143937.28866-1-andre.przywara@linaro.org> Subject: [Xen-devel] [RFC PATCH 48/49] 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 --- 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 87bd493924..4dd34393f1 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; }