From patchwork Mon Dec 4 20:04:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10091439 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 7925F6035E for ; Mon, 4 Dec 2017 20:06:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A9A828AB2 for ; Mon, 4 Dec 2017 20:06:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F31B28F60; Mon, 4 Dec 2017 20:06:35 +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 EF38728AB2 for ; Mon, 4 Dec 2017 20:06:34 +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=cvXmLo5OoJ8x7zH/CWR/cZHDngqoLS/JKYOPsUea5Sk=; b=I1D8PaqVojE9e1dBL9g0SydwA9 NX1SEo9gfN9SvSOk9LxtmWIpmunKqsCJwkSSpWN6BO8wwSUDEdQoDIoCv2TQAAW3a4rRQbzNtFhmt 7rg/Hvn50NDt4+i5jECp9/wOqsexMhEsy2hyhrGkdIb1mLhOljZaSkg+mYT8pc4P2dZDv56Vy9PjP hUaiJS2HKyCXZv7eK5ABTF8WRGm3wIxvgBz/39DK4heVzCS3by5Ky/QCJA+9JUIBB6izt948z48JO 1LyVDDdmQD4kbTTovNmze49OmPGu1kmb1Y7CvFShmO12wMDhp0dpYZLmCYdcZjsLCOJaJHjGZYhFM YzBBm7JA==; 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 1eLx0V-0002m1-Ch; Mon, 04 Dec 2017 20:06:27 +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 1eLwza-0002Qv-TA for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2017 20:05:32 +0000 Received: by mail-wm0-x241.google.com with SMTP id l141so8039246wmg.1 for ; Mon, 04 Dec 2017 12:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=christofferdall-dk.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Tg356+s4yM2U/W5Qz7nWJl75RaJJVqTzgNK8V2QNYgs=; b=Wx1kzto8ZD64liFV4U/1vYM8kXEbSjWU/x6LNiMF31TiXUO7AHMcQtk75Zb295jejy PGFkdXmZH+PAO3c3mt1KLgIT39v/4bVoMZAeLmyLwZ2ysBGjgjhnz2Sn1yLtsgd5VtGR m3tWCQHdBWNia8mcOecFPYH5tAOnaKYDeVEgSSG/YRWDrh2BDmW24zrNJVAq75OfKvnG QGDNFP9VK9DQuiD3yM8Cyaiz1EIkhswKG8aR2Ccq0Fa+hnhWDTgLN/uq96CYljBrtfzA YWNDXYOpZSxCUwOktYiNVMB31AtZTz13lJb3c+YlO8xcvCq9H77cnTA+MyxowGY06t4p Mo5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Tg356+s4yM2U/W5Qz7nWJl75RaJJVqTzgNK8V2QNYgs=; b=pGIaGyK0HzP99uQy4vaeA8MGRM2JwXmrpiimRfK9BWZZ2uBLUIuB2Yw+dxxaMhLyxe O3Y3ssaGqM/Pc+4ZgExcvD8jXMsh5XXTy/7qLiJ4v/RO/rRVkbcafxpTzHrzqFKcj0KG 37B6GikwwhoZbIn1Z53pUeLl+/BAntQbuTpeY4xXSNBgwC22AbiJo0GG6EMhtwoJJYPu D3QuEHmpGkZLDudjI7HEvEzRK1qfKiV1aCBWbKLdF9wK4Ay2dwBQv3k29QRGgd+5jmQM Aobq4biaf6IWqdSNgAGVvaoQHRLLuziYhBLQ39YxUkjr+kU/3khhitgNXlanP+2STDqY 8QQA== X-Gm-Message-State: AJaThX5sJ5MrMWkOCU6ro5mExoT5el3uXE79UHj8ZWo2CErxpJxamx0H c3mgG/qHyAdlnNdckwNUFGRN7g== X-Google-Smtp-Source: AGs4zMb3CM3RN04VSxC7w37SlFtGWXSeNyYEkQ/wT7KrmH5aTY8sHWPEIez8mABKIF2S+tREhdpw0g== X-Received: by 10.80.147.14 with SMTP id m14mr28278543eda.121.1512417909097; Mon, 04 Dec 2017 12:05:09 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id 26sm8374578eds.67.2017.12.04.12.05.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Dec 2017 12:05:07 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v6 1/8] KVM: arm/arm64: Remove redundant preemptible checks Date: Mon, 4 Dec 2017 21:04:59 +0100 Message-Id: <20171204200506.3224-2-cdall@kernel.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171204200506.3224-1-cdall@kernel.org> References: <20171204200506.3224-1-cdall@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171204_120531_101976_733DBC9F X-CRM114-Status: GOOD ( 10.70 ) 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 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). 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); }