From patchwork Mon Dec 27 15:01:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 528274 Delivered-To: patch@linaro.org Received: by 2002:ac0:b243:0:0:0:0:0 with SMTP id s3csp2224849imc; Mon, 27 Dec 2021 07:02:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMulCYdJTJ9I0mheOXCb/uS6P0w0oXnBRWXuHUFLXMbFCMWhfbHKQZobvIFYsOg2Xw8eiZ X-Received: by 2002:a05:6122:8ca:: with SMTP id 10mr5231911vkg.11.1640617373067; Mon, 27 Dec 2021 07:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640617373; cv=none; d=google.com; s=arc-20160816; b=ZwWavMpeWlKt1YH+A0LQ0bPNTh9yAH2lN2/ce/8YkDGh4r1HbY7Aqk6iULPV7OP+/V ol3lDaoQibPYa5TMak2wHp/+tfonWO9owzkJVyqqwyQfn7+/xVcxa8D4vBdt+0gC6rAJ cNcvN3VM4oWPM9eIUWMvy1Cl6bjfEdRMxJmKCJDBQk0c+VelPE2TAVeDtRKgpiD8Qykx tOlmKGRmS1/an+JYigJZ/xPwTGDISK0gfSVd/PH3WSSsWpadtA/r8R4qTbjl0b+lxYJN pRhE4ez9sj17PQx9bnDoFXLU2eBiz7lU0e2AS0TGqsf1UD0L7mAKHijuiquMfWjHjYv6 RD3w== 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=wDu91BB9NQDcOjL3wsvEpspth618U8RiGW+GYPNUoNY=; b=ZNAHeuENB68LJPoFXE/k1nen6dU+/2PKsyaRQ54/fr0nDO4joWeVXdE7bX73pA/aw/ AHL9wSSEk9Tyz8FaTj3JbbU9bEQYqmG9sqXO/MhnSeYNiLSdAJL/gnqAfXt7BIDU+P17 apoNFWOP5JVHYl2i3cfSp7tY4AAhfjs1/Eg//k4LRJ9LCUKj7z7XM48cKw/P5UGSIv0h BTYt9Lr3IbLdb5AwyVbTx07ycuU25jej6SWTKnnGXV9fI4EibMzmb7MC6gtX14674Tce NUWJQh8KO9ybqXkt2I2TYjtyCZZMoqv6bCoiERACQ/AXUsXOrzYwlGOFfK1oWm7iDVU7 MbnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JWHM+q5+; 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 h7si983075vsf.785.2021.12.27.07.02.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Dec 2021 07:02:53 -0800 (PST) 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=JWHM+q5+; 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]:51390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1rWV-0005kz-Hl for patch@linaro.org; Mon, 27 Dec 2021 10:02:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1rVF-0005fj-1U for qemu-devel@nongnu.org; Mon, 27 Dec 2021 10:01:33 -0500 Received: from [2607:f8b0:4864:20::102c] (port=46877 helo=mail-pj1-x102c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1rVC-0000jw-O2 for qemu-devel@nongnu.org; Mon, 27 Dec 2021 10:01:32 -0500 Received: by mail-pj1-x102c.google.com with SMTP id rj2-20020a17090b3e8200b001b1944bad25so14518978pjb.5 for ; Mon, 27 Dec 2021 07:01:29 -0800 (PST) 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=wDu91BB9NQDcOjL3wsvEpspth618U8RiGW+GYPNUoNY=; b=JWHM+q5+zHmSOp1fETBf7FQRgIkX8moQbzZPdg+kHm+zd8jlywlvw3UxKMIOsZBDTT Yjm0xDcnRw3T5XpimMD1jA276NId4jJ9FxwXdk/8lAhdQqBjpcJvWQ6IxaaFlYqQwSV/ kI0/nnNl3h0PqNVEDGFSGHPaUBXS9REQ63JkR+Li4iKecjMD9GM5jCGvfk06ZAMO7kHB FIcGDCCXtZtZOlqDYPw8MlIky8ZUrpf91TDfv56/OFZKaLqPE8JXWQpve63VEYuxZacc NBZK+PrQ77BuN8mAEqxRHO8ESVFLmUWdh8Qb5zODLZXdeJx9g2ouHuvIWLlcGV76DnU3 Tfng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wDu91BB9NQDcOjL3wsvEpspth618U8RiGW+GYPNUoNY=; b=41vcLpK/d4qUh5pMMWBMpAv/DFMe4FrtjPo5abnxbssfEkQosbfyYFJgnlZumyS1bM V+3VYCZq+18psSidQBvu3xmbwQTKpIJBjsN0XAobhBjNC4sXNnJa25JCZyvC5YcchO/j 1KO9/ajqLSPYO3Q6No4x8tL/1PqwfGQA5YlaaukdkDrfyklkcRprt3eSoTS1DePyd/YE k1DteRrw+N5dKyCbboE8hZlEePp0NABCBYS7ch13audRckUULf4bVUI3PYOHo3FRpL/9 ikBS3tlh/6Ksu2IZYZ5tDijF3RnB9twZcqoLUcOEyPTsn73ii+I2k4kIVmbx3M6UrDZu yAAQ== X-Gm-Message-State: AOAM531hJ+WEfUXoVxEYqtDvz90kxj9Vljrur2ni0/xA13st06nhuXhb K5li8tA4XOCw+vx/Ad1Ccv6Y5TH2fL0O0A== X-Received: by 2002:a17:902:7d8f:b0:149:52a3:2ebe with SMTP id a15-20020a1709027d8f00b0014952a32ebemr17228030plm.140.1640617288260; Mon, 27 Dec 2021 07:01:28 -0800 (PST) Received: from localhost.localdomain (76-14-210-194.or.wavecable.com. [76.14.210.194]) by smtp.gmail.com with ESMTPSA id m13sm14756743pgt.22.2021.12.27.07.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Dec 2021 07:01:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 0/6] linux-user: prctl improvements Date: Mon, 27 Dec 2021 07:01:21 -0800 Message-Id: <20211227150127.2659293-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is split out from a larger patch set for unaligned accesses. The changes in target/ have no effect without the changes in tcg/, but this allows the syscall to be handled separately. Changes for v2: * Added LOG_UNIMP to the default case. * Use MO_ALIGN instead of 0 for target/sh. r~ Richard Henderson (6): linux-user: Split out do_prctl and subroutines linux-user: Disable more prctl subcodes linux-user: Add code for PR_GET/SET_UNALIGN target/alpha: Implement prctl_unalign_sigbus target/hppa: Implement prctl_unalign_sigbus target/sh4: Implement prctl_unalign_sigbus include/hw/core/cpu.h | 3 + linux-user/aarch64/target_prctl.h | 160 +++++++ linux-user/aarch64/target_syscall.h | 23 - linux-user/alpha/target_prctl.h | 1 + linux-user/arm/target_prctl.h | 1 + linux-user/cris/target_prctl.h | 1 + linux-user/generic/target_prctl_unalign.h | 27 ++ linux-user/hexagon/target_prctl.h | 1 + linux-user/hppa/target_prctl.h | 1 + linux-user/i386/target_prctl.h | 1 + linux-user/m68k/target_prctl.h | 1 + linux-user/microblaze/target_prctl.h | 1 + linux-user/mips/target_prctl.h | 88 ++++ linux-user/mips/target_syscall.h | 6 - linux-user/mips64/target_prctl.h | 1 + linux-user/mips64/target_syscall.h | 6 - linux-user/nios2/target_prctl.h | 1 + linux-user/openrisc/target_prctl.h | 1 + linux-user/ppc/target_prctl.h | 1 + linux-user/riscv/target_prctl.h | 1 + linux-user/s390x/target_prctl.h | 1 + linux-user/sh4/target_prctl.h | 1 + linux-user/sparc/target_prctl.h | 1 + linux-user/x86_64/target_prctl.h | 1 + linux-user/xtensa/target_prctl.h | 1 + target/alpha/cpu.h | 5 + target/hppa/cpu.h | 5 +- target/sh4/cpu.h | 4 + cpu.c | 20 +- linux-user/syscall.c | 494 +++++++++------------- target/alpha/translate.c | 31 +- target/hppa/translate.c | 19 +- target/sh4/translate.c | 50 ++- 33 files changed, 604 insertions(+), 355 deletions(-) create mode 100644 linux-user/aarch64/target_prctl.h create mode 100644 linux-user/alpha/target_prctl.h create mode 100644 linux-user/arm/target_prctl.h create mode 100644 linux-user/cris/target_prctl.h create mode 100644 linux-user/generic/target_prctl_unalign.h create mode 100644 linux-user/hexagon/target_prctl.h create mode 100644 linux-user/hppa/target_prctl.h create mode 100644 linux-user/i386/target_prctl.h create mode 100644 linux-user/m68k/target_prctl.h create mode 100644 linux-user/microblaze/target_prctl.h create mode 100644 linux-user/mips/target_prctl.h create mode 100644 linux-user/mips64/target_prctl.h create mode 100644 linux-user/nios2/target_prctl.h create mode 100644 linux-user/openrisc/target_prctl.h create mode 100644 linux-user/ppc/target_prctl.h create mode 100644 linux-user/riscv/target_prctl.h create mode 100644 linux-user/s390x/target_prctl.h create mode 100644 linux-user/sh4/target_prctl.h create mode 100644 linux-user/sparc/target_prctl.h create mode 100644 linux-user/x86_64/target_prctl.h create mode 100644 linux-user/xtensa/target_prctl.h