linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Vagin <avagin@gmail.com>
To: linux-arm-kernel@lists.infradead.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dmitry Safonov <dima@arista.com>, Andrei Vagin <avagin@gmail.com>
Subject: [PATCH RESEND v3 0/6] arm64: add the time namespace support
Date: Tue,  2 Jun 2020 11:02:53 -0700	[thread overview]
Message-ID: <20200602180259.76361-1-avagin@gmail.com> (raw)

Allocate the time namespace page among VVAR pages and add the logic
to handle faults on VVAR properly.

If a task belongs to a time namespace then the VVAR page which contains
the system wide VDSO data is replaced with a namespace specific page
which has the same layout as the VVAR page. That page has vdso_data->seq
set to 1 to enforce the slow path and vdso_data->clock_mode set to
VCLOCK_TIMENS to enforce the time namespace handling path.

The extra check in the case that vdso_data->seq is odd, e.g. a concurrent
update of the VDSO data is in progress, is not really affecting regular
tasks which are not part of a time namespace as the task is spin waiting
for the update to finish and vdso_data->seq to become even again.

If a time namespace task hits that code path, it invokes the corresponding
time getter function which retrieves the real VVAR page, reads host time
and then adds the offset for the requested clock which is stored in the
special VVAR page.

v2: Code cleanups suggested by Vincenzo.
v3: add a comment in __arch_get_timens_vdso_data.

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dmitry Safonov <dima@arista.com>

v3 on github (if someone prefers `git pull` to `git am`):
https://github.com/avagin/linux-task-diag/tree/arm64/timens-v3

Andrei Vagin (6):
  arm64/vdso: use the fault callback to map vvar pages
  arm64/vdso: Zap vvar pages when switching to a time namespace
  arm64/vdso: Add time napespace page
  arm64/vdso: Handle faults on timens page
  arm64/vdso: Restrict splitting VVAR VMA
  arm64: enable time namespace support

 arch/arm64/Kconfig                            |   1 +
 .../include/asm/vdso/compat_gettimeofday.h    |  11 ++
 arch/arm64/include/asm/vdso/gettimeofday.h    |   8 ++
 arch/arm64/kernel/vdso.c                      | 134 ++++++++++++++++--
 arch/arm64/kernel/vdso/vdso.lds.S             |   3 +-
 arch/arm64/kernel/vdso32/vdso.lds.S           |   3 +-
 include/vdso/datapage.h                       |   1 +
 7 files changed, 147 insertions(+), 14 deletions(-)

-- 
2.24.1


             reply	other threads:[~2020-06-02 18:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 18:02 Andrei Vagin [this message]
2020-06-02 18:02 ` [PATCH 1/6] arm64/vdso: use the fault callback to map vvar pages Andrei Vagin
2020-06-02 18:02 ` [PATCH 2/6] arm64/vdso: Zap vvar pages when switching to a time namespace Andrei Vagin
2020-06-02 18:02 ` [PATCH 3/6] arm64/vdso: Add time namespace page Andrei Vagin
2020-06-02 19:29   ` Dmitry Safonov
2020-06-02 22:04   ` kbuild test robot
2020-06-03  6:42   ` kbuild test robot
2020-06-05  7:45   ` [PATCH 3/6 v4] " Andrei Vagin
2020-06-02 18:02 ` [PATCH 4/6] arm64/vdso: Handle faults on timens page Andrei Vagin
2020-06-02 18:02 ` [PATCH 5/6] arm64/vdso: Restrict splitting VVAR VMA Andrei Vagin
2020-06-02 18:02 ` [PATCH 6/6] arm64: enable time namespace support Andrei Vagin
2020-06-02 19:31 ` [PATCH RESEND v3 0/6] arm64: add the " Dmitry Safonov
2020-06-05 10:49 ` Mark Rutland
2020-06-06  8:58   ` Andrei Vagin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200602180259.76361-1-avagin@gmail.com \
    --to=avagin@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=dima@arista.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=tglx@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).