From patchwork Wed Jan 31 09:34:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10193625 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 4BF38603EE for ; Wed, 31 Jan 2018 09:36:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33A66285FC for ; Wed, 31 Jan 2018 09:36:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2879528608; Wed, 31 Jan 2018 09:36:40 +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 AD6E5285FC for ; Wed, 31 Jan 2018 09:36:39 +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=ZjKxHm0ArhooRMR3WuNO1CF/yOv6VhkKNSCb4Cu1e6w=; b=DnqyVibJg19ITQ5f74yZKQmoH9 g4eVrMrRUrJBxSJQ/KbTOXZsXCgULA1jjAbfPiZFzUnoqSHMuhX2+oxD/Ij+gZrzVjJSuG1bWAO6s yx517uRQ55sKyWPcVY0+vDacJA+YZRA7hWwMU0l3uGi7AmHIH1mqjkQccx9MC+qLHVLFvkpwuEHss RPWGFbM4O6UsupB7SmIR5jWVPWpTEL27r/9uf12omfVKMqAj+n7HdYldyVekYXBc3BZK8/EMA6Lw4 LuaEF2eWnuNZ6V/SeYmFOjZrt4YV9l7uM5cQ0kn4jIypfzTzfiJ9oQpItdp/ByHuIffMDIyqh7hX+ TAwOZG0A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egoom-0006et-8J; Wed, 31 Jan 2018 09:36:36 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egonh-0005YK-Cy for linux-arm-kernel@lists.infradead.org; Wed, 31 Jan 2018 09:35:33 +0000 Received: by mail-wm0-x244.google.com with SMTP id i186so6665266wmi.4 for ; Wed, 31 Jan 2018 01:35:18 -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=4u4pcgdPi/S0sZxnUWXe/CJVNTRbDFNZVSWA/dWAEfc=; b=eF+027HMHvggrvnDlPknnVYkTEHK7oGI7SxMxwmbQFLhZmwo1lYAIZyuDsjCFfA2Xx fNtkXXE0leLsHiTZDMs9CSMbHqthooekKWS5u0Wr/CrMgLFs8StwRTtBu5WplNBlX9jb Sp94VyROpQkWlvVSK4u0h/mu+I4ozH/arXFsU= 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=4u4pcgdPi/S0sZxnUWXe/CJVNTRbDFNZVSWA/dWAEfc=; b=OAxuMTwEDoOHVDBnmxn/msy1lYE6UEt7gCMwRGMrXCH0uB4hc8aRjFYXpoaJwt9Yuj LmsOEL0UkkfUCWEnYnbFZeFml1qcTjbP/JVJaf4fcIOIh9jURu4VFI6iMrcZ4mk2KYcJ eLtMfUxpZaRYHf62wTE5oTfv6SNTt0jRJ6QAGXmAyjao1h9uQlXaFrbbwy8LgOG2PMvU tWeHUQHLKDg/GFwIF53zrHCCUC+GYQXxMoiDhImqkyydpemky9F0NJvy91o9lRwG09HM 6vcrHDcHEtWRJIIgxmZvQSxNrUEQ4G3Iri/2iv8KAQvc4OwgUNg5idOD8+bzXCefaqyB e6ew== X-Gm-Message-State: AKwxytfs1Cbv7NB9X6b2MSkXZKap4kvmuWFiyOc4e02hdIx5vm7tKQDK Yedwgap7tBrnBwYb39aU1yyo7kthWVk= X-Google-Smtp-Source: AH8x224zUXxC13BpklRU+2S9nbI/ObFl+pSkCtAlwbV56e4/KXamAXkKaEI6uLLFEFTWDaKKXxRdnA== X-Received: by 10.80.206.88 with SMTP id k24mr56840997edj.153.1517391317453; Wed, 31 Jan 2018 01:35:17 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id z2sm10247837edc.50.2018.01.31.01.35.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 Jan 2018 01:35:16 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 03/28] KVM: arm/arm64: Remove redundant preemptible checks Date: Wed, 31 Jan 2018 10:34:42 +0100 Message-Id: <20180131093507.22219-4-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180131093507.22219-1-christoffer.dall@linaro.org> References: <20180131093507.22219-1-christoffer.dall@linaro.org> 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 , Christoffer Dall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org 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 6b60c98a6e22..3610e132df8b 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); }