All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: will@kernel.org, julien.thierry.kdev@gmail.com, 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,
	andre.przywara@arm.com
Subject: [PATCH v4 kvmtool 06/12] arm/arm64: Kill the ARM_MAX_MEMORY() macro
Date: Thu, 16 Jun 2022 14:48:22 +0100	[thread overview]
Message-ID: <20220616134828.129006-7-alexandru.elisei@arm.com> (raw)
In-Reply-To: <20220616134828.129006-1-alexandru.elisei@arm.com>

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.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 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"
-- 
2.36.1

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: will@kernel.org, julien.thierry.kdev@gmail.com, 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,
	andre.przywara@arm.com
Subject: [PATCH v4 kvmtool 06/12] arm/arm64: Kill the ARM_MAX_MEMORY() macro
Date: Thu, 16 Jun 2022 14:48:22 +0100	[thread overview]
Message-ID: <20220616134828.129006-7-alexandru.elisei@arm.com> (raw)
In-Reply-To: <20220616134828.129006-1-alexandru.elisei@arm.com>

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.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 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"
-- 
2.36.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-06-16 13:48 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 13:48 [PATCH v4 kvmtool 00/12] arm64: Allow the user to set RAM base address Alexandru Elisei
2022-06-16 13:48 ` Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 01/12] Use MB for megabytes consistently Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 02/12] builtin-run: Always use RAM size in bytes Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 17:07   ` Andre Przywara
2022-06-16 17:07     ` Andre Przywara
2022-06-16 13:48 ` [PATCH v4 kvmtool 03/12] builtin-run: Rework RAM size validation Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 04/12] builtin-run: Add arch hook to validate VM configuration Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 17:07   ` Andre Przywara
2022-06-16 17:07     ` Andre Przywara
2022-06-16 13:48 ` [PATCH v4 kvmtool 05/12] arm/arm64: Fail if RAM size is too large for 32-bit guests Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 13:48 ` Alexandru Elisei [this message]
2022-06-16 13:48   ` [PATCH v4 kvmtool 06/12] arm/arm64: Kill the ARM_MAX_MEMORY() macro Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 07/12] arm/arm64: Kill the ARM_HIMAP_MAX_MEMORY() macro Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 08/12] builtin_run: Allow standard size specifiers for memory Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 17:10   ` Andre Przywara
2022-06-16 17:10     ` Andre Przywara
2022-06-16 13:48 ` [PATCH v4 kvmtool 09/12] kvm__arch_init: Remove hugetlbfs_path and ram_size as parameters Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 10/12] arm/arm64: Consolidate RAM initialization in kvm__init_ram() Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 11/12] Introduce kvm__arch_default_ram_address() Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-16 13:48 ` [PATCH v4 kvmtool 12/12] arm64: Allow the user to specify the RAM base address Alexandru Elisei
2022-06-16 13:48   ` Alexandru Elisei
2022-06-21 17:03 ` [PATCH v4 kvmtool 00/12] arm64: Allow the user to set " Suzuki K Poulose
2022-06-21 17:03   ` Suzuki K Poulose
2022-06-22  9:27   ` Alexandru Elisei
2022-06-22  9:27     ` Alexandru Elisei
2022-07-01 15:41 ` Will Deacon
2022-07-01 15:41   ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220616134828.129006-7-alexandru.elisei@arm.com \
    --to=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=julien@xen.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.