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: 9953865 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 EFD7E601AE for ; Fri, 15 Sep 2017 22:20:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB3F929575 for ; Fri, 15 Sep 2017 22:20:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D008B2957D; Fri, 15 Sep 2017 22:20: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 6725529575 for ; Fri, 15 Sep 2017 22:20:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751259AbdIOWUF (ORCPT ); Fri, 15 Sep 2017 18:20:05 -0400 Received: from mail-ua0-f181.google.com ([209.85.217.181]:47937 "EHLO mail-ua0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbdIOWUE (ORCPT ); Fri, 15 Sep 2017 18:20:04 -0400 Received: by mail-ua0-f181.google.com with SMTP id k23so1910447uaf.4 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=XqMWc5uSJPvQkmPvWoo61+Px0VHg6Xbtqmyk8iNYj0lejpZwihGd13xqTinKuxFAxm JCKbqcn/6YvzuL9u/bWkhh7ICrIB7igAires7oXuFOsU/TEP4MAfClKduBK2LG2dI9u3 C5TPQA1HG4BHQlpCXwTGftXy2p5Y+ThDg4xaHOpl/7+1dBbFciQD5VbE4BrBRktVNa9Q API1VAMAMX9aVXbOd3fd9Xj0c1QrIgliE6JmDsundXhdz2Q1tL81tMjWH60gRrwkMR7q VOzmntDAWATY2ETYo8LsrZ0cwo7xLZ+6ksy6sJPBELdX4pSM+YUeC9GW5EDO1ROTbOt3 MnAg== X-Gm-Message-State: AHPjjUhkQS6KVaJJWjx3haabunCrr3xHcfw31TQHENaXYhXVcJ6l012Q CDN/xmpcpsX3c450 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 Cc: Marc Zyngier , Eric Auger , kvm@vger.kernel.org, Christoffer Dall 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> 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 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); }