From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2D21C83028 for ; Thu, 2 Sep 2021 17:12:01 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A005F61074 for ; Thu, 2 Sep 2021 17:12:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A005F61074 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.177593.323124 (Exim 4.92) (envelope-from ) id 1mLqFf-0008PQ-HE; Thu, 02 Sep 2021 17:11:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 177593.323124; Thu, 02 Sep 2021 17:11:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mLqFf-0008PJ-E7; Thu, 02 Sep 2021 17:11:47 +0000 Received: by outflank-mailman (input) for mailman id 177593; Thu, 02 Sep 2021 17:11:46 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mLqFe-0008PD-SV for xen-devel@lists.xenproject.org; Thu, 02 Sep 2021 17:11:46 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mLqFe-0001Mu-Rg for xen-devel@lists.xenproject.org; Thu, 02 Sep 2021 17:11:46 +0000 Received: from iwj (helo=mariner.uk.xensource.com) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1mLqFe-0000MA-Qq for xen-devel@lists.xenproject.org; Thu, 02 Sep 2021 17:11:46 +0000 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.89) (envelope-from ) id 1mLqFT-0003Zb-3Q; Thu, 02 Sep 2021 18:11:35 +0100 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=References:In-Reply-To:Subject:Cc:To:Date :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:From; bh=GeXJrQDQtclWxuJyi9dryyESGh+JES5AlryXjtCzhwo=; b=fVot05xTOOmNdteLjWY4uKKlm0 8/Z6R/YFBUpdHdO18Cqd0KgA3lT12aevbOHftQsqJnw1PumWNigvx5ArAOzInL2u7UjFKNnZWG5Jf uAXlw004OWjPvZ4I1hLLjPwu6+d6bLLVKhI9QLfz4yPYVXTfmz5droqlPBcoGzPponUY=; From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <24881.1478.795535.377133@mariner.uk.xensource.com> Date: Thu, 2 Sep 2021 18:11:34 +0100 To: Jan Beulich Cc: Andrew Cooper , Wei Liu , Roger Pau =?iso-8859-1?Q?Monn=E9?= , Juergen Gross , George Dunlap , "xen-devel\@lists.xenproject.org" Subject: Re: [PATCH 03/12] libxenguest: short-circuit "all-dirty" handling In-Reply-To: References: <912fa390-f9e9-198a-9aee-39fdb9a28fcc@suse.com> <55875a26-7f1d-a6d9-9384-b03b3b2cb86d@suse.com> <60be051f-7751-f15d-ae4d-2c7e9af82693@citrix.com> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) Jan Beulich writes ("Re: [PATCH 03/12] libxenguest: short-circuit "all-dirty" handling"): > On 25.06.2021 19:02, Andrew Cooper wrote: > > Single all-dirty runs are a debugging technique only.  All production > > cases are live, and you don't want to fail midway through because a > > late, large, memory allocation failed. > > I'm afraid I don't understand: I don't move _when_ the allocation > occurs; I only suppress the allocation (altogether) when the allocated > memory remains unused. Thanks for this reply, Jan. I hope it is satisfactory to Andrew; if not, I hope Andrew will be able to explain. I am going to give this a provisional Acked-by: Ian Jackson I may of course withdraw that ack if it is explained to me that this is patch is wrong. > >> + : (void *)-1L; > > > > This is a pointer loaded with a timebomb, which doesn't trigger NULL > > pointer checks, and for which {set,clear}_bit(dirty_bitmap, large_pfn) > > won't fault and will instead corrupt random areas of the address space. > > Yeah, this isn't very nice, and gets done away with again in a later > patch. I'd prefer to keep it like it is (assuming the later change > will also go in), but if really deemed necessary I can move that code > re-arrangement here, such that the use of (void *)-1L wouldn't be > necessary anymore. (You may have noticed that all I did this for is > to be able to pass the !dirty_bitmap later in the function, and that > I deliberately only update the local variable, not the hbuf, making > pretty certain that this pointer isn't going to be de-referenced.) I agree that this -1L is very unpleasant. I'm not going to say that you need to restructure your series, but please make sure you don't commit this patch without the fix. Thanks, Ian.