From patchwork Thu Dec 7 10:54:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10098439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AC84B60325 for ; Thu, 7 Dec 2017 10:56:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93C662A417 for ; Thu, 7 Dec 2017 10:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8784E2A41B; Thu, 7 Dec 2017 10:56:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 19AB62A417 for ; Thu, 7 Dec 2017 10:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NMLUXmcI/Wk3IXHUQyDv6mTU+iADKdp2UpLx08OM784=; b=ZTO3VU9IM3T3YZ3p86JLHD3e4F pP3tStxReARmwi2Cc00xwEyedyFtpnMXYZOrzi4AzeNks6Gwyso5Wb65Xma6Zsr2Yn11oWinIjzIC P+ieM3gSUuxiUacocw6gSZzmCgE4JCU5x0exoJKvzcf/+E0PrxZSfLP/Is8cskWtXXKqCYxfJxw3U A7lQgWjLhMTVbTQZ03FL9bMxAxZkWHXDchKJQIs2VTsdRgX6AHjDCls5HidFGUXWbSWJvVlM1Boux 96joYQbd86m4VznqKxJkqyHA1gx3VNKiEsTa+XiTnbCWix+60571S45sMzGmZaxEe49uIMm1TL4NS TIOzxJ/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eMtqn-0002pf-R4; Thu, 07 Dec 2017 10:56:21 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eMtpJ-0008Tt-S9 for linux-arm-kernel@lists.infradead.org; Thu, 07 Dec 2017 10:55:08 +0000 Received: by mail-wm0-x241.google.com with SMTP id g75so12393290wme.0 for ; Thu, 07 Dec 2017 02:54:29 -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=V30RIWG3ERL0oaJ6phxWU/FcR81NbE7IwlusRmQN3So=; b=Pnl95j41k8j8oFwNbtJGkqI8ZHrCN+rrXqTWWqOL8eUJNVLEqprwUUS9D2Q3k8s3Mr zdnmzK1bfcYFQpxJ4KrPfCPUPo2ci9m/IBfilznL8edQakC5YzS2PjETu8IXK/SQKEZY yxxLwRVsw0ZLgJ1dxkq604+fkowzXnrso862A= 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=V30RIWG3ERL0oaJ6phxWU/FcR81NbE7IwlusRmQN3So=; b=q20MIASN0NEL2wxEzY2vS+NO6SsoAGfX6QW5Rb2GjvcQzdonY9Omir3YUmszNKuNiR FKXqTvZOESavs+W6TJdCq7lsbXqXaANB7g9nTxh8yJjITzAGm0fKFx4NbRC1uHshsgUB GRaHQQbKF2TySAfqjjf+oB6A/3cZtJRIk9X9SZfsY128fPQ5tVnnXj1uTVZzWkPcNCvq mMPYF/7QOufP2HWxepXJWLbpIBwrzG0wpIFuNWYo9NXB0+vfX/4Jwb7x44y1JOLw6aEK MMTMrO0K5//liJ2KL8agg48WhOZ2XxdnkPpzoamuR+RUWTXE+TNMoO8ojVRhzBeE3F9k hx3Q== X-Gm-Message-State: AJaThX7BBm9b6QhUymy96ghT7Zmsrj4qFbPbF35wus9MChXYNgXsvm7D LxJz6+8WNalL0poIkJKC8+7PYQ== X-Google-Smtp-Source: AGs4zMZ6KMMEAyLfI2PJl32e3ErWy/on38J79Nfh5P5aqEB/t7Q36spcg5KyZWQ7S7b6BCAy44IIsQ== X-Received: by 10.80.177.72 with SMTP id l8mr44800952edd.175.1512644068241; Thu, 07 Dec 2017 02:54:28 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id t23sm2233671edb.70.2017.12.07.02.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Dec 2017 02:54:27 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v7 1/8] KVM: arm/arm64: Remove redundant preemptible checks Date: Thu, 7 Dec 2017 11:54:11 +0100 Message-Id: <20171207105418.22428-2-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171207105418.22428-1-christoffer.dall@linaro.org> References: <20171207105418.22428-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171207_025450_283394_8744CA37 X-CRM114-Status: GOOD ( 11.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Eric Auger , linux-arm-kernel@lists.infradead.org, Christoffer Dall MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The __this_cpu_read() and __this_cpu_write() functions already implement checks for the required preemption levels when using CONFIG_DEBUG_PREEMPT which gives you nice error messages and such. Therefore there is no need to explicitly check this using a BUG_ON() in the code (which we don't do for other uses of per cpu variables either). Acked-by: Marc Zyngier Reviewed-by: Andre Przywara Signed-off-by: Christoffer Dall --- virt/kvm/arm/arm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index a6524ff27de4..859ff7e3a1eb 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -71,7 +71,6 @@ static DEFINE_PER_CPU(unsigned char, kvm_arm_hardware_enabled); static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) { - BUG_ON(preemptible()); __this_cpu_write(kvm_arm_running_vcpu, vcpu); } @@ -81,7 +80,6 @@ static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) */ struct kvm_vcpu *kvm_arm_get_running_vcpu(void) { - BUG_ON(preemptible()); return __this_cpu_read(kvm_arm_running_vcpu); }