Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1092503imu; Wed, 9 Jan 2019 11:28:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN4cKAralOvSbQ4JN6iHSCvPN2TpOGB4CMuOUHZ/1mUO63JoHgJo9JlK7dOfgzMGCR3Eh4z1 X-Received: by 2002:a63:fc49:: with SMTP id r9mr6417209pgk.209.1547062133800; Wed, 09 Jan 2019 11:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547062133; cv=none; d=google.com; s=arc-20160816; b=za2zt1YsVmV61WXgw56PnFjFBnFc82/Z1ok6Bz8O0m9YUHJXLo6SD18YXb4KWyZKhQ WeC+sO5xShAruKhHVMIre4YRMvT5InoJbiI9rx854RDkP/9NkcSO+4xt5b5t2SqRz+gD MoBK3K2jW4Ayeh2veCch2YGqp46+ktYktB7RYakH2m54PTdQoMyXNjguUXRyMRi6Ta7M +LN/PmqZlqeHBUx9tUNIZ/mw7JNQFdCPwzpfapcVkQwbDK6aFIQ5SNXTe6YtLS/lqh3e yC6wQebZlthQALl0hS5SgeTkrNaikLWR8sEUKItCJHexiRMlKO7r2SYiSliPHFR6Kg6q GrIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yAiGMNRxTeuPuJy64aXv+hGDZ/pa9blfIU4q0md7LjA=; b=UcKNaOvpgBOxhkPNLT0SNFfyXiH9nZY2Bzdi/FQaVVnoObQn7g9vuodQ9dbS4GI05C mMAhwCabUuK2TjbJDqDjiwMW1mu/3UaeDfKelyBiUAsljrZbzEgQPkaVo1XzObGp4q5+ GDuHGotdJ0VWec3e0GZMJnP5bqP/vGW1YB72MOCVpXCaOFVJGaeX/vEGDE3rAl6+LEly 2tAeuTL3tKw5fnyGlffeO//pw9S0Wj4P0DDXZeUIAWt0QVze5Gg+waF7xC+ZMB2Grza7 f0TTLGedt9oJXE/T7jzC2IvR5gnUCh0rK20OHT18kBN18nqE23DYHOyw8uBTsezQz/OV EmWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36si35034391pld.46.2019.01.09.11.28.38; Wed, 09 Jan 2019 11:28:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728349AbfAIT0i (ORCPT + 99 others); Wed, 9 Jan 2019 14:26:38 -0500 Received: from mga03.intel.com ([134.134.136.65]:31174 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbfAIT0i (ORCPT ); Wed, 9 Jan 2019 14:26:38 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2019 11:26:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,458,1539673200"; d="scan'208";a="265833413" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by orsmga004.jf.intel.com with ESMTP; 09 Jan 2019 11:26:37 -0800 Date: Wed, 9 Jan 2019 11:26:37 -0800 From: Sean Christopherson To: Mike Galbraith Cc: Adam Borowski , kvm , lkml Subject: Re: 5.0-rc1 KVM inspired "BUG: Bad page state in process" spew Message-ID: <20190109192637.GA1697@linux.intel.com> References: <1547012338.4926.11.camel@gmx.de> <20190109144257.erwh52326ucgc5tw@angband.pl> <1547046196.31155.1.camel@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547046196.31155.1.camel@gmx.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 09, 2019 at 04:03:16PM +0100, Mike Galbraith wrote: > On Wed, 2019-01-09 at 15:42 +0100, Adam Borowski wrote: > > On Wed, Jan 09, 2019 at 06:38:58AM +0100, Mike Galbraith wrote: > > > KVM seems to be busted in master ATM. All I have to do to have host > > > start screaming and maybe exploding (if the guest doesn't do so first) > > > is to try to install a (obese in this case) kernel over nfs mount of > > > the host in a guest. > > > > > > Kernel producing the spew below is 3bd6e94, config attached. > > > > I get same, except that the BUGs were preceded by a bunch of warnings, > > Yeah, I was in too much of a rush... > > > > homer: # grep BUG: /netconsole.log > > > [ 1531.909703] BUG: Bad page state in process X pfn:100491 > > > [ 1531.958141] BUG: Bad page state in process systemd-journal pfn:100412 > > > [ 1532.662359] BUG: Bad page state in process X pfn:10043f > > > [ 1532.664033] BUG: Bad page state in process X pfn:10044d > > > [ 1532.686433] BUG: Bad page state in process systemd-journal pfn:1027b0 > > > > the first one being: > > > > Jan 9 00:41:22 umbar kernel: [74122.790461] WARNING: CPU: 2 PID: 26769 at arch/x86/kvm/mmu.c:830 mmu_spte_clear_track_bits+0x7e/0x100 > > ...I also get oodles of those. There's also a bugzilla bug that's probably the same thing: https://bugzilla.kernel.org/show_bug.cgi?id=202189. I'm 99.9% confident this is only manifests when reclaiming from the guest, i.e. host is swapping out a VM's memory. The WARNING is complaining that KVM is trying to reclaim a page before it has been removed from KVM's MMU, i.e. a use-after-free scenario is imminent, and the stack trace shows the kernel is reclaming. The bug also listed host swapping as a possible requirement, and last but not least, I was only able to reproduce this by forcing reclaim. I'll try to bisect.