From patchwork Thu Mar 19 09:26:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 184688 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1723083ile; Thu, 19 Mar 2020 02:27:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvevx0GlAXPD+zev6MsfT3GAxWECBTsAMAbSI7cMq5QO9VICBrfuQH1RzWrPOO0qke9vdBE X-Received: by 2002:a37:5907:: with SMTP id n7mr1957572qkb.227.1584610079315; Thu, 19 Mar 2020 02:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584610079; cv=none; d=google.com; s=arc-20160816; b=Hln9HkhwjTKm1u+2YvD9Uq8+BE7G/wemsfP1r1C4nuw5Go4fQmJNuN9cYXJTt5oTFN 8Tb/dH/17jhwwriGBlSs0oElPys6yOWXZ9Hw4FTWITMK7Y9/tx5In+BTZ2OMOrUovHyc OcfMeBgkn2wyLB/v+Xwcj8NhCYiCSx8k364vlfct61OwPMMAKcODwsrsYm6/yvxiBDM2 QHGBHUDzTjhFr7wevYdD9P0LyO3RDU3wJiwDgLKND9dQVviHb3ja1uROdfbLU0Fy6JCp QK6lV+Ou6SJVpWcQukUTVb68cvZiMeTCy9jRRLkEv3xNLeoysS4StdMEMDIway5g33/F rKhA== 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:references:in-reply-to:message-id:date:subject:to:from; bh=sBpnDqxru+s9MpUXr4dKG0QfltM7MVlV2/ENFhwXKvk=; b=jgxP4zuyr7eN9NovBQX4VALtKFoZK//m9hBiGdXTQK5OL6hD27sCT9rrq0Zc+E7dHh hh4bJ2uAycEaR9JZZHzBUw04DyYtw+dRfPUe6iM+AoLIPy4+DoRi49fQ1VlCyWSqxKmL V4uclbsJysj9RIevs56MY8BzkRo2kyUVvGQTdh4mGIZdPVPre2oUxTMQBNBlcbJSOPF+ B31hXBD4ja6UIT4+QNiV1izCsjI9iAoGhEv8RiNtt3TcD6CZQA/r0eAZ1bZtQmzYU5uc Ocxn0n1kAiO4qXVDJXJGS16ZiF6qdjTViNirHmSSUhIXJlZJWV6m5WJZaDjWd9ioJnfN oMpA== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t9si810032qvv.61.2020.03.19.02.27.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Mar 2020 02:27: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; 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" Received: from localhost ([::1]:35242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErT4-0008Go-OG for patch@linaro.org; Thu, 19 Mar 2020 05:27:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40786) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jErRn-0005Cr-Qu for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jErRm-0003zC-QF for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:39 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:41479) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jErRm-0003uH-Hi for qemu-devel@nongnu.org; Thu, 19 Mar 2020 05:26:38 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MzkK9-1jRyUF2MV7-00vghs; Thu, 19 Mar 2020 10:26:34 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v3 04/16] linux-user: Add x86_64 vsyscall page to /proc/self/maps Date: Thu, 19 Mar 2020 10:26:15 +0100 Message-Id: <20200319092627.51487-5-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200319092627.51487-1-laurent@vivier.eu> References: <20200319092627.51487-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Sgje0iFrVPMb2dQMJ0RAnWbHBX/NKwa72+1hEXPBC8ZRpsF/lQz JJLjCn6KXzrrmrh5Cko64vSzRlCqZOh0n0NAlkViYBO9kErl5adXYgAoyhBHFZbpi2ddG5r UFQNEjAWhrcFmg/V1Hw1jG6CAmAYO6ErR+h6N6HeE5ZnkbCeEAV7au4ZUo8ssbmTrSQe3V4 mgpK+5fhFMFCbr1bjd4Sg== X-UI-Out-Filterresults: notjunk:1; V03:K0:/yUYey2NAI0=:qu1ieyKu6NOSvSU4dgJKDo KTQjX48b3F19iNScHWMHer67nlD6XUTXzlLoow6Gx1F/3DvYr8pMcZ3cwQK8aiNmM0JIfXm1w 8CXA8/gvKPpDPc20Ti+voNvo0ip/02WFUKKwzhDshyk5nufBVYFF+RH4aQZMv/6mtJy5W2lvS hKCWC2w375FZW8HG2DbtzrYX5FUpkm8ieeu/Yt1rjkks1KFl+lMOCSfg5lyzbz/BG/rvtlaPQ 82nVaj7gAHfzCrlm6yDY/fEqxW3Mv0NSiNP24isrPV0nOTTZHuZLQJTdUzQRzIUltijTcT2Nd Wy/02PzXUWy9g1ChSqOB/iXJ7AFZnCIWdKjTL/M2gP40B/71lygWlS8sA5EUXmmZ00vJtDWnD 28Ppq/3zNbxmNxiGIfTLUx2MdBqlDim5vMP5G3OEfqOp6hAcWrRzCXpVtj5BTUiKfKAA2vdx/ RuQMMOoAOvPHzE8OsFMh8Q1CUYtlNEZstj1lpq9Xc4rowWViCHPloqRd2/C+ciAhtMd0DLWJx iZOBN6Syovhh8Ge1ZStv3FmtKU3YjLQtgWy9dUCNAo6CVVfLER6eguCc3KOjjcvZyEztcfc2V LwGUXm98U7aLBeXwevXcEOmGV6vCkfTxydOgpgMzKge8Ly1Ym5gmOzayPZnNGX5c8C7SmtMGQ pQ24SWP0q7Qpi6OecPiieJfWiSg7DIHKE6rQfHCVtXYcrE/Xjapty5j6QL0NmKk3ewj4I3VI9 g2hUxg6omzCrodLxCGwvjhuJk54wjtJF8hjS+mUWA5+PsVe2L5alBfU47DrseFJtZ9s53akN1 UB7KEjEEQFxNrY8Y9r+eYk9TucU1KKNDSC1Io71fcKiXwOB/rMBwOv4W3iZi8dsV2K/Evbn X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 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: Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The page isn't (necessarily) present in the host /proc/self/maps, and even if it might be it isn't present in page_flags, and even if it was it might not have the same set of page permissions. The easiest thing to do, particularly when it comes to the "[vsyscall]" note at the end of line, is to special case it. Signed-off-by: Richard Henderson Message-Id: <20200213032223.14643-5-richard.henderson@linaro.org> [lv: remove trailing whitespace] Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.25.1 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8d27d1080752..5479d67a10be 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7079,6 +7079,16 @@ static int open_self_maps(void *cpu_env, int fd) } } +#ifdef TARGET_VSYSCALL_PAGE + /* + * We only support execution from the vsyscall page. + * This is as if CONFIG_LEGACY_VSYSCALL_XONLY=y from v5.3. + */ + dprintf(fd, TARGET_FMT_lx "-" TARGET_FMT_lx + " --xp 00000000 00:00 0 [vsyscall]\n", + TARGET_VSYSCALL_PAGE, TARGET_VSYSCALL_PAGE + TARGET_PAGE_SIZE); +#endif + free(line); fclose(fp);