Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752882AbbKPDdt (ORCPT ); Sun, 15 Nov 2015 22:33:49 -0500 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:50910 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbbKPDdp (ORCPT ); Sun, 15 Nov 2015 22:33:45 -0500 Subject: Re: [PATCH 06/10] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for reverse-mapped sptes To: Marcelo Tosatti References: <20151112204849.ba920599a8426d7196a0df73@lab.ntt.co.jp> <20151112205343.61fbcc0a911e891b1ddc8f19@lab.ntt.co.jp> <20151113220819.GA30105@amt.cnet> Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org From: Takuya Yoshikawa Message-ID: <56494ED3.20301@lab.ntt.co.jp> Date: Mon, 16 Nov 2015 12:34:43 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151113220819.GA30105@amt.cnet> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1203 Lines: 28 On 2015/11/14 7:08, Marcelo Tosatti wrote: > On Thu, Nov 12, 2015 at 08:53:43PM +0900, Takuya Yoshikawa wrote: >> At some call sites of rmap_get_first() and rmap_get_next(), BUG_ON is >> placed right after the call to detect unrelated sptes which must not be >> found in the reverse-mapping list. >> >> Move this check in rmap_get_first/next() so that all call sites, not >> just the users of the for_each_rmap_spte() macro, will be checked the >> same way. In addition, change the BUG_ON to WARN_ON since killing the >> whole host is the last thing that KVM should try. > > It should be a BUG_ON, if KVM continues it will corrupt (more) memory. In the sense that we cannot predict what kind of corruption it will cause, I agree with you. But if it can only corrupt that guest's memory, it is a bit sad to kill unrelated guests, and host, too. Anyway, since we cannot say for sure what a possible bug can cause, I agree with you now. Thanks, Takuya -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/