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: 10091423 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 7B9CF6035E for ; Mon, 4 Dec 2017 20:05:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E83928AB2 for ; Mon, 4 Dec 2017 20:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61E1D28AF2; Mon, 4 Dec 2017 20:05:15 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 E44D028AB2 for ; Mon, 4 Dec 2017 20:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862AbdLDUFM (ORCPT ); Mon, 4 Dec 2017 15:05:12 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46317 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbdLDUFK (ORCPT ); Mon, 4 Dec 2017 15:05:10 -0500 Received: by mail-wm0-f67.google.com with SMTP id r78so8069562wme.5 for ; Mon, 04 Dec 2017 12:05:09 -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=gMU+m9pBRLADj3jj5OlHhH8P0BYA5MtTC/AG+nfYIuz3ku8HDDLltb5l7zxzAMsGFK Ll8jYRLw4au/OgWjNVfJui90yVXEtneHYhd8ehSO2eHlho9Vxx2ec442K3ddnxelQTtD m+ISNYlXYsvpNaTpt1sixqDkU/ngPs2a1q+6Mmdh1+r9GRBVa8D6vv4cLfmcoiC1vl4J lQl/xAyDTBfgad/c3kOQmTfbVclPzwdr2B5kflDUnAqtQXm+V7fTOaw6Xt3pDLmF25zC uHh3cIkNlJ5wV2NCwjGe3RR2aKWoTWN9k+nc0O/XbKrCV6pdThL/Qxp0ey07lWnPHeDJ f8qQ== X-Gm-Message-State: AJaThX4iJarJhK/rldYjop4xYFORR6k6vSgBMMhAGcNTRXxLGG/G9GuE xxx075hHZBiOAiS48tRy1X9iOtseKE4= 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 Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Andre Przywara , Eric Auger , Christoffer Dall 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> 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). 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); }