From patchwork Wed Dec 13 10:45:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10109679 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 98EF560327 for ; Wed, 13 Dec 2017 10:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B9F228E70 for ; Wed, 13 Dec 2017 10:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 806BB28F09; Wed, 13 Dec 2017 10:46:56 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 ED6CC28E74 for ; Wed, 13 Dec 2017 10:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbdLMKqu (ORCPT ); Wed, 13 Dec 2017 05:46:50 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35187 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbdLMKqi (ORCPT ); Wed, 13 Dec 2017 05:46:38 -0500 Received: by mail-wm0-f68.google.com with SMTP id f9so4178549wmh.0 for ; Wed, 13 Dec 2017 02:46:37 -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=V30RIWG3ERL0oaJ6phxWU/FcR81NbE7IwlusRmQN3So=; b=A6vFibH3H0ELZokkEWuAyg1XAUFK93PIrziC4GrsGaiIyO2Z303OWskNBLqF5trYZk KVtAYcnHUmyvZMl/sqmicwBKicQ2tzx6DlAv/eOmhi1Mk4dTXDIPU0PT4WtycZrjh4Ix ovSmx/k7Km1X9lE64Ku/18XgSv9pjcEimxoP0= 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=V30RIWG3ERL0oaJ6phxWU/FcR81NbE7IwlusRmQN3So=; b=nkcczh2VK5YOsF/Th9i8ZhpApd0eoxsIFJ++cVpss5+bMsvwaJl20xvkNjsF3sIja3 wb9X0ghr31ejE5BNQ9ovO4Hcq7sqiSCjRJDlbab7eiQB0eJQQQA5kZJRU9cWmXe3rSrY 8cQxTTY3Pntte4+zPndgiWpqx6Xkuyv0y0UEW+m6dS62HzLpN8G6ygdBiWJQQe4EzwdX Hq5pZm6iM2H2MPOjIGsWtZt44clg8/2/b07pmNyaBT/lVQIibGRxLC0Tzb7k4Vg/80Qw wJjbZPoHH6h2WcmELn0egMRJOvEhsgnDY5AESDrpVu354aZioQZZt3sFVJqb/f+l0NR+ 4t/g== X-Gm-Message-State: AKGB3mK6mtQkFCxBar+tp1tMjlPk4e/b/Qh0DI00vUJEGADTUzxi350G Ggvam9WjNAl3hSpGakE8kZWJWA== X-Google-Smtp-Source: ACJfBovayxTYZ6tsBlqhjUUSWqdf3MBL26G7q12xesAolrulEN9ZAlcNxG2PX5bDWpnsUMojTgjQuA== X-Received: by 10.80.176.194 with SMTP id j60mr7190765edd.254.1513161995836; Wed, 13 Dec 2017 02:46:35 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id d92sm1079682edd.21.2017.12.13.02.46.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Dec 2017 02:46:34 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Eric Auger , Christoffer Dall Subject: [PATCH v8 1/9] KVM: arm/arm64: Remove redundant preemptible checks Date: Wed, 13 Dec 2017 11:45:54 +0100 Message-Id: <20171213104602.16383-2-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171213104602.16383-1-christoffer.dall@linaro.org> References: <20171213104602.16383-1-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 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); }