From patchwork Fri Sep 15 22:19:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9953879 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 75396601AE for ; Fri, 15 Sep 2017 22:22:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5176E28161 for ; Fri, 15 Sep 2017 22:22:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4222728521; Fri, 15 Sep 2017 22:22:06 +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 C3CF32957A for ; Fri, 15 Sep 2017 22:22:05 +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=PCebfr1yIMsqhXY6DZz0pSEDCMhA8x+3Z8X4bJl0TB0=; b=Rzsuj62wJIKVhlL5w5bvA9M9Y1 CCoC65k6npXDiABpgZPfe88vOCLmEjXEgqYPzSWOx4b5NzE0/GaQveUpGvnBHMtmK0Mearr6Uf9Dv EdYTMBmZ9qjPyyOYJNMwI/SpqMNfd3zgy+8XZTnzwGFn2GWDmZEU58x2VGjddCRZZnCfgUMm3cp3k Dm74wEbCzr/Uyyj3fZI0g+soSEGxsdRafPLr2bxPiWm9hJ81OtB2xkKS1wuHCljeCrA+pqY0+MRoL QMck296NdVEB/eRcuGq3jdmPVRxJ7bKVEmObpCUYAJSrQK7BsBy5ZbNrhYx3spIxE/7ZxuRv53H0I 78bupoIg==; 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 1dsyyp-0003bt-PG; Fri, 15 Sep 2017 22:20:59 +0000 Received: from mail-ua0-x232.google.com ([2607:f8b0:400c:c08::232]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dsyyK-00026s-Pi for linux-arm-kernel@lists.infradead.org; Fri, 15 Sep 2017 22:20:30 +0000 Received: by mail-ua0-x232.google.com with SMTP id k63so1924351uak.12 for ; Fri, 15 Sep 2017 15:20: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=OdI4AC0NMs7kC2EZBcQrs8VHrK4e0qB/c6YIQR12YhGMtxix3kiCOsCoUd8jV2d8hQ JIeWOFnWsnzYFMAtZWtvmomzBNRrk2eauvvYHu/CNFjPXy6lWmFu2lLrfK87KY4I2Tee LKBjesxylXMkUGrkxURaA6gLgh5e5gWAo8wI8= 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=gnFyWNWaBMokZSeuBs/7QkLeH0ehkHS6ss+DDWDGIjtNIk6muTUzXbxBMYudOtlsLO 0itY3g7Zolg3sFw02ZO9xnLCEmHD7xlLDOfNy0Pp/7xetX95khVifvtHVeahbgRk2zBD WZX5gv3NYCQCOKNyY8Y0iAiRT6fgt/r6rV9iBGaSmUpyj2qD99qHXF3GoQqy/q6np6FX goNi2dIZ/84sy41n3tROASA7l58jKVM7kIKLU2Y92YKM4vC8WVmC7Z5Lv7+3GCexxSc7 eoeZYptHijrRcu4rbXNJjwb7pWh0mztzKJIF5Xyg52efpNJJTTqPB10AkpDCuxOH3fc0 yD6w== X-Gm-Message-State: AHPjjUh8lomJ+30C4CvcQ0V1N4yUROt/z/nJea+BSpk7Rw/JrLrWWCnG LXxtF3W2w0BDkY3g X-Google-Smtp-Source: ADKCNb6k9uhVudyx3xyj/PZC+c+6SzHzQYrrtmeZ2Om1UfKhV9medSATHKSnmMVI1gYBO+6XCzrDdw== X-Received: by 10.176.68.66 with SMTP id m60mr23187220uam.123.1505514003917; Fri, 15 Sep 2017 15:20:03 -0700 (PDT) Received: from localhost.localdomain ([12.145.98.253]) by smtp.gmail.com with ESMTPSA id q64sm399435uaq.13.2017.09.15.15.20.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Sep 2017 15:20:03 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 1/7] KVM: arm/arm64: Remove redundant preemptible checks Date: Fri, 15 Sep 2017 15:19:48 -0700 Message-Id: <1505513994-77939-2-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505513994-77939-1-git-send-email-christoffer.dall@linaro.org> References: <1505513994-77939-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170915_152028_940706_C282F797 X-CRM114-Status: GOOD ( 11.33 ) 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: Marc Zyngier , Eric Auger , kvm@vger.kernel.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 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 Acked-by: Marc Zyngier --- 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); }