From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 0E2922808E3 for ; Thu, 9 Mar 2017 16:58:02 -0500 (EST) Received: by mail-pf0-f198.google.com with SMTP id w189so130366092pfb.4 for ; Thu, 09 Mar 2017 13:58:02 -0800 (PST) Received: from aserp1040.oracle.com (aserp1040.oracle.com. [141.146.126.69]) by mx.google.com with ESMTPS id b1si905870pfa.254.2017.03.09.13.58.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 13:58:01 -0800 (PST) Subject: Re: [Xen-devel] [PATCH v5 2/3] x86: Remap GDT tables in the Fixmap section References: <20170306220348.79702-1-thgarnie@google.com> <20170306220348.79702-2-thgarnie@google.com> <17ffcc5b-1c9a-51b6-272a-5eaecf1bc0c4@citrix.com> From: Boris Ostrovsky Message-ID: <5cf31779-45c5-d37f-86bc-d5afb3fb7ab6@oracle.com> Date: Thu, 9 Mar 2017 16:56:33 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Thomas Garnier , Andy Lutomirski Cc: Andrew Cooper , Michal Hocko , Stanislaw Gruszka , "linux-doc@vger.kernel.org" , kvm list , Fenghua Yu , Matt Fleming , Frederic Weisbecker , X86 ML , Chris Wilson , "linux-mm@kvack.org" , Paul Gortmaker , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , "linux-efi@vger.kernel.org" , Alexander Potapenko , Pavel Machek , "H . Peter Anvin" , "kernel-hardening@lists.openwall.com" , Jiri Olsa , zijun_hu , Dave Hansen , Andi Kleen , "xen-devel@lists.xenproject.org" , Jonathan Corbet , Michael Ellerman , Joerg Roedel , Prarit Bhargava , kasan-dev , Vitaly Kuznetsov , Christian Borntraeger , Ingo Molnar , Andrey Ryabinin , Borislav Petkov , Len Brown , Rusty Russell , Kees Cook , Arnd Bergmann , He Chen , Brian Gerst , Jiri Kosina , lguest@lists.ozlabs.org, Andy Lutomirski , Josh Poimboeuf , Thomas Gleixner , Andrew Morton , Dmitry Vyukov , Juergen Gross , Peter Zijlstra , Lorenzo Stoakes , Ard Biesheuvel , "linux-pm@vger.kernel.org" , "Rafael J . Wysocki" , "linux-kernel@vger.kernel.org" , "Luis R . Rodriguez" , David Vrabel , Paolo Bonzini , Joonsoo Kim , Tim Chen On 03/09/2017 04:54 PM, Thomas Garnier wrote: > On Thu, Mar 9, 2017 at 1:46 PM, Andy Lutomirski wrote: >> On Thu, Mar 9, 2017 at 1:43 PM, Andrew Cooper wrote: >>> On 09/03/2017 21:32, Andy Lutomirski wrote: >>>> On Mon, Mar 6, 2017 at 2:03 PM, Thomas Garnier wrote: >>>> >>>>> --- a/arch/x86/xen/enlighten.c >>>>> +++ b/arch/x86/xen/enlighten.c >>>>> @@ -710,7 +710,7 @@ static void load_TLS_descriptor(struct thread_struct *t, >>>>> >>>>> *shadow = t->tls_array[i]; >>>>> >>>>> - gdt = get_cpu_gdt_table(cpu); >>>>> + gdt = get_cpu_gdt_rw(cpu); >>>>> maddr = arbitrary_virt_to_machine(&gdt[GDT_ENTRY_TLS_MIN+i]); >>>>> mc = __xen_mc_entry(0); >>>> Boris, is this right? I don't see why it wouldn't be, but Xen is special. >>> Under Xen PV, the GDT is already read-only at this point. (It is not >>> safe to let the guest have writeable access to system tables, so the >>> guest must relinquish write access to the frames wishing to be used as >>> LDTs or GDTs.) >>> >>> The hypercall acts on the frame, not a virtual address, so either alias >>> should be fine here. >>> >>> Under this new scheme, there will be two read-only aliases. I guess >>> this is easier to maintain the split consistently across Linux, than to >>> special case Xen PV because it doesn't need the second alias. >>> >> I think we would gain nothing at all by special-casing Xen PV -- Linux >> allocates the fixmap vaddrs at compile time, so we'd still allocate >> them even if we rejigger all the helpers to avoid using them. >> > I don't have any experience with Xen so it would be great if virtme can test it. I am pretty sure I tested this series at some point but I'll test it again. -boris > > I can remove the unused functions, I just thought they were useful > shortcuts given some of them are already used. > >> --Andy > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org