From patchwork Thu Mar 26 07:23:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 184839 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1531360ile; Thu, 26 Mar 2020 00:24:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtqu99hskg+QqMqPFsgCGBGE73Aq8hHf8+RmuXgENG3dXUmbpmtu+xqqHX81oTPmgDanLLS X-Received: by 2002:a37:b9c7:: with SMTP id j190mr6368517qkf.21.1585207463462; Thu, 26 Mar 2020 00:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585207463; cv=none; d=google.com; s=arc-20160816; b=VqIB/eBx23EPhpFbzfEtrTm27mcq43SHHggXNr4ii8oelWlHMlLWj5KVcCWm2zHyv5 t6KWHLCPVfJdmky1dUBgdutGHaI2jE0NwSLB9AqP8oPQLG+ipaC6Ga+hvjpQ3dYkNK5F ZdtMk+a0yDBBfmYruhcSz2Cv7NzmP6Z7xqyX07YmhLLUZXkeGLzw/zL/2LlzwXuyuJyz Mp2tcD8dxbhEgWatqfRofU8rb3O4G7ZZVqIJG6jOa+Au1dvlty6hjjwIy4ayL2Qqdkd4 nDXbNPH/sJYioEFGADlkSS3nLif3jH5KIEzmGcrg7WQTP4gVMvgkhvocH5t/rQFXJ2fx DmxA== 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=mCV/6oi7njnCoIzMHyWV2UoCZd8lSLJWcIDwV87Mbcc=; b=HgZDBfgtggFTEqymM25mUl2qv1hidXrBfRG1h3Cut72yZkVH5AA05I7vsQ2E4Y6D1T L/k1q77Z/BvrrTUKF9Eh2QW3hMSO4EQxV5nhDVBRwKheSJNPe4e+R0/I+ySS6sjEGzgA gxIzbd6OsJjEo4ssXi2BgZgBYHOU1RodcnG/gyGlQgqH+1pCWJ44Zmgqyp1zi+gvRFwz EWMN6Y/oOs6VLPNv4FHM67bNvm9URbQUCRl56JtdkD9GT5CeATlqe0QdwsQHzLE4vByn 04ooUfL5y8jDv2AsSwvdxzCIPA1VdwcJT/RHzPjgbfsOj01KE52Jmm8Xl0xAuWcxYblX cqXQ== 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 c23si50847qtd.89.2020.03.26.00.24.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 00:24:23 -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]:47480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHMsJ-0005O1-18 for patch@linaro.org; Thu, 26 Mar 2020 03:24:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHMs7-0005LZ-A6 for qemu-devel@nongnu.org; Thu, 26 Mar 2020 03:24:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHMs6-0007tK-9Z for qemu-devel@nongnu.org; Thu, 26 Mar 2020 03:24:11 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:42019) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jHMs6-0007sv-1D for qemu-devel@nongnu.org; Thu, 26 Mar 2020 03:24:10 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MHXSD-1j4SiM1ZFB-00DYn9; Thu, 26 Mar 2020 08:23:59 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 5/6] linux-user: Add x86_64 vsyscall page to /proc/self/maps Date: Thu, 26 Mar 2020 08:23:51 +0100 Message-Id: <20200326072352.2056553-6-laurent@vivier.eu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200326072352.2056553-1-laurent@vivier.eu> References: <20200326072352.2056553-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:N9BloZddGoEI8aaMOWZioelpXj+OrVHQl9zigrnZcP/MsKXmp2Q bfT24knouSbYlvmSXFeyzQ4IdT2X9DEIAmFSwwAAjYSUV4N12AGO1d2yo/IxzaK4mBTwgt8 I4cMOT6+rrHZex8D6hZypm72a8zfey21qHguss0uuZVSqXu6Khc7yP2dYtpMohlt2RRrlMI +5FLf2955LFmL5mpfLLcA== X-UI-Out-Filterresults: notjunk:1; V03:K0:ZYP8560LjSM=:msR9P5Q/I1q2yMQwfo8mtW Z+DydHO9oCRc2UOW9O/G8VTjHxN4mHq7c8I86RKuP8NfdV3IwNbtY46eiwways+Vj24M7o54H WNDKzJKfRuzdxZIdvtOGCXEu1P57zLbcBhsaEtZUOWnxTYpirEAlHT1BLxHC7/W6yrcdlOOIw F+4+KM4k1CTfVXB6Wkud11fdcewTrWc2qBo7I/CJTIYqHbkXKa70FHMqbZs0LrXDNzeC3fH4x eWi4A5P8L3hGgiOtfvTIJUvwzduxtNqQZOjZ6Vpy1VFqxe4udBTzhNonHaRPVgDQPGjY0hXfI 4AodIDG0N4u0j85Vy8+V0vHN3UkMWdTfZt1tPf5ceHoMoA2Tp6Zk7VvDT1846hPhQFnHo9839 oCgKEAFTua+RlULRH4iUey9EqPPTcc7spFLiCxsM2M3JRLeUjvYlrtLU/YLW3PB8aJ8iZIvHb yDAfmD0TRSJtAwa20/rxkOnsj/WOq+9sEwO+QEJC4xMYTjYOVqlEMNJYnXO+wYVWV7z+1R5kx ws6uDQk3ZVGcsjxmeQ/EaJievGBptens6B7c+qx9pyE2gFKEyb/E+2h0WKoNJLg2WOmgiPzJY dYb2QYgFWDpANeWEq4GRaQoG+BREia+FikLHDaYfVT/lTUAAhlrEX4VzHTKwF1fu19vJhLEzk QfOj/BLs0MdHU7nsYvvXiKyFEdK2YhsEi0Lh0tYYhNonVbxWKIeotW+gr8zmbYf1QUzS9AaJy ygEXiOicbUTdAVf4z4VcnYqjFNAjx+oODq3o58L42VpZPF1aIOoJIQkIIYfNnMb3NOFDIEufN C3pPUZNJDdf0jhzsMaW/UL070+0FnFlI70P9hn00DJuwZPbHg+cbftEV3TzCVYK826JBvCy X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.133 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 space] 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 35f414666243..dbdd56e42077 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7144,6 +7144,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);