Message ID | 1417686484-20828-4-git-send-email-eric.auger@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 97DD79F1C5 for <patchwork-linux-arm@patchwork.kernel.org>; Thu, 4 Dec 2014 09:52:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E4CE020357 for <patchwork-linux-arm@patchwork.kernel.org>; Thu, 4 Dec 2014 09:52:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E781B20272 for <patchwork-linux-arm@patchwork.kernel.org>; Thu, 4 Dec 2014 09:52:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XwT40-0000uZ-M5; Thu, 04 Dec 2014 09:51:08 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XwT39-0007kV-NF for linux-arm-kernel@lists.infradead.org; Thu, 04 Dec 2014 09:50:16 +0000 Received: by mail-wi0-f179.google.com with SMTP id ex7so27278324wid.12 for <linux-arm-kernel@lists.infradead.org>; Thu, 04 Dec 2014 01:49:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=v40VJog7pjraEmiXcl07+8IbqPtoRvnYMfVxkKb0ldY=; b=FGntLzXNW4Xn6zQZjVoDKnmNKi9Usj6t/s2V1qIJSwRY3RtoGmGPtyxt2qd9jesXXg HIRQyFXePmOEA1L8e0UpU2xV9SI04oTUbyABPRcosj65miA8YUeFbOhaCk5Wmbngrs3+ Q1LHFLqLy65eWcymhbM73+tDncIq1FyeamoGzInhbbTUbppmuzGZgKz4Ui98cTgL5hns xT9NGvTlGyOLuy2ac8AHiLr8Bma63xMzGRuBr5d0HTkw3H1Z5YgaCIHECka84uWvBJ4M k+wQSqrsBX8dSvJUrhtQBV6kvzuq/dyS5R+ZRQAjVPI9ISjMMC8uuHOj91GA7Mm8Ao7R Y8jg== X-Gm-Message-State: ALoCoQnu45ZI7S0A9NKG9eIjcsesEbnhHOclUpQnXlADG+7U0mMP9TJZOg3bTF62SIU+GmUuA4X0 X-Received: by 10.181.28.3 with SMTP id jk3mr10682763wid.16.1417686593370; Thu, 04 Dec 2014 01:49:53 -0800 (PST) Received: from gnx2579.gnb.st.com (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id wz5sm39765342wjc.29.2014.12.04.01.49.51 for <multiple recipients> (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Dec 2014 01:49:52 -0800 (PST) From: Eric Auger <eric.auger@linaro.org> To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, andre.przywara@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, alex.williamson@redhat.com, agraf@suse.de, gleb@kernel.org, pbonzini@redhat.com Subject: [PATCH v2 3/4] KVM: arm/arm64: check vgic_initialized before VCPU creation Date: Thu, 4 Dec 2014 10:48:03 +0100 Message-Id: <1417686484-20828-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417686484-20828-1-git-send-email-eric.auger@linaro.org> References: <1417686484-20828-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141204_015015_949021_7235E695 X-CRM114-Status: GOOD ( 10.35 ) X-Spam-Score: -0.7 (/) Cc: a.motakis@virtualopensystems.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index b5401f7..edcc66b 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -216,6 +216,11 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id) int err; struct kvm_vcpu *vcpu; + if (unlikely(vgic_initialized(kvm))) { + err = -EBUSY; + goto out; + } + vcpu = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL); if (!vcpu) { err = -ENOMEM;
Now that user-space can initiate VGIC initialization independently on the first vcpu run, let's check the user-space does not attempt to create a VCPU after this initialization. Signed-off-by: Eric Auger <eric.auger@linaro.org> --- arch/arm/kvm/arm.c | 5 +++++ 1 file changed, 5 insertions(+)