From patchwork Fri Dec 9 01:52:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Upton X-Patchwork-Id: 13069140 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73A54C4167B for ; Fri, 9 Dec 2022 01:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZHD9rDGLaJUCjM7sIqNQPhVfs49SayPksb9wLqzQ9Yo=; b=2sB2c8QMQ2rvW/ 4K7Nloet7B1is0N4C7l+JNJ6dCmTDBX72tz+SC3eqHJR9yoEIxqx4PWksWOzewyOESfoG26tV1x5u fwndKhPwKTMqqh1x4gn+6pFSlApQEmI17gcrJo7KAZWg/ngH/L4NGNf8toC/fojS0Rm8SKKYFGJW4 2bsHwNE0E2QnFzzdT8G4CllsdFr+5134TRwtvu7RhFBew+jXG8D7KR8oimbv5TsAKAOxl0QTt8Fgr qdKH8SRO7Q4nZw5hAqvx9Q2aUjCA/ZLwF54FeXCHuSeVTCtDgDE3Xuo8MAaFBDNG4lOgVaNWH9430 7zG/MGAZin6tIPdHPZKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3SZz-000UTP-FD; Fri, 09 Dec 2022 01:53:35 +0000 Received: from out-136.mta0.migadu.com ([91.218.175.136]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3SZv-000UKQ-Jr for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 01:53:33 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier , James Morse , Alexandru Elisei Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kvmarm@lists.linux.dev, Ricardo Koller , Paolo Bonzini , Sean Christopherson , Oliver Upton Subject: [PATCH v2 0/7] KVM: selftests: Fixes for ucall pool + page_fault_test Date: Fri, 9 Dec 2022 01:52:59 +0000 Message-Id: <20221209015307.1781352-1-oliver.upton@linux.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221208_175331_829892_B2038CFD X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The combination of the pool-based ucall implementation + page_fault_test resulted in some 'fun' bugs. As has always been the case, KVM selftests is a house of cards. Small series to fix up the issues on kvm/queue. Patches 1-2 can probably be squashed into Paolo's merge resolution, if desired. Tested on Ampere Altra and a Skylake box, since there was a decent amount of munging in architecture-generic code. v1 -> v2: - Collect R-b from Sean (thanks!) - Use a common routine for split and contiguous VA spaces, with commentary on why arm64 is different since we all get to look at it now. (Sean) - Don't identity map the ucall MMIO hole - Fix an off-by-one issue in the accounting of virtual memory, discovered in fighting with #2 - Fix an infinite loop in ucall_alloc(), discovered fighting with the ucall_init() v. kvm_vm_elf_load() ordering issue Mark Brown (1): KVM: selftests: Fix build due to ucall_uninit() removal Oliver Upton (6): KVM: selftests: Setup ucall after loading program into guest memory KVM: selftests: Mark correct page as mapped in virt_map() KVM: selftests: Correctly initialize the VA space for TTBR0_EL1 KVM: arm64: selftests: Don't identity map the ucall MMIO hole KVM: selftests: Allocate ucall pool from MEM_REGION_DATA KVM: selftests: Avoid infinite loop if ucall_alloc() fails .../selftests/kvm/aarch64/page_fault_test.c | 9 +++- .../selftests/kvm/include/kvm_util_base.h | 1 + .../testing/selftests/kvm/lib/aarch64/ucall.c | 6 ++- tools/testing/selftests/kvm/lib/kvm_util.c | 53 ++++++++++++++++--- .../testing/selftests/kvm/lib/ucall_common.c | 14 +++-- 5 files changed, 68 insertions(+), 15 deletions(-) base-commit: 89b2395859651113375101bb07cd6340b1ba3637 Reviewed-by: Andrew Jones