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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44404C4332F for ; Fri, 7 Jan 2022 17:03:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348425AbiAGRDH (ORCPT ); Fri, 7 Jan 2022 12:03:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:20260 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348385AbiAGRDG (ORCPT ); Fri, 7 Jan 2022 12:03:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641574985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eOMl7Din8scPcX4i9u0nmf8/CJIoSqLDwGlSdjGTQSg=; b=QhZTwfF4KkqISjE5YnkZwli0nGcg82d5Rf/2KGzJWaLhuBzlux5+8HalUNL2VGXy5xBGu4 n+vfTfRu0AAVDYnovV1r5BUUy0eROAl32Urvydr3jHMtCQsjH8sm/W9p7yC1tlETzLmHMq UpCdD2GH7hNI9sN9mOHzw9BWJg/mPHk= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-259-0O4KSMD8P4OndBKUpREVjA-1; Fri, 07 Jan 2022 12:03:04 -0500 X-MC-Unique: 0O4KSMD8P4OndBKUpREVjA-1 Received: by mail-ed1-f70.google.com with SMTP id l14-20020aa7cace000000b003f7f8e1cbbdso5119231edt.20 for ; Fri, 07 Jan 2022 09:03:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=eOMl7Din8scPcX4i9u0nmf8/CJIoSqLDwGlSdjGTQSg=; b=SSSnKWGtBUzCKJHligz5iHuG1NVOL6DtMAqWmH9I5GzpWkCVSRSbHIYiqigBVM6K+t uiv3g4dliVJlqyjaHx0GN1sjCyIkDN58NgdNJODuwMmz4ewhtYhRtZPxzI+ctueiLz/t mEpHIJsqjcGROr5y97cgcfADJtn30ZT8P5wxvPFJeKsQd1szBRHInWhVWUq+JGaMbPnI veJ2giwC3g2fW5zod3TZrtxyRVive5oUv8qrPM2/NMeMwUmO9wyHOYVnAHPRAejgi7xE uWu/xHNIzeaoMeHDI3kNT1uYCf3LN9up/gJrDNDe14F4lMlhQ5FyLCCHwj+egyLi9TmV aiXg== X-Gm-Message-State: AOAM530rXnnzT6lUP4m1HyqUyM+zIHC5p76aku6Hy4FFqhIlu5fd1bi2 INb0RoK74zWspeaFohd2wqzmVIwO5BeAts1tGjL0HFM1t7laXFdGVVXkF8eMLw0zOl4wspHnh+l HTuvMmgnoZujplCAL84Ziqp4S X-Received: by 2002:a05:6402:35cc:: with SMTP id z12mr62033459edc.285.1641574983159; Fri, 07 Jan 2022 09:03:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFr7eF3bZsfEIhy3BEr7y+EXMk7etp5+RuYoUF63kUUZgZhCPb9+2w4VCnRkIWLMyXOYfHVA== X-Received: by 2002:a05:6402:35cc:: with SMTP id z12mr62033433edc.285.1641574982959; Fri, 07 Jan 2022 09:03:02 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id c19sm2322987ede.62.2022.01.07.09.03.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jan 2022 09:03:01 -0800 (PST) Message-ID: <19241e3d-f7eb-2b7f-046e-6a004a2225de@redhat.com> Date: Fri, 7 Jan 2022 18:03:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v2] KVM: x86: Check for rmaps allocation Content-Language: en-US To: Sean Christopherson , Peter Xu Cc: Nikunj A Dadhania , Vitaly Kuznetsov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, vasant.hegde@amd.com, brijesh.singh@amd.com References: <20220105040337.4234-1-nikunj@amd.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/7/22 18:01, Sean Christopherson wrote: > On Wed, Jan 05, 2022, Peter Xu wrote: >> On Wed, Jan 05, 2022 at 09:33:37AM +0530, Nikunj A Dadhania wrote: >>> With TDP MMU being the default now, access to mmu_rmaps_stat debugfs >>> file causes following oops: >>> >>> BUG: kernel NULL pointer dereference, address: 0000000000000000 >>> PGD 0 P4D 0 >>> Oops: 0000 [#1] PREEMPT SMP NOPTI >>> CPU: 7 PID: 3185 Comm: cat Not tainted 5.16.0-rc4+ #204 >>> RIP: 0010:pte_list_count+0x6/0x40 >>> Call Trace: >>> >>> ? kvm_mmu_rmaps_stat_show+0x15e/0x320 >>> seq_read_iter+0x126/0x4b0 >>> ? aa_file_perm+0x124/0x490 >>> seq_read+0xf5/0x140 >>> full_proxy_read+0x5c/0x80 >>> vfs_read+0x9f/0x1a0 >>> ksys_read+0x67/0xe0 >>> __x64_sys_read+0x19/0x20 >>> do_syscall_64+0x3b/0xc0 >>> entry_SYSCALL_64_after_hwframe+0x44/0xae >>> RIP: 0033:0x7fca6fc13912 >>> >>> Return early when rmaps are not present. >>> >>> Reported-by: Vasant Hegde >>> Tested-by: Vasant Hegde >>> Signed-off-by: Nikunj A Dadhania >>> --- > > Reviewed-by: Sean Christopherson > Queued, thanks. paolo