From patchwork Sat Jun 19 03:43:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 463849 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp532557jao; Fri, 18 Jun 2021 20:43:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6kXFB+nUDYgTdXnU7e8kcXKGrpsTu2g/sYQrEVFbvjrb9aygjMQ4C/vgCEXHmztYGdb2n X-Received: by 2002:a05:6902:4b2:: with SMTP id r18mr18414996ybs.446.1624074239733; Fri, 18 Jun 2021 20:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624074239; cv=none; d=google.com; s=arc-20160816; b=R3M7prP3wh4b9rjx16tYczAwdx8M9ZLipCcDBSrNy5E4X7MbsDzueVOeKaVBsGMgNL qFCSImw0fj5+KzNZ3785fkFTcK44DSfCZh5/2vWqxJwlYxqIuJg2L/e2B2OIIa3uogjG geOopVxKV/MYsksnI/8QV1Oua/NLw03a2IC/Ye8Gyu8m+7jjZHyYOJZBetTtrZHiHkGg 40CFntnvYQluWZC/fQF+aW4DGLbx3I6BydnV6aHy3USZC5C600PSRAaDQ4KDKyl+9YFr FFqLZqm3Y0GgFb9twI20lWBAO6ge+v8+33iUMW9Wm+/0475X5aV4ffuhDWdftl4DZ96H sjQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=9XGzMLM3vv6NxvkR/OUF5FXNULA4phEJC4Y6bmtF9U4=; b=BUeQyppqn9h35iMpjiswCRyGRsm8SD4r3GCYn4cjto+pSgKGu7LyD49aYciHPovgLj JEbnhhWI4QBA2FjROgF85cJFdciNawVGmTUT+OisdfNsyynPoT+SlhxvL0ivqkQTIeT8 quQU1Z4bTOVfwBBIyEdL7vztGV3Of9rso9JWdVvrnkasCsOy3KEWOYIitEcVQ6iwYlpl ldV0Jymsd9Bz8I9qPWdbFSJ3Hjd4yOgEIRqlaPjzy1fjj6eu0RBUzmFDaxHssjTvMAPB f/aF4hwHvwq3siXSDVpK5Wt5JAamrnaJA1C2Cd+9NnSHd3M1wDetQGYdiShCEzo0baO7 FJ+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Hm7VYj0e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y68si3859503ybc.497.2021.06.18.20.43.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jun 2021 20:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Hm7VYj0e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luRtn-00009N-3M for patch@linaro.org; Fri, 18 Jun 2021 23:43:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luRtT-00008A-6B for qemu-devel@nongnu.org; Fri, 18 Jun 2021 23:43:39 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:43768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luRtN-0007zy-Aj for qemu-devel@nongnu.org; Fri, 18 Jun 2021 23:43:38 -0400 Received: by mail-pf1-x430.google.com with SMTP id a127so9195607pfa.10 for ; Fri, 18 Jun 2021 20:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9XGzMLM3vv6NxvkR/OUF5FXNULA4phEJC4Y6bmtF9U4=; b=Hm7VYj0eo82i9aT+B9NoLIjprIIwKTm9/qH+XVtgK8GBnmRl0ne2T3gasjKmxJhvz4 kxSl0302G9umnuKOJ8XRvhAR+LcdiEmG/Ark+3gjzpLKcfkNwu7gzM4PnKpq0zSGaVSp V1JGGKXboAkfwU8e4xFtIWRCR9n3NPYm6qEJK5KU2+poSzsI9mQVVlYPC780nasSp+zh EpE7e7ltyb0ujrk1coQTgK66tO8l78X28XRIRKvSNSGHHGAxRpIRfNy3FJ87mGTNYBWS 71XWh0LM7IDqOBmzgB3J+fp0WQHa4yOoexo2NE+pe8xm4X7tm1RpNDKttaQBP2B7GCeS RMLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9XGzMLM3vv6NxvkR/OUF5FXNULA4phEJC4Y6bmtF9U4=; b=UggiKWLKY/ePxJSsKEbXuEw7nfnnxB7M8WvBkLiIB4hQwOBBSJJ3pFO3umePfbLEih mwA6ESG+PZmeX6H1R38pn7JhIofi35U2aeV9ZIcHaSmIr+RCExiumxrey2fgxvse3v3C kSAV9nwFs09L+4n7kqBDMLw3eqVWpnIv4KVzfxaUGO+E4Zcld1z5AheY5qKgySKkipVK zSzRlTOER7iY7nW4X2SkVlmFSyA4fJBTXVRU8yXTo3ycsVnoF0vye6pG1zOO0RoMVJd5 thqsRYZ8AYQIKjN2EsY3krc5sH3JueoQJhBwXXTuH6hfekoPoyRROfvbiSMcGcQMGXNw PmtA== X-Gm-Message-State: AOAM532yZMYjo+guTqJ/NQGndPFIbnXXV6Wxnzf9cl8tgU1PnCgLG6DI IA5rF74Sx/Fwe9iWezjfYJk0Dq4K/Qtt+w== X-Received: by 2002:aa7:9569:0:b029:2f8:2cf3:e9dd with SMTP id x9-20020aa795690000b02902f82cf3e9ddmr8635073pfq.10.1624074210716; Fri, 18 Jun 2021 20:43:30 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id z6sm10045154pgs.24.2021.06.18.20.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 20:43:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 00/12] linux-user: Load a vdso for x86_64 and hppa Date: Fri, 18 Jun 2021 20:43:17 -0700 Message-Id: <20210619034329.532318-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Supersedes: 20200519194452.9009-1-richard.henderson@linaro.org Based-on: 20210618192951.125651-1-richard.henderson@linaro.org ("[PATCH v2 00/23] linux-user: Move signal trampolines to new page") Previous cover letter: > The subject of AT_SYSINFO came up on launchpad recently. > > There is definite room for improvement in all of this: > > (1) We could build the vdso binary into qemu instead of really > loading it from the file system. This would obviate the > several problems of locating the .so file. It would also > mean that --static builds continue to create a standalone > qemu binary. > > (2) We could use our cross-build system to build the vdso. > Though we'd still likely want to keep the image in git > along side the other rom images for when cross-build is > not available. > > (3) There are some ??? comments where some decisions could be made, > and other ??? that are merely commenting on weirdness. > > (4) It shouldn't take too much effort to create vdsos for the > other architectures. But we should get this one as clean > as we can first. Amusingly, this patch set has turned 11 years old. First posted April 4, 2010. Change since previous: Point (1) has been addressed: the vdso binary pre-processed, validating the VDSO image, emitting a C array for the image, collecting the set of relocations required, and identifying any signal return trampolines. Point (2) is still an issue in that the cross-build system is tied up in tests/ makefiles. It might be time to bite the bullet and convert it all to meson. I think there are fewer ??? than before. r~ Richard Henderson (12): linux-user: Fix style problems in linuxload.c linux-user: Introduce imgsrc_read, imgsrc_read_alloc linux-user: Tidy loader_exec linux-user: Do not clobber bprm_buf swapping ehdr linux-user: Use ImageSource in load_elf_image linux-user: Use ImageSource in load_symbols linux-user: Replace bprm->fd with bprm->src.fd linux-user: Introduce imgsrc_mmap linux-user: Load vdso image if available linux-user: Add gen-vdso tool linux-user/x86_64: Add vdso linux-user/hppa: Add vdso and use it for rt_sigreturn linux-user/qemu.h | 60 ++++++- linux-user/elfload.c | 305 ++++++++++++++++++-------------- linux-user/flatload.c | 8 +- linux-user/gen-vdso.c | 168 ++++++++++++++++++ linux-user/hppa/signal.c | 8 +- linux-user/linuxload.c | 171 +++++++++++++----- linux-user/gen-vdso-elfn.c.inc | 299 +++++++++++++++++++++++++++++++ linux-user/hppa/Makefile.vdso | 4 + linux-user/hppa/meson.build | 6 + linux-user/hppa/vdso.S | 149 ++++++++++++++++ linux-user/hppa/vdso.ld | 75 ++++++++ linux-user/hppa/vdso.so | Bin 0 -> 5192 bytes linux-user/meson.build | 6 +- linux-user/x86_64/Makefile.vdso | 3 + linux-user/x86_64/meson.build | 6 + linux-user/x86_64/vdso.S | 122 +++++++++++++ linux-user/x86_64/vdso.ld | 74 ++++++++ linux-user/x86_64/vdso.so | Bin 0 -> 5912 bytes 18 files changed, 1272 insertions(+), 192 deletions(-) create mode 100644 linux-user/gen-vdso.c create mode 100644 linux-user/gen-vdso-elfn.c.inc create mode 100644 linux-user/hppa/Makefile.vdso create mode 100644 linux-user/hppa/vdso.S create mode 100644 linux-user/hppa/vdso.ld create mode 100755 linux-user/hppa/vdso.so create mode 100644 linux-user/x86_64/Makefile.vdso create mode 100644 linux-user/x86_64/vdso.S create mode 100644 linux-user/x86_64/vdso.ld create mode 100755 linux-user/x86_64/vdso.so -- 2.25.1