[kvm-unit-tests PATCH 3/3] x86: Increase per-CPU stack/data area to 12KiB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Increase the size of the per-CPU stack/data area from one page to three,
i.e. from 4KiB to 12KiB.  KVM-Unit-Tests currently places the per-CPU data
at the bottom of the stack page, i.e. the stack "page" is actually a page
minus the size of the per-CPU area.  And of course there's no guard page
or buffer in between the two, and so overflowing the stack clobbers per-CPU
data and sends tests into the weeds in weird ways.

Punt on less awful infrastructure, and settle for fixing the most egregious
problem of tests having less than 4KiB of stack to work with.

Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
 lib/x86/apic-defs.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/x86/apic-defs.h b/lib/x86/apic-defs.h
index fde1db38..5a1dff3a 100644
--- a/lib/x86/apic-defs.h
+++ b/lib/x86/apic-defs.h
@@ -3,10 +3,11 @@
 
 /*
  * Abuse this header file to hold the number of max-cpus and the size of the
- * per-CPU stack/data area, making them available both in C and ASM.
+ * per-CPU stack/data area, making them available both in C and ASM.  One page
+ * for per-CPU, and two pages for the stack (plus some buffer in-between).
  */
 #define MAX_TEST_CPUS (255)
-#define PER_CPU_SIZE  (4096)
+#define PER_CPU_SIZE  (3 * 4096)
 
 /*
  * Constants for various Intel APICs. (local APIC, IOAPIC, etc.)
-- 
2.48.1.601.g30ceb7b040-goog





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux