Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3001795ybi; Mon, 17 Jun 2019 14:25:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxhqlvEgckD2f/K3GvoAItfiRuP53oEEL7TFOKusWR0SSmwWWOPp3rWwjwM4PQj31YRHDk X-Received: by 2002:a62:750c:: with SMTP id q12mr96570697pfc.59.1560806747807; Mon, 17 Jun 2019 14:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560806747; cv=none; d=google.com; s=arc-20160816; b=IIfDiQKtrg5W0AZw3dJk7OE9VUYTKzCnMrWscCEHTVq23zd4b3zG6S9i0ihCH1SaxM +pcl0bbThcPgLvjr2nbaEtteufEsnvR0Id7n6ajdE0Jznwcs71Je53arsd9AJ9PyUwzk OXgxNa47liCeoRZHkrcLhYjGly5hByGHZ5M9Ciw4w+VWlQgWZVsOeO9ZIgE5Jn30GsVM XN9UOcOnLdcah+bP9oDn9pYpB+0pqV6AhR1O9rrKUJjZPK7NQHHlhilnH4cYFQt0MNwJ 0QRUmY3G89bTerqY4cenN9V7LIkTLG4EeLu4L0Iki4l1ogt3/gu+MSVuk3DTJBYz3w30 ihug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WUd+NqCskgO7m1EbwbfaqUzsEJvsUrvMR6OUCJ5N7R0=; b=gFBSPOHIMCuo9qzQLVo37nAKmc+/qyBV+uw+Xea4sB8sKTLUY4XHqxyt4wSHEwQ4v/ qjD+XjFOs95JghVGanGnhVjy08rrpT1DG09GrPf/qVctZuCu7rHCfEN9OEhIsHcYIlkb xL93+iI74jma+rNJrSlo3SWJVVm1VZ5lgBbwUN7sHvdq+cAQrOYAnT1Sq/wrfV+3X0QZ ROzwdFM4bcV7PoE4Ml5oJMB9DMx1Oi1l8SSzzjWNcdqi8rIsKIhSEMVrkzLEqRgmUbXw AXld/5wowNmPEe1nz0h1qM+fY6mV75tqN5gYUTfOLpJilllXNzRCrTnQWb4zBNd+GSjO kJWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="SEuc7RN/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i123si11795679pfc.60.2019.06.17.14.25.32; Mon, 17 Jun 2019 14:25:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b="SEuc7RN/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727903AbfFQVXq (ORCPT + 99 others); Mon, 17 Jun 2019 17:23:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:49010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729407AbfFQVXo (ORCPT ); Mon, 17 Jun 2019 17:23:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 32148206B7; Mon, 17 Jun 2019 21:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806623; bh=yFz7mf582VIah1G03076oUHRNaFg2u1aaFc2TEYEWfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SEuc7RN/NYG9m/56xR8lGD6YL0zOC7EeyoILy3e3K9+ZsGH6+6JoBeH6NV4SJh/2p 1vdxOm5iLTd4x0l9bh2GJhvWSFbEUVbAMQ/kff5xKak/9SEAC/ZsMWzD9diTGC4PwO 42AYIOZAZkf+Sxj6beiCKmE2NgyW7GYrxTGn5Jl8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Jones , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.1 092/115] kvm: selftests: aarch64: dirty_log_test: fix unaligned memslot size Date: Mon, 17 Jun 2019 23:09:52 +0200 Message-Id: <20190617210804.625344902@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210759.929316339@linuxfoundation.org> References: <20190617210759.929316339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit bffed38d4fb536c5d5d6c37846a7fb8fde1452fa ] The memory slot size must be aligned to the host's page size. When testing a guest with a 4k page size on a host with a 64k page size, then 3 guest pages are not host page size aligned. Since we just need a nearly arbitrary number of extra pages to ensure the memslot is not aligned to a 64 host-page boundary for this test, then we can use 16, as that's 64k aligned, but not 64 * 64k aligned. Fixes: 76d58e0f07ec ("KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size", 2019-04-17) Signed-off-by: Andrew Jones Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- tools/testing/selftests/kvm/dirty_log_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c index 93f99c6b7d79..a2542ed42819 100644 --- a/tools/testing/selftests/kvm/dirty_log_test.c +++ b/tools/testing/selftests/kvm/dirty_log_test.c @@ -292,7 +292,7 @@ static void run_test(enum vm_guest_mode mode, unsigned long iterations, * A little more than 1G of guest page sized pages. Cover the * case where the size is not aligned to 64 pages. */ - guest_num_pages = (1ul << (30 - guest_page_shift)) + 3; + guest_num_pages = (1ul << (30 - guest_page_shift)) + 16; host_page_size = getpagesize(); host_num_pages = (guest_num_pages * guest_page_size) / host_page_size + !!((guest_num_pages * guest_page_size) % host_page_size); -- 2.20.1