From patchwork Mon Nov 20 19:16:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10067097 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 48C4C602B7 for ; Mon, 20 Nov 2017 19:30:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB1C228D18 for ; Mon, 20 Nov 2017 19:30:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCDA528D35; Mon, 20 Nov 2017 19:30:01 +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 6EF7E28D34 for ; Mon, 20 Nov 2017 19:30:00 +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=2YHKfWQdKMVtXTqeF5zTetUp+WCaYbSC2iyhMocylQA=; b=VWq+vtLavb9ZsqpZG1uyncRT2W E6kOYLP5yNIKAW0xF4kynNzGCkvmXMaGHA7KczP5L3IYlUIMfGYyPQQ67vV50BMkqjoHnjxiEV0Wb PWwWFy9zVXCStTo0ZtC6fdaU/wzZZsYu0iszJYhH66qxXtXhTp9pEditn2jpUBeIQnf81OpP6RJ4T wqd2YHsh+Ppp5/Wmmef2mjKQEh9ZLbapQsyHRxy3+myuST+4BOIvwNvMc5IEH6tueckEw+i9UeW+K jFRmNoHGa5f57KW0IdoU7HXZhNTpZXQ3h0ZV6Ot+XFsyyJm9izihxRyYJDAJIDj95+L+0SFX64bMT xltGF6cA==; 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 1eGrlX-0001Qt-Gl; Mon, 20 Nov 2017 19:29:59 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eGrZ5-0007qd-Mo for linux-arm-kernel@lists.infradead.org; Mon, 20 Nov 2017 19:17:10 +0000 Received: by mail-wr0-x241.google.com with SMTP id k61so9081450wrc.4 for ; Mon, 20 Nov 2017 11:16:47 -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=5UUdpA4XZxYmNhhAHYsbhmI3ZF3DM+TetiEJ0messHU=; b=GYuwylh0gDjPCm0+VIrBm1Nh1hE7KNlbCxC/jOVDZ9O/7dAbED9zewVS63sq2V8kgU LlRl0iHYbyTKiUtlupuorqaEgi/+QoEFmnIVEisxZSdfj7/HNdjNj9bEdhjck/mY9tx1 KeHjDQaNG9i5MEjwbLDONRuJDJ3Ij4LwXOUGs= 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=5UUdpA4XZxYmNhhAHYsbhmI3ZF3DM+TetiEJ0messHU=; b=PCRt6XCp8UZZPtlzOaroLZG4sGg15q4j1ZCq+xjM6VEkNhEATP3PXYKtz6/ykHVYnF MEwOs32CKV4HbdG1GeveYaH/U9RH6yY14xwPpjl5qg8N5qKTfDwDf3ZIkMsj8BXEAaZY LNBYt3fknJohyeoiUEPBX/5BU1SGhQNvG+r3hwbdAHOJgYYIUK5UtgbZS+7KFx+6mGN5 2Vub+hJbGVqwFUZdHe8h/EPl/Zo6J3PKC++DV7Vv5FXQOMlq5wDsTFujbMQbeTWBZoTw ZhcecUG/jFI8Z+FxcbmOBf8QjDFkhY1s9JWXBdUGlVqB/NGBSQoKBWJgmaIUNfFtOq8l mCpw== X-Gm-Message-State: AJaThX4LT2zbx70apyflqq0Zj6LTWUpBshEiFZRQbLPUkAcHZXXivxA7 vDUBB0NTHMq86FxG3xQIb1HPdw== X-Google-Smtp-Source: AGs4zMZbfY8zpj1Vn+548ZNQJw+ofFPLN6v1DCNuPrZHFUnF4yv0ICO82EDqjv8tN/KuK81lLmS+Ww== X-Received: by 10.223.158.74 with SMTP id v10mr12914159wre.201.1511205405290; Mon, 20 Nov 2017 11:16:45 -0800 (PST) Received: from localhost.localdomain (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id f132sm3726885wmf.17.2017.11.20.11.16.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Nov 2017 11:16:44 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 1/8] KVM: arm/arm64: Remove redundant preemptible checks Date: Mon, 20 Nov 2017 20:16:42 +0100 Message-Id: <20171120191649.17290-2-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171120191649.17290-1-christoffer.dall@linaro.org> References: <20171120191649.17290-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171120_111707_897683_972D4FEC X-CRM114-Status: GOOD ( 10.76 ) 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 , Eric Auger , Christoffer Dall , kvm@vger.kernel.org, Andre Przywara 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 Signed-off-by: Christoffer Dall Reviewed-by: Andre Przywara --- 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 c13d74c083fe..28548aeaf164 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); }