From patchwork Wed May 27 10:05:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 187223 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp974728ilb; Wed, 27 May 2020 03:06:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ7bZom0UkhY2dQ2pAmgPTVvFe45fLOPQkrYZV6hwG+hyXLf3vGGP1jYJpHXF1QojeLm0L X-Received: by 2002:a25:c509:: with SMTP id v9mr8426669ybe.263.1590573965515; Wed, 27 May 2020 03:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590573965; cv=none; d=google.com; s=arc-20160816; b=UIlesqQzAAKFxYBojuMqLXTITRPy1LE6FeyANRPBVgYLnXPiHYbDmHmSf4qEfa2UMc L3wABzoVzr5PYTaI5mFCkTXp/Bc/9r9rKvfq8Gl5tYClogSrF6/crj6yMHxr7UgwbUIK 2pzkaDZLD7hwBjIEOn1oAy4MP2tTuJUm/4OTLc6g+Ud72b/1eSOjKjdFrrMl1emSmDgL SnlsCViLzmrcw1Welb644ZtCfoJJz2oIVdHxDvu9K4pFw6XT/5oA8UOMGV9WBslFkvAF 485nn8tU3u093SmG14cVv1Q5IPyUC00JbjMDr4BLnMIdOt5UPWZNtEMzxytLT442d3G2 puXw== 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=B3rPEoB6RauZKehNk3gMFSktGnuLNDT1B/nk8E7cQyg=; b=GhBb2KoQEM7QkrwXBBKNh3zkpWIRvhsbprZnP0DgbTJlrXBE+GbxKm2izX3X0r/36b 7jfjhyEXcHV862uhkI5D3wqmc3YmUdheJTCzj09VjqHZ0rSwQh8oTdNNqGf1AaV2Di6s YJokarNUPO286wZsPxIvHNyT+0dlq8eSnnWyJvA91eDSSWQ0z+r8Yt99WuPr5pSyJ7k4 uqZw2VM5c740FiAWnneGusHM0a4p8uvJFW1V+ke6UuM/+Y0BFELs/cDp250pVU5Kgy/d fqG96KZ9R3nj26y4GCMNMsLXlvgRtwOaaVBHcJ/oNdhLGGWsXsQqAyK8H9U9YMgmEkNO eEMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fs1iPgcY; 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=pass (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 s9si2923631ybk.211.2020.05.27.03.06.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 May 2020 03:06:05 -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=pass header.i=@linaro.org header.s=google header.b=Fs1iPgcY; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdswn-0003PW-2a for patch@linaro.org; Wed, 27 May 2020 06:06:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdswa-0003P9-1G for qemu-devel@nongnu.org; Wed, 27 May 2020 06:05:52 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:32850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdswZ-0005BW-2V for qemu-devel@nongnu.org; Wed, 27 May 2020 06:05:51 -0400 Received: by mail-wr1-x444.google.com with SMTP id l11so23456246wru.0 for ; Wed, 27 May 2020 03:05:50 -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=B3rPEoB6RauZKehNk3gMFSktGnuLNDT1B/nk8E7cQyg=; b=Fs1iPgcY6pPLzn1zW2eMBAH88sNN+hYetqkgMAHUKCRMvY1QV30AkWwsBGTV4845Uy FTHzIG3fTrCjrzoxXY/dZlUuPZ95M8htUKACgMfjP/37YS8fykasclJONkDmPRqBduB+ fE0h/R+c7Eeky8dKQj9+j1zHpnQlN1FGH1zLTLlrWSMdsFlsczt5lJeQzsa/KbzlTVIB 6oI5Dh1Yo/vMHvrP7ozurq2aqMokJM3R8WDWqe6HYDqEL2wq21poV69sCN+gkG4bwEFl lOJS6PvLEg/R6Sljr4xyVQndmM8zHEOQYnU/2+lHHQqMX4iNDWSwf+/H1HPtzBuinAdi OanA== 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=B3rPEoB6RauZKehNk3gMFSktGnuLNDT1B/nk8E7cQyg=; b=rI65g4AHNIBNCaFxAGNvT9eK5vI1tZh9RjAQxjvNDTwQJJdTwEX0ntUiFmv9ESc6k7 8GI1AEoJ10qRZ9s7hwP+lFZz99WBlLCR2+T/IMab2gfVEet5cKEX58BSJdf9Czb7WVMf Nuh+XX605Ti1Nhg6M1YtSs1ulpHYyA08zF1vMRZGZjgA4dnbn5AcLnDmjYH8VTJkxET9 0XlerHuxqGAj1rz7+jfEFe0TJ8c6AGzUU7SpQkM+HFmj6d56d/h8SjuOR83sQ9JrNIOP jHexcVN9RwvVhePjJF9o1nDluw+72+kZHChYZkA7XufhrhAR4YzYC4FrPGXiM05OTtwv vNew== X-Gm-Message-State: AOAM531p9FX058R7gUEt2TUdzxFLskEDf/Y3dkBmxFvI4p5ZH8bMZkBu 54+7dsAgTbltzX57UOsUqOB0Ww== X-Received: by 2002:adf:eb47:: with SMTP id u7mr23972224wrn.14.1590573949080; Wed, 27 May 2020 03:05:49 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l17sm2331662wmi.16.2020.05.27.03.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 03:05:47 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B47851FF7E; Wed, 27 May 2020 11:05:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 0/3] some linux-user guest_base fixes Date: Wed, 27 May 2020 11:05:43 +0100 Message-Id: <20200527100546.29297-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hi, Here are a couple of patches to clean-up guest_base handling for linux-user guests. There are two cases we hadn't accounted for/tested enough in the original clean-up: - chroots without /proc access - 32 bit hosts and the 32 bit ARM COMMPAGE The solution to the first problem is a simple fall-back to mmap probing but without the ugliness of the first approach. The second is a bit of a hack but works. Given we only ever expose one value from the COMMPAGE it does make me wonder if we could rip out the special casing and come up with a cleaner ARM only approach by hooking exceptions? Anyway I've included a test case for the COMMPAGE as well. Please review Alex Bennée (3): linux-user: provide fallback pgd_find_hole for bare chroots linux-user: deal with address wrap for ARM_COMMPAGE on 32 bit tests/tcg: add simple commpage test case linux-user/elfload.c | 66 ++++++++++++++++++++++++++++++----- tests/tcg/arm/commpage.c | 61 ++++++++++++++++++++++++++++++++ tests/tcg/arm/Makefile.target | 2 ++ 3 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 tests/tcg/arm/commpage.c -- 2.20.1