# HG changeset patch
# Parent 27518b7c51b5e522d3b259fa0bc2c2e7f35ecdf6
---
 arch/x86/lguest/boot.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -379,13 +379,17 @@ static void lguest_write_gdt_entry(struc
  */
 static void lguest_load_tls(struct thread_struct *t, unsigned int cpu)
 {
+	unsigned int i;
+
 	/*
 	 * There's one problem which normal hardware doesn't have: the Host
 	 * can't handle us removing entries we're currently using.  So we clear
 	 * the GS register here: if it's needed it'll be reloaded anyway.
 	 */
 	lazy_load_gs(0);
-	lazy_hcall2(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu);
+	for (i = 0; i <= GDT_ENTRY_TLS_ENTRIES; i++)
+		lazy_hcall3(LHCALL_LOAD_GDT_ENTRY, GDT_ENTRY_TLS_MIN + i,
+			    t->tls_array[i].a, t->tls_array[i].b);
 }
 
 /*G:038
