From owner-svn-src-head@freebsd.org Thu Sep 22 12:54:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7551ABE529E for ; Thu, 22 Sep 2016 12:54:46 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x230.google.com (mail-yb0-x230.google.com [IPv6:2607:f8b0:4002:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35571D24 for ; Thu, 22 Sep 2016 12:54:46 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x230.google.com with SMTP id u125so53273962ybg.3 for ; Thu, 22 Sep 2016 05:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aVPUbzXfqoC71fCgTZsteV/axYxhSJXMBmA6CV9YK+k=; b=Dl8JFci3dkCFQiaGwd8MOWNt7zrTGJzTsN5f0DYiIu1xbOMqgm1+gEZNP1F/+TNHa6 g0slRU3/e3fBHY3D7couMhkiD5/SnHabqypU2pnN+kpnYblNfOc3w82IY1Ye791bn5g+ 8acNsNcDAvYpX9MiOXqkv29MGJFWFnBVEzGYH/LFjXB5kMB/JJpRw796aYCL5sikSWG1 N74gBUCTRPwphRi1W6MeN6a8WDRr6Zuw2wJu+YkXYPN1wn7Px3qyeam45Q/pSEmL0Dlb XPIPJR+YxYMoJILQXkks4LSdGv/fjla3Q5/AVUEPEfFR5Vv1SoBMwFA5azRoRRJ77h+i ElWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aVPUbzXfqoC71fCgTZsteV/axYxhSJXMBmA6CV9YK+k=; b=Jvpo8GGnfgDVTDBuxpL0MTqeFrvn1Z04hRrJ149hPSSZwa6J7+huIXvAEkK+Rgy6as 2zbF5pwA6qQWDscKt0lJu3S8Oi6eJlkqxbNHqCrgc43sO9D4NSchII95y1sWjki3rg2y 383BWu5Ssmyl4gW6YZ3nkmDX0kwtaLHBo7/I7tGxytuq8xPWJ2xHY6IclvW4U2ippIZg 9n3qH7TsCNhvqalFzPPWK/KI2PQMGygsy0cCZgYl4/4vAtwk6SQpYKGkUfi6sUQCgoKf yDgvuj5Iz3ORdTfpBAE8DIxbYldEhb89LHurPJhlzXQgPmAicFFOVkexu7M+lhRhsCIG rkPg== X-Gm-Message-State: AE9vXwMe+OacVBGFw/lPyqhkY3fTU8LufmqB1ZM7MJuNG0N/F51ocAV76sBXZjPadjlFdBs1ug4c5GPsdrTeyg== X-Received: by 10.37.201.1 with SMTP id z1mr1269673ybf.70.1474548885399; Thu, 22 Sep 2016 05:54:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Thu, 22 Sep 2016 05:54:44 -0700 (PDT) In-Reply-To: <20160922092808.GR38409@kib.kiev.ua> References: <201609220815.u8M8F0Lo096297@repo.freebsd.org> <20160922092808.GR38409@kib.kiev.ua> From: Ed Schouten Date: Thu, 22 Sep 2016 14:54:44 +0200 Message-ID: Subject: Re: svn commit: r306162 - in head/sys/arm: arm include To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 12:54:46 -0000 Hi Kostik, 2016-09-22 11:28 GMT+02:00 Konstantin Belousov : > What do you mean about 'possibility to switch between TLS areas in > usermode' ? On x86, kernel switches %fs/%gs bases on the context > switches. There is, indeed, a way to turn off this functionality, but it > is somewhat unobvious, I have to admit. On x86 I've solved this by not letting apps have ownership over %fs/%gs. Instead, they simply assume that they point to some valid piece of memory. They can only use %fs:0. That way we now effectively have the ability to adjust TLS from userspace on all architectures freely. This feature is already used extensively by the userspace emulator, where you can run CloudABI executables on unmodified operating systems. You can even run an emulator inside of an emulator inside of an emulator. Not useful, but a good demonstration/test. Another thing this could be useful for is that it allows us to implement something like a simple truss(1) that doesn't depend on kernel-level tracing facilities, but merely captures system call invocations inside the process itself. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717