From patchwork Thu Apr 28 15:55:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Elisei X-Patchwork-Id: 12830982 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 DC154C433F5 for ; Thu, 28 Apr 2022 15:59:10 +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:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MlYxoFPu+eqrIz6BnEXMkMfxpFpGdt6DlzJZ57azXAw=; b=SJ5+CKPSiu0a8A /SkKxRUuA3cK5VFQZYSlyMoTfVmIxlIty5MzmTPa7nNkzzddibN6/ebGFvqCi8ynDNQ775DVncARx /EtHGN/Oks2PmNdTYe2t+S3c4oGCYbGZqGtlslOECykmOUOGLAt4f3q8Atd05fW76GOKdTiTPSOf+ NLFHNwBhuMRDfKXRfHC5TNmcBXssr6BV+qOEaeNOZiN4RZa0Y0pJtXyUJdimf6v9SMXi1VVVfVipS oTLCfSRrje30sJyM8PaKu6pyg+k04xDAzhsDbdu1rh1076YsDc5K7AuaPVNaVqUm0cePfyymp0O9w dSDBG+nTsbUTuKACZWFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nk6Wo-007l1E-Hq; Thu, 28 Apr 2022 15:58:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nk6V8-007kK7-Op for linux-arm-kernel@lists.infradead.org; Thu, 28 Apr 2022 15:56:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 657781477; Thu, 28 Apr 2022 08:56:18 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0438D3F774; Thu, 28 Apr 2022 08:56:16 -0700 (PDT) From: Alexandru Elisei To: julien.thierry.kdev@gmail.com, will@kernel.org, maz@kernel.org, suzuki.poulose@arm.com, julien@xen.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, james.morse@arm.com Subject: [PATCH kvmtool 07/15] arm/arm64: Kill the ARM_MAX_MEMORY() macro Date: Thu, 28 Apr 2022 16:55:54 +0100 Message-Id: <20220428155602.29445-8-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220428155602.29445-1-alexandru.elisei@arm.com> References: <20220428155602.29445-1-alexandru.elisei@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220428_085618_886598_514C763F X-CRM114-Status: UNSURE ( 8.13 ) 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 For 32-bit guests, the maximum memory size is represented by the define ARM_LOMAP_MAX_MEMORY, which ARM_MAX_MEMORY() returns. For 64-bit guests, the RAM size is checked against the maximum allowed by KVM in kvm__get_vm_type(). There are no users left for the ARM_MAX_MEMORY() macro, remove it. Signed-off-by: Alexandru Elisei --- arm/aarch32/include/kvm/kvm-arch.h | 2 -- arm/aarch64/include/kvm/kvm-arch.h | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/arm/aarch32/include/kvm/kvm-arch.h b/arm/aarch32/include/kvm/kvm-arch.h index 5616b27e257e..467fb09175b8 100644 --- a/arm/aarch32/include/kvm/kvm-arch.h +++ b/arm/aarch32/include/kvm/kvm-arch.h @@ -8,8 +8,6 @@ struct kvm; static inline void kvm__arch_enable_mte(struct kvm *kvm) {} -#define ARM_MAX_MEMORY(...) ARM_LOMAP_MAX_MEMORY - #define MAX_PAGE_SIZE SZ_4K #include "arm-common/kvm-arch.h" diff --git a/arm/aarch64/include/kvm/kvm-arch.h b/arm/aarch64/include/kvm/kvm-arch.h index 9124f6919d0f..ff857ca6e7b4 100644 --- a/arm/aarch64/include/kvm/kvm-arch.h +++ b/arm/aarch64/include/kvm/kvm-arch.h @@ -8,22 +8,6 @@ unsigned long long kvm__arch_get_kern_offset(struct kvm *kvm, int fd); int kvm__arch_get_ipa_limit(struct kvm *kvm); void kvm__arch_enable_mte(struct kvm *kvm); -#define ARM_MAX_MEMORY(kvm) ({ \ - u64 max_ram; \ - \ - if ((kvm)->cfg.arch.aarch32_guest) { \ - max_ram = ARM_LOMAP_MAX_MEMORY; \ - } else { \ - int ipabits = kvm__arch_get_ipa_limit(kvm); \ - if (ipabits <= 0) \ - max_ram = ARM_HIMAP_MAX_MEMORY; \ - else \ - max_ram = (1ULL << ipabits) - ARM_MEMORY_AREA; \ - } \ - \ - max_ram; \ -}) - #define MAX_PAGE_SIZE SZ_64K #include "arm-common/kvm-arch.h"