From patchwork Mon Mar 5 16:03:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 130700 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2855775lja; Mon, 5 Mar 2018 08:08:48 -0800 (PST) X-Google-Smtp-Source: AG47ELtu84yrDRXFEVoNExhCxD+2VO//wrkTWcWyg/xew/MrJ4zGe4POmXTnxngJhrS4cM3mfZ34 X-Received: by 10.36.233.68 with SMTP id f65mr14154795ith.149.1520266026297; Mon, 05 Mar 2018 08:07:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520266026; cv=none; d=google.com; s=arc-20160816; b=DX2Et7lOqWdEwm/0CmZgSxjI9tQi0xJsQUfJpqcRNVeeEYCyDWZ24brug/VogHYExR eu+CE0+SCdTDau7SOk4dottF1SAxX4XQVPj9JhYSTQHrhEL0/OHUmYYZ8jq/zLD7bRiH dnhYkryo+T/Jomgs4A17yA0OEHy9AJ4WvbHNjFhIlULdWwsxAYTJcuvUOyikDSDX2Kq0 uhyAGDBOFVtvTiKERsiN5DCx8g3yfLrk+7n5TTDjn+CFw8EfC4c0fBuf7dM13p9HAIzu tYZlyhKMuSIGoALHryHnNniB56HFkFVwEp9Q6YfwyWmxxhI6KC4yLUhnGTaLi0yO9NKZ 2QpA== 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=Xqi7Mb0rNqo41GYfFS7Z6xY5W4MV07O/DXA3JL5Kues=; b=tt/2icPACJKBX1Bnj/QpFPwG5ffTsz0sf61K0+jniDRSOeehxAR597v3MtFmgzzjru YI79zRbXRe6aCRWGKgqx2aZyF9BcjNfeJMbYnsX7qfXRs99giF19aTV+dU/eBvRWOPbF E1CRD0/nb8e9XugFs25dKWx1jAFzATZk73aTfveanKgxot2nlCntYjzFjfTDXLCFlXqi EEWtcfJTQEVhmcP12lMKMJ9SFgbiSESl61qAWZyBoC28AgvUqfwN5oto6DvFU3i33M0p 1LhdLWAjWdC4aYoFAp2g3Z+q7x4INl4IYr4tNzCWV6NNb0d6CVASZlzcwnkH1ZNy29e2 kXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=c7o8HEdU; 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 s190si9551085ios.196.2018.03.05.08.07.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:07:06 -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=c7o8HEdU; 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 1essbL-0007EC-N9; Mon, 05 Mar 2018 16:04:35 +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 1essbK-0007CM-DA for xen-devel@lists.xenproject.org; Mon, 05 Mar 2018 16:04:34 +0000 X-Inumbo-ID: bd07b12b-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 bd07b12b-208e-11e8-ba59-bc764e045a96; Mon, 05 Mar 2018 17:03:27 +0100 (CET) Received: by mail-wm0-x243.google.com with SMTP id t6so16608875wmt.5 for ; Mon, 05 Mar 2018 08:04:32 -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=9xys2HuwOvSeK4RxFk6kURredfqMGn0jnUUwK5hXkjI=; b=c7o8HEdUEwXyyJGvteXR1HUTqs9UH3vFwG4Sr+5zB/XSZol9fMZjlMMw8E3ukkovYz 9KWCfENfHvCU/bHbTvc+hbb3fp1y1Pv/hlnrygG+kQFHRSpGl6+l93Kpuul+Nqgl0R10 HW5HpkEm4xvYN7dUalQlGZtTvn+RZR3Wmtplg= 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=9xys2HuwOvSeK4RxFk6kURredfqMGn0jnUUwK5hXkjI=; b=d324nN6I+69A06XrhfA97bQe6//GBFM4BPHoHKeI3LxfHfOlk+bjazg1i5PPd9rv/P rtV3uYNxVBsubHhbCDo4wmlcEaXIMbb/EM0tt8AU39AS09DKAz8z993SrHUxOk8e2KlT qtT94dTfWVvsCybbnUqf3Bxu6a7x63xp70urk1NujaGKUCeHVRPVhilirD4QSPH24uDH vatVZeCMiyKAKqHVEyXH9P+l42oBeHooh+t+JMOQFAOtWwb02wdC3foiVkbG0qorSAcu Zmmwk+qdlndqQG5+VDIt9XDU2y0Sbb3Xh1gtWdZXmXjQwcJKs+O82tiToq8p41LzcK39 pkQg== X-Gm-Message-State: AElRT7GCasEFyvQyY3OdTwWfrvXcTn2RARM1wKpbJBZXSkrii1XW05TZ LnkMQcTnmiPmAszGob+EcoACxw== X-Received: by 10.28.170.205 with SMTP id t196mr9159007wme.42.1520265871654; Mon, 05 Mar 2018 08:04:31 -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.04.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 08:04:31 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Mon, 5 Mar 2018 16:03:27 +0000 Message-Id: <20180305160415.16760-10-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 09/57] ARM: VGIC: Move domain_max_vcpus() to be VGIC specific 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" domain_max_vcpus(), which is used by generic Xen code, returns the maximum number of VCPUs for a domain, which on ARM is mostly limited by the VGIC model emulated (a (v)GICv2 can only handle 8 CPUs). Our current implementation lives in arch/arm/domain.c, but reaches into VGIC internal data structures. Move this function into vgic.c, to keep this VGIC internal. Signed-off-by: Andre Przywara --- Changelog RFC ... v1: - dump previous approach, move function to VGIC specific file instead xen/arch/arm/domain.c | 14 -------------- xen/arch/arm/vgic.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index a010443bfd..8546443bad 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -968,20 +968,6 @@ void vcpu_block_unless_event_pending(struct vcpu *v) vcpu_unblock(current); } -unsigned int domain_max_vcpus(const struct domain *d) -{ - /* - * Since evtchn_init would call domain_max_vcpus for poll_mask - * allocation when the vgic_ops haven't been initialised yet, - * we return MAX_VIRT_CPUS if d->arch.vgic.handler is null. - */ - if ( !d->arch.vgic.handler ) - return MAX_VIRT_CPUS; - else - return min_t(unsigned int, MAX_VIRT_CPUS, - d->arch.vgic.handler->max_vcpus); -} - /* * Local variables: * mode: C diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 34269bcf27..c3fdcebbde 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -665,6 +665,20 @@ void vgic_free_virq(struct domain *d, unsigned int virq) clear_bit(virq, d->arch.vgic.allocated_irqs); } +unsigned int domain_max_vcpus(const struct domain *d) +{ + /* + * Since evtchn_init would call domain_max_vcpus for poll_mask + * allocation when the vgic_ops haven't been initialised yet, + * we return MAX_VIRT_CPUS if d->arch.vgic.handler is null. + */ + if ( !d->arch.vgic.handler ) + return MAX_VIRT_CPUS; + else + return min_t(unsigned int, MAX_VIRT_CPUS, + d->arch.vgic.handler->max_vcpus); +} + /* * Local variables: * mode: C