From patchwork Fri Sep 8 14:52:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9944431 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 AD7F06034B for ; Fri, 8 Sep 2017 14:53:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A93FC287B5 for ; Fri, 8 Sep 2017 14:53:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DEA7287C0; Fri, 8 Sep 2017 14:53:07 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D55A287B5 for ; Fri, 8 Sep 2017 14:53:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756398AbdIHOxF (ORCPT ); Fri, 8 Sep 2017 10:53:05 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:34811 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756377AbdIHOxE (ORCPT ); Fri, 8 Sep 2017 10:53:04 -0400 Received: by mail-pg0-f49.google.com with SMTP id q68so5236091pgq.1 for ; Fri, 08 Sep 2017 07:53:04 -0700 (PDT) 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=1Jvt3nCV8oCdNhAbqAoxe0IFV9buoRpBtQfqpcn/iBY=; b=V2IC8AnXZiXuXNkz3eCAebscAqCId05mBLQBZ3xzRURQVAkLOvBujHFECMrBc86w8H c/aOTPn1m9/10JoSIn/OCnM5snmiuvXrDzEakI6LuWU+RRxLvLf1iMEI9aRh67+IZJMI Tz65FCYTZoayFko1TNGgAItdfI0c58untLqyQ= 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=1Jvt3nCV8oCdNhAbqAoxe0IFV9buoRpBtQfqpcn/iBY=; b=bMxJ7LmfxQtwAk8NT2UK7NqxvQj9q8VPA2fdaTnOiV5N7rxuvj+wf6Md9VIYOIGRhj leS2ssiH/8kojknZMEEIgmO4rug/3Gaqln5NX7ptYA5Y5NwLk9i7M7R42/a4Cido0RCX GkjLlr5wD2Iz6fCzHI7KzTBaWJHcvKNM9xHmYhBBZHLftKNZ0PK/nTinOPtLq5eVNH8G 60XhU5qXjCwyrbEn9YmqotbxGzEtpuJQfEkIXvKocptgjy2EXLhzpfzHOzkN0T3ToFJ6 crBondd2X9At4/Els2r6FWWQj8VWvE6XUZ+quQebeaEH5pbDexZp/nxJSw4kGsy+eI7j Ibww== X-Gm-Message-State: AHPjjUiRWkdiVnDfs0KFORNblXDNHXwBiQB2WkdXTH/pjcxErbf/cgqt ungBzaKO8hxuqXBZ X-Google-Smtp-Source: ADKCNb7pwPO1UVpCcRb+qlZcBbrPXtx8Mkb0LPFYZ5BsEswjVdhDCA0dPPEMMhrMtUwHOyegVNzxng== X-Received: by 10.99.117.30 with SMTP id q30mr3485053pgc.106.1504882383953; Fri, 08 Sep 2017 07:53:03 -0700 (PDT) Received: from localhost.localdomain ([104.153.224.169]) by smtp.gmail.com with ESMTPSA id x189sm4258160pfx.188.2017.09.08.07.52.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Sep 2017 07:53:03 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , hemk976@gmail.com, Jintack Lim , kvm@vger.kernel.org, Christoffer Dall Subject: [PATCH 1/2] KVM: arm/arm64: Remove redundant preemptible checks Date: Fri, 8 Sep 2017 07:52:18 -0700 Message-Id: <1504882339-42520-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504882339-42520-1-git-send-email-christoffer.dall@linaro.org> References: <1504882339-42520-1-git-send-email-christoffer.dall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christoffer Dall 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). 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 a39a1e1..04313a2 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -69,7 +69,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); } @@ -79,7 +78,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); }