From patchwork Fri Jun 1 15:06:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10443719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1339C603D7 for ; Fri, 1 Jun 2018 15:22:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 034EB28C3C for ; Fri, 1 Jun 2018 15:22:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC09328C8A; Fri, 1 Jun 2018 15:21:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8EE1F28C6B for ; Fri, 1 Jun 2018 15:21:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=wFNHTSLuqhChlpoPmnDWn2BicfCF/vG7/ubF0VfwxWA=; b=hJ+ 8Sh3bcKLrjMkru3BSICj9CNrOd01giFzhqiqI6UfRM2v3SI+4QxSiYl+aXVzj2B1tDZ1fHgYf9w+y 3EvIyP5Yeh2rb/fYm/kivUACytlKhN7vtmluLXO2Ug4Xp/ImhwTkeW8S427vWDCiPH0UGBFJXp1KE BvZ11OUrmVXA7I1yQExAJJaDabmQ7PDFnghb1I8A5cwYrtaMihXuc5rWh9UPklBGIWA0bor+Yfs4w EFpdpkd4sz046DvM+VBBD0npR04r36PJ3iAPs815zEG+uRLWjhAJKlBCbozRtMf+1cCcJnAFJVADk D2UAp22GgBo6ROo6CXG4AgoroyInuRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOlsD-0007Qo-Pb; Fri, 01 Jun 2018 15:21:49 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fOldi-0007iQ-Pg for linux-arm-kernel@lists.infradead.org; Fri, 01 Jun 2018 15:07:02 +0000 Received: by mail-wm0-x244.google.com with SMTP id z6-v6so5702947wma.0 for ; Fri, 01 Jun 2018 08:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=oxhxFrShjlIJ565U1cb0jfZdwG3svrQaG2xKkli2G+c=; b=FKB+PEt2Rv67eH4x1RqNjFg2pq65zXJ45E/4K7+ZJ5atV4tO7ZuXBi7lizguTvAUiK i8jqdzAjaOfKE9QVmIacufd7CmjtRatjod1UwsRghgpZ7QKnAzr9D58YWyXQMwcb1eTB GRZmIbR/x9TqnlO4cv+MJhOCcXmsCMl+EjLGU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oxhxFrShjlIJ565U1cb0jfZdwG3svrQaG2xKkli2G+c=; b=Sbmge14vi700tIbHjU5Nu/7nwapDMw8OkgoPI7LBL3qYm/TmnC/ioCt9kHdzEo22Kn kNkeQIMTrjyP1/sSW26ryZVgcZNpsvMGNOWAMN0d1HYiF2I/OcMIFaJro3NZKP6GoZiL CobLVmGH21pmsTf2sh7qu+Sj1tqq8/0ovwItGbLqcpUWdAgCK4ens4oze6PNQminVLxH kKGVVNgvgt1F5AeBS6DqKEIPjz2+PkgLOYb9QWlz/ulSVBHqWZ3vGKp5NOQN4hi5tsuD rmkaLndZeWqZUtObmlDQU+kqrFIRwbJ+WvRhrUDT+X8w0H+cbP52WlnVWUJBHH1Y1CiY gymA== X-Gm-Message-State: APt69E1BvKJGkPC3hVkUI93MBK2CB4D4Bs/+D+2BoTgmv+9tY3XwTrYD v0okfI7xSkycSSSL3ZjJgO2jbw== X-Google-Smtp-Source: ADUXVKK+bAe4q28rkUzcsQKlfW9HWVXnOn5uvSx8EkhMuUSHjo6mNDwjcxdsv3xL1V/uYFjLNbYETg== X-Received: by 2002:a1c:a906:: with SMTP id s6-v6mr2777197wme.116.1527865598070; Fri, 01 Jun 2018 08:06:38 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id z14-v6sm1537166wma.11.2018.06.01.08.06.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jun 2018 08:06:37 -0700 (PDT) From: Ard Biesheuvel To: kvmarm@lists.cs.columbia.edu Subject: [PATCH] KVM: arm/arm64: drop resource size check for GICV window Date: Fri, 1 Jun 2018 17:06:28 +0200 Message-Id: <20180601150628.10111-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180601_080650_887086_79535992 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.zyngier@arm.com, christoffer.dall@arm.com, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When booting a 64 KB pages kernel on a ACPI GICv3 system that implements support for v2 emulation, the following warning is produced GICV size 0x2000 not a multiple of page size 0x10000 and support for v2 emulation is disabled, preventing GICv2 VMs from being able to run on such hosts. The reason is that vgic_v3_probe() performs a sanity check on the size of the window (it should be a multiple of the page size), while the ACPI MADT parsing code hardcodes the size of the window to 8 KB. This makes sense, considering that ACPI does not bother to describe the size in the first place, under the assumption that platforms implementing ACPI will follow the architecture and not put anything else in the same 64 KB window. So let's just drop the sanity check altogether, and assume that the window is at least 64 KB in size. Fixes: 909777324588 ("KVM: arm/arm64: vgic-new: vgic_init: implement kvm_vgic_hyp_init") Signed-off-by: Ard Biesheuvel --- virt/kvm/arm/vgic/vgic-v3.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c index bdcf8e7a6161..72fc688c3e9d 100644 --- a/virt/kvm/arm/vgic/vgic-v3.c +++ b/virt/kvm/arm/vgic/vgic-v3.c @@ -552,11 +552,6 @@ int vgic_v3_probe(const struct gic_kvm_info *info) pr_warn("GICV physical address 0x%llx not page aligned\n", (unsigned long long)info->vcpu.start); kvm_vgic_global_state.vcpu_base = 0; - } else if (!PAGE_ALIGNED(resource_size(&info->vcpu))) { - pr_warn("GICV size 0x%llx not a multiple of page size 0x%lx\n", - (unsigned long long)resource_size(&info->vcpu), - PAGE_SIZE); - kvm_vgic_global_state.vcpu_base = 0; } else { kvm_vgic_global_state.vcpu_base = info->vcpu.start; kvm_vgic_global_state.can_emulate_gicv2 = true;