Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4047387ybl; Mon, 26 Aug 2019 04:47:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8PEO1C6qc9q4Xv3MuRLS0LNbW40Yx1GpttuhU4dgnjbO6ow9DKVv+e9EzlUjvcqLXbywv X-Received: by 2002:aa7:93aa:: with SMTP id x10mr20014275pff.83.1566820058205; Mon, 26 Aug 2019 04:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566820058; cv=none; d=google.com; s=arc-20160816; b=tNIRzVUc0q0KzSC7X16BPe5ssZQ83V2TDuiVdMpiJ33wh0WbBCe7TWKp4UdqJZTK4i bY3TOMa83OoGlQmIXV+hwLQOS+Gj8SMG5+FzErzPV/R/pFHGr/o/KVcTGRM4mKgwxXS5 tPSwQLU3rB1F258QjCUk8xJymoH0ZDDGeUqXP3FXgVghryHpVSwX+nqXgUHjTROhd+45 6hNij9DfKvC3wjQW1oKVU15gc1l9gJJN6R0gcfelDifPEyMsisggc2eK8XMeDKPedO+G k6NLWomd+Q0m2RVaBn9wUZT0mNXP8mikxAMkOaPF9FLnL7UGbEzvhGEiATlqzJmqOMpT 3FEw== 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=xi5x79hFcxVshjNra8X/6yxiKOk5j429Zw+E71UlIRs=; b=RxCPqxtkboeDfL5ZW/8/Fvw0vHE5o6NIehxJt9u/45O6FvsrZbQbRQyiDkok8U63Wr 89SQWMg6Or4WPylxdiRtr+Y6jTJBz+p0aHMbaKhACwAso5/80hnJfE26X5dK5zji94fk 5i7meNFwIhx8gPQr6fjy1u9umiUHjxmHjYS+Dn6LvPvZnBB9SebSXMWkVZPlbhj+dbEM ffHeokX9Q4l9sm/rdMj6/88RU1Lh3RaflyqMyRrxgDmz8eAWF7DYarYOQTKLvNb5X68V rI/cwdQOWW3WKLtAefPHGTa5VHRV2beEF5CyKikkW2mxSJ0+/pqpkZklBSJ6cvL9XJ7r D8Pw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si9255892pjs.13.2019.08.26.04.47.22; Mon, 26 Aug 2019 04:47:38 -0700 (PDT) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731188AbfHZLjT (ORCPT + 99 others); Mon, 26 Aug 2019 07:39:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59258 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727095AbfHZLjT (ORCPT ); Mon, 26 Aug 2019 07:39:19 -0400 Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63ADD4E832 for ; Mon, 26 Aug 2019 11:39:18 +0000 (UTC) Received: by mail-pg1-f199.google.com with SMTP id 141so9608037pgh.12 for ; Mon, 26 Aug 2019 04:39:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xi5x79hFcxVshjNra8X/6yxiKOk5j429Zw+E71UlIRs=; b=tOqENtjpKd9xRw53oJ88vPCEjj0t8FJm0At2+QR4wE5D6gGuNAM/6GWshHVrCOGvVK t0XbR8niO4P5lAek8QNEVVeakXJ3z2JuQGnFNkdDLj2s4GDdnS4xCk+DgjQm9gxTZMtr EjSKctqbp5KrBDfw8ZPlGz2NGTg0biYlyUoCyilFiwSZjFL1Y9kuySqKJHoJjT3BEPiz x3a7v2fouTGhmRwpYfmA9YpUsiK6Y8UzSnUDG0B/itvZM1TlC55Bee2HfLDyRRXRSjDb WuwTE7UmN4smMbwJGZMNg2IR01Aqq0rOdtghIk5KSoR9AJZhXA0H/ZnUJQgBk+gMFSe3 oKCA== X-Gm-Message-State: APjAAAUYUbPLx87IT5GtsscZWlXOArZSIobkZ5+wusp3dgyDyd7mnRPj 0B5DABV4NSAe6S1XOixHoYERLHgAPOe3xWWoeT/xHXPlbkcWebJD5kbCYGST0S/hmPYU/9kLexa SZ5ZiaJlfYbfLghVcCr7MqUTZ X-Received: by 2002:a65:5003:: with SMTP id f3mr2180990pgo.335.1566819557537; Mon, 26 Aug 2019 04:39:17 -0700 (PDT) X-Received: by 2002:a65:5003:: with SMTP id f3mr2180971pgo.335.1566819557254; Mon, 26 Aug 2019 04:39:17 -0700 (PDT) Received: from xz-x1 ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id o4sm35214817pje.28.2019.08.26.04.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 04:39:16 -0700 (PDT) Date: Mon, 26 Aug 2019 19:39:06 +0800 From: Peter Xu To: Vitaly Kuznetsov Cc: Paolo Bonzini , Andrew Jones , Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Huth , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH] KVM: selftests: Detect max PA width from cpuid Message-ID: <20190826113906.GF1785@xz-x1> References: <20190826075728.21646-1-peterx@redhat.com> <874l24nxik.fsf@vitty.brq.redhat.com> <20190826104757.GD1785@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190826104757.GD1785@xz-x1> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 26, 2019 at 06:47:57PM +0800, Peter Xu wrote: > On Mon, Aug 26, 2019 at 10:25:55AM +0200, Vitaly Kuznetsov wrote: > > Peter Xu writes: > > > > > The dirty_log_test is failing on some old machines like Xeon E3-1220 > > > with tripple faults when writting to the tracked memory region: > > > > s,writting,writing, > > > > > > > > Test iterations: 32, interval: 10 (ms) > > > Testing guest mode: PA-bits:52, VA-bits:48, 4K pages > > > guest physical test memory offset: 0x7fbffef000 > > > ==== Test Assertion Failure ==== > > > dirty_log_test.c:138: false > > > pid=6137 tid=6139 - Success > > > 1 0x0000000000401ca1: vcpu_worker at dirty_log_test.c:138 > > > 2 0x00007f3dd9e392dd: ?? ??:0 > > > 3 0x00007f3dd9b6a132: ?? ??:0 > > > Invalid guest sync status: exit_reason=SHUTDOWN > > > > > > > This patch breaks on my AMD machine with > > > > # cpuid -1 -l 0x80000008 > > CPU: > > Physical Address and Linear Address Size (0x80000008/eax): > > maximum physical address bits = 0x30 (48) > > maximum linear (virtual) address bits = 0x30 (48) > > maximum guest physical address bits = 0x0 (0) > > > > > > Pre-patch: > > > > # ./dirty_log_test > > Test iterations: 32, interval: 10 (ms) > > Testing guest mode: PA-bits:52, VA-bits:48, 4K pages > > guest physical test memory offset: 0x7fbffef000 > > Dirtied 139264 pages > > Total bits checked: dirty (135251), clear (7991709), track_next (29789) > > > > Post-patch: > > > > # ./dirty_log_test > > Test iterations: 32, interval: 10 (ms) > > Testing guest mode: PA-bits:52, VA-bits:48, 4K pages > > Supported guest physical address width: 48 > > guest physical test memory offset: 0xffffbffef000 > > ==== Test Assertion Failure ==== > > dirty_log_test.c:141: false > > pid=77983 tid=77985 - Success > > 1 0x0000000000401d12: vcpu_worker at dirty_log_test.c:138 > > 2 0x00007f636374358d: ?? ??:0 > > 3 0x00007f63636726a2: ?? ??:0 > > Invalid guest sync status: exit_reason=SHUTDOWN > > Vitaly, > > Are you using shadow paging? If so, could you try NPT=off? Sorry, it should be s/shadow paging/NPT/... [root@hp-dl385g10-10 peter]# ./dirty_log_test Test iterations: 32, interval: 10 (ms) Testing guest mode: PA-bits:52, VA-bits:48, 4K pages Supported guest physical address width: 48 guest physical test memory offset: 0xffffbffef000 ==== Test Assertion Failure ==== dirty_log_test.c:138: false pid=5433 tid=5436 - Success 1 0x0000000000401cc1: vcpu_worker at dirty_log_test.c:138 2 0x00007f18977992dd: ?? ??:0 3 0x00007f18974ca132: ?? ??:0 Invalid guest sync status: exit_reason=SHUTDOWN [root@hp-dl385g10-10 peter]# modprobe -r kvm_amd [root@hp-dl385g10-10 peter]# modprobe kvm_amd npt=0 [root@hp-dl385g10-10 peter]# ./dirty_log_test Test iterations: 32, interval: 10 (ms) Testing guest mode: PA-bits:52, VA-bits:48, 4K pages Supported guest physical address width: 48 guest physical test memory offset: 0xffffbffef000 Dirtied 102400 pages Total bits checked: dirty (99021), clear (8027939), track_next (23425) > > I finally found a AMD host and I also found that it's passing with > shadow MMU mode which is strange. If so I would suspect it's a real > bug in AMD NTP path but I'd like to see whether it's also happening on > your side. > > Thanks, -- Peter Xu