Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp636631rwn; Thu, 8 Sep 2022 06:52:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6A869HJ2p5yKFtct/YPR0VwpnaAHnxsaI3jWpWTtzbrgfnipsPWLZCPTnz4+Vn8SfuGa3B X-Received: by 2002:a05:6402:cbb:b0:44f:1203:acf2 with SMTP id cn27-20020a0564020cbb00b0044f1203acf2mr6750739edb.236.1662645143016; Thu, 08 Sep 2022 06:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662645143; cv=none; d=google.com; s=arc-20160816; b=rFj15Mubd+HXoBmn3+Q93TGBns6+U6Y7eDszMuMOjMECItZEoLAlVS4BMc9mGNVV7b ZdCXW2Gswcvr1lXm1zuIPLhP0qRapC5AI16Y/0LB4KetTUff35w5cKLA9LkFPc/2DVc9 ldoOox7JqrXX8TNQ7oiTZ40syzo1MWe/GQBqp1FfRncIlgyxbyPuM2BiHi2hUiKpdhXB oE/0s4eKiPjUzxR2Q16qLE+a5PvrkDyMbFWsho9M46dmmnEJfX099YIWUUd1x3vyghzg 9fhkFz0yr34Jei0K5nFbGSZu7i9AWBOJADy53cZHWW6XTG1o7Ya2R7+lmB6UiANrr809 0u/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ELSMYYP/nR/ktReRlieiAqLr0L+oviVOUAJA39LDAI8=; b=0UA60TayijCTz4seDMSq7uEo3BovA03VnBbwshcXC7u/RUSKJ96Ms4pRP5PwF9fzlD m1SGHG3xce33Aamiac9aiz4/U939chjQjOqLwzAvh9L0mKCdZo6o7j7WUsr96ZHbWSHS GIl3jcRfluiiWtNfjEb5q6hrk+jQ0qhVaZfKgwSDcjECGtbEU1KngitN3kyBhW2B+iWh qAMX8GZX9mk/qXUQhQDXxbPbDAuRNkq2kj0pMqf/Bl12+NIQ+kfGst8UKQUbZjJ8mJY4 OyZx8+ua9UdvsvINf74OTf/TMy4Kjl9M7fGiIibjm0cCR6TzXyhsXJ3uz3KxY4udq4J8 cH4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t32-20020a056402242000b0044e723e8ca9si9805030eda.183.2022.09.08.06.51.57; Thu, 08 Sep 2022 06:52:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbiIHN3a (ORCPT + 99 others); Thu, 8 Sep 2022 09:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231135AbiIHN3F (ORCPT ); Thu, 8 Sep 2022 09:29:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEBF3127542 for ; Thu, 8 Sep 2022 06:29:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE25561CE6 for ; Thu, 8 Sep 2022 13:29:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CCA9C433D6; Thu, 8 Sep 2022 13:28:58 +0000 (UTC) Date: Thu, 8 Sep 2022 14:28:55 +0100 From: Catalin Marinas To: Zenghui Yu Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maz@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, will@kernel.org, wanghaibin.wang@huawei.com Subject: Re: [PATCH] KVM: arm64: Use kmemleak_free_part_phys() to unregister hyp_mem_base Message-ID: References: <20220908130659.2021-1-yuzenghui@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220908130659.2021-1-yuzenghui@huawei.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 08, 2022 at 09:06:59PM +0800, Zenghui Yu wrote: > With commit 0c24e061196c ("mm: kmemleak: add rbtree and store physical > address for objects allocated with PA"), kmemleak started to put the > objects allocated with physical address onto object_phys_tree_root tree. > The kmemleak_free_part() therefore no longer worked as expected on > physically allocated objects (hyp_mem_base in this case) as it attempted to > search and remove things in object_tree_root tree. > > Fix it by using kmemleak_free_part_phys() to unregister hyp_mem_base. This > fixes an immediate crash when booting a KVM host in protected mode with > kmemleak enabled. > > Signed-off-by: Zenghui Yu Acked-by: Catalin Marinas