kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, peterx@redhat.com
Subject: [kvm-unit-tests PATCH v4 3/5] x86: move USERBASE to 32Mb in smap/pku/pks tests
Date: Fri, 25 Jul 2025 11:54:27 +0200	[thread overview]
Message-ID: <20250725095429.1691734-4-imammedo@redhat.com> (raw)
In-Reply-To: <20250725095429.1691734-1-imammedo@redhat.com>

If number of CPUs is increased up to 2048, it will push
available pages above 16Mb range and make smap/pku/pks
tests fail with 'Could not reserve memory' error.

Move pages used by tests to 32Mb to fix it.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 x86/pks.c  | 2 +-
 x86/pku.c  | 2 +-
 x86/smap.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/x86/pks.c b/x86/pks.c
index f4d6ac83..9b9519ba 100644
--- a/x86/pks.c
+++ b/x86/pks.c
@@ -6,7 +6,7 @@
 #include "x86/msr.h"
 
 #define PTE_PKEY_BIT     59
-#define SUPER_BASE        (1 << 23)
+#define SUPER_BASE        (2 << 24)
 #define SUPER_VAR(v)      (*((__typeof__(&(v))) (((unsigned long)&v) + SUPER_BASE)))
 
 volatile int pf_count = 0;
diff --git a/x86/pku.c b/x86/pku.c
index 6c0d72cc..544c6f24 100644
--- a/x86/pku.c
+++ b/x86/pku.c
@@ -6,7 +6,7 @@
 #include "x86/msr.h"
 
 #define PTE_PKEY_BIT     59
-#define USER_BASE        (1 << 23)
+#define USER_BASE        (2 << 24)
 #define USER_VAR(v)      (*((__typeof__(&(v))) (((unsigned long)&v) + USER_BASE)))
 
 volatile int pf_count = 0;
diff --git a/x86/smap.c b/x86/smap.c
index 9a823a55..53c9f4ce 100644
--- a/x86/smap.c
+++ b/x86/smap.c
@@ -45,7 +45,7 @@ asm ("pf_tss:\n"
         "jmp pf_tss\n\t");
 
 
-#define USER_BASE	(1 << 23)
+#define USER_BASE	(2 << 24)
 #define USER_VAR(v)	(*((__typeof__(&(v))) (((unsigned long)&v) + USER_BASE)))
 #define USER_ADDR(v)   ((void *)((unsigned long)(&v) + USER_BASE))
 
-- 
2.47.1


  parent reply	other threads:[~2025-07-25  9:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25  9:54 [kvm-unit-tests PATCH v4 0/5] x86: add HPET counter tests Igor Mammedov
2025-07-25  9:54 ` [kvm-unit-tests PATCH v4 1/5] x86: resize id_map[] elements to u32 Igor Mammedov
2025-07-30 20:39   ` Peter Xu
2025-07-25  9:54 ` [kvm-unit-tests PATCH v4 2/5] x86: fix APs with APIC ID more that 255 not showing in id_map Igor Mammedov
2025-07-30 20:40   ` Peter Xu
2025-07-25  9:54 ` Igor Mammedov [this message]
2025-07-30 20:56   ` [kvm-unit-tests PATCH v4 3/5] x86: move USERBASE to 32Mb in smap/pku/pks tests Peter Xu
2025-07-31  8:58     ` Igor Mammedov
2025-07-25  9:54 ` [kvm-unit-tests PATCH v4 4/5] x86: bump number of max cpus to 1024 Igor Mammedov
2025-07-30 20:56   ` Peter Xu
2025-07-25  9:54 ` [kvm-unit-tests PATCH v4 5/5] x86: add HPET counter read micro benchmark and enable/disable torture tests Igor Mammedov
2025-07-30 21:00   ` Peter Xu

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=20250725095429.1691734-4-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).