* [PATCH 1/14] i386 / Make write ldt return error code
@ 2005-08-11 4:52 zach
2005-08-11 12:57 ` Chris Wright
2005-08-16 23:43 ` Andi Kleen
0 siblings, 2 replies; 6+ messages in thread
From: zach @ 2005-08-11 4:52 UTC (permalink / raw)
To: akpm, chrisl, chrisw, hpa, Keir.Fraser, linux-kernel,
m+Ian.Pratt, mbligh, pratap, virtualization, zach, zwame
Xen requires error returns from the hypercall to update LDT entries,
and this generates completely equivalent code on native.
Patch-base: 2.6.13-rc5-mm1
Patch-keys: i386 desc ldt paravirt xen
Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.13/include/asm-i386/mach-default/mach_desc.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/mach-default/mach_desc.h 2005-08-09 18:19:39.000000000 -0700
+++ linux-2.6.13/include/asm-i386/mach-default/mach_desc.h 2005-08-09 18:24:10.000000000 -0700
@@ -62,11 +62,12 @@
_set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82);
}
-static inline void write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b)
+static inline int write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b)
{
__u32 *lp = (__u32 *)((char *)ldt + entry*8);
*lp = entry_a;
*(lp+1) = entry_b;
+ return 0;
}
#if TLS_SIZE != 24
Index: linux-2.6.13/arch/i386/kernel/ldt.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/ldt.c 2005-08-09 18:19:37.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/ldt.c 2005-08-09 18:22:56.000000000 -0700
@@ -221,8 +221,7 @@
/* Install the new entry ... */
install:
- write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1, entry_2);
- error = 0;
+ error = write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1, entry_2);
out_unlock:
up(&mm->context.sem);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/14] i386 / Make write ldt return error code
2005-08-11 4:52 [PATCH 1/14] i386 / Make write ldt return error code zach
@ 2005-08-11 12:57 ` Chris Wright
2005-08-16 23:43 ` Andi Kleen
1 sibling, 0 replies; 6+ messages in thread
From: Chris Wright @ 2005-08-11 12:57 UTC (permalink / raw)
To: zach
Cc: akpm, chrisl, chrisw, hpa, Keir.Fraser, linux-kernel,
m+Ian.Pratt, mbligh, pratap, virtualization, zwame
* zach@vmware.com (zach@vmware.com) wrote:
> Xen requires error returns from the hypercall to update LDT entries,
> and this generates completely equivalent code on native.
The whole lot looks quite nice. I've sucked them into a git tree
with the full set until Andrew's back. If it's useful we can work
against that tree.
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/chrisw/virt-2.6
thanks,
-chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/14] i386 / Make write ldt return error code
2005-08-11 4:52 [PATCH 1/14] i386 / Make write ldt return error code zach
2005-08-11 12:57 ` Chris Wright
@ 2005-08-16 23:43 ` Andi Kleen
2005-08-17 0:06 ` Chris Wright
1 sibling, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2005-08-16 23:43 UTC (permalink / raw)
To: zach
Cc: akpm, chrisl, chrisw, hpa, Keir.Fraser, linux-kernel,
m+Ian.Pratt, mbligh, pratap, virtualization, zwame
On Wed, Aug 10, 2005 at 09:52:51PM -0700, zach@vmware.com wrote:
> Xen requires error returns from the hypercall to update LDT entries,
> and this generates completely equivalent code on native.
I don't think that is something we want. Nothing in the callers will check
the errors anyways. If Xen has such a requirement it should kill
the guest when it is violated, otherwise they will be ignored.
I would drop that one.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/14] i386 / Make write ldt return error code
2005-08-16 23:43 ` Andi Kleen
@ 2005-08-17 0:06 ` Chris Wright
2005-08-17 0:12 ` Andi Kleen
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wright @ 2005-08-17 0:06 UTC (permalink / raw)
To: Andi Kleen
Cc: zach, akpm, chrisl, chrisw, hpa, Keir.Fraser, linux-kernel,
m+Ian.Pratt, mbligh, pratap, virtualization, zwame
* Andi Kleen (ak@suse.de) wrote:
> On Wed, Aug 10, 2005 at 09:52:51PM -0700, zach@vmware.com wrote:
> > Xen requires error returns from the hypercall to update LDT entries,
> > and this generates completely equivalent code on native.
>
> I don't think that is something we want. Nothing in the callers will check
> the errors anyways. If Xen has such a requirement it should kill
> the guest when it is violated, otherwise they will be ignored.
In this case the callers do propagate the error (unless you mean
userspace doesn't check return value from syscall, which is same problem
if copy_from_user failed, for example). Xen has done some more wrapping
of the hypercalls to be effectively synchronous exceptions on error.
Keir, Ian, is that preferred method going forward?
thanks,
-chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/14] i386 / Make write ldt return error code
2005-08-17 0:06 ` Chris Wright
@ 2005-08-17 0:12 ` Andi Kleen
2005-08-17 0:22 ` Chris Wright
0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2005-08-17 0:12 UTC (permalink / raw)
To: Chris Wright
Cc: Andi Kleen, zach, akpm, chrisl, hpa, Keir.Fraser, linux-kernel,
m+Ian.Pratt, mbligh, pratap, virtualization, zwame
On Tue, Aug 16, 2005 at 05:06:18PM -0700, Chris Wright wrote:
> * Andi Kleen (ak@suse.de) wrote:
> > On Wed, Aug 10, 2005 at 09:52:51PM -0700, zach@vmware.com wrote:
> > > Xen requires error returns from the hypercall to update LDT entries,
> > > and this generates completely equivalent code on native.
> >
> > I don't think that is something we want. Nothing in the callers will check
> > the errors anyways. If Xen has such a requirement it should kill
> > the guest when it is violated, otherwise they will be ignored.
>
> In this case the callers do propagate the error (unless you mean
> userspace doesn't check return value from syscall, which is same problem
> if copy_from_user failed, for example). Xen has done some more wrapping
Nothing checks them in user space.
Also how would you handle them anyways? It just doesn't make sense.
-Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/14] i386 / Make write ldt return error code
2005-08-17 0:12 ` Andi Kleen
@ 2005-08-17 0:22 ` Chris Wright
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wright @ 2005-08-17 0:22 UTC (permalink / raw)
To: Andi Kleen
Cc: Chris Wright, zach, akpm, chrisl, hpa, Keir.Fraser, linux-kernel,
m+Ian.Pratt, mbligh, pratap, virtualization, zwame
* Andi Kleen (ak@suse.de) wrote:
> On Tue, Aug 16, 2005 at 05:06:18PM -0700, Chris Wright wrote:
> > In this case the callers do propagate the error (unless you mean
> > userspace doesn't check return value from syscall, which is same problem
> > if copy_from_user failed, for example). Xen has done some more wrapping
>
> Nothing checks them in user space.
>
> Also how would you handle them anyways? It just doesn't make sense.
Yes, I see your point, although copy_from_user failing has similar issue
if userspace isn't checking errors. But this one is not critical.
thanks,
-chris
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-08-17 0:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-11 4:52 [PATCH 1/14] i386 / Make write ldt return error code zach
2005-08-11 12:57 ` Chris Wright
2005-08-16 23:43 ` Andi Kleen
2005-08-17 0:06 ` Chris Wright
2005-08-17 0:12 ` Andi Kleen
2005-08-17 0:22 ` Chris Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®