Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933263AbcLSOYh (ORCPT ); Mon, 19 Dec 2016 09:24:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283AbcLSOYL (ORCPT ); Mon, 19 Dec 2016 09:24:11 -0500 Date: Mon, 19 Dec 2016 15:24:05 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: David Matlack Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, peterz@infradead.org, haokexin@gmail.com, mpe@ellerman.id.au, yongjun_wei@trendmicro.com.cn, rusty@rustcorp.com.au, jbaron@akamai.com Subject: Re: [PATCH 2/2] KVM: x86: flush pending lapic jump label updates on module unload Message-ID: <20161219142404.GA21302@potion> References: <1481927436-104568-1-git-send-email-dmatlack@google.com> <1481927436-104568-2-git-send-email-dmatlack@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1481927436-104568-2-git-send-email-dmatlack@google.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 19 Dec 2016 14:24:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 662 Lines: 18 2016-12-16 14:30-0800, David Matlack: > KVM's lapic emulation uses static_key_deferred (apic_{hw,sw}_disabled). > These are implemented with delayed_work structs which can still be > pending when the KVM module is unloaded. We've seen this cause kernel > panics when the kvm_intel module is quickly reloaded. > > Use the new static_key_deferred_flush() API to flush pending updates on > module unload. > > Signed-off-by: David Matlack > --- Oh, this forgotten bug. I guess that patches to do this automatically from generic module unload code would be over-engineering it ... Reviewed-by: Radim Krčmář Thanks.