From patchwork Wed Sep 28 08:15:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 610085 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp148398pvb; Wed, 28 Sep 2022 02:56:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ekO//DP0rVjB1d069Ph6E6/OCDmA5K/irSsEZTTepXv9hDTlbZUJfwOA5dKSTYl7U7Ofk X-Received: by 2002:a05:622a:92:b0:35d:58bc:4a4a with SMTP id o18-20020a05622a009200b0035d58bc4a4amr468890qtw.391.1664358964540; Wed, 28 Sep 2022 02:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664358964; cv=none; d=google.com; s=arc-20160816; b=PeHYlz5QzP+kf/q7WptI7Ru41a7wzJD0QH7xJ/DHGj220S4DrR+2UjmGC8jbvalE3e JLZulhQnrIB91LfM6UDvRwFlMcOfLduuQkhTbDspThuPAOnt3VPR2wYM0nO623fRtGyJ KsTkQOYqj1XQ09wz0cf+rA/kF8Zo6TSEogjPvPnexd0htd1eXL012WknFj8Uc52ZiekK 2goAvgdplzqZi12/3pNMmYKWc9pSDqvHbg38uFfBXCtyr3MbcnCHUpRNcphpXR7SePHQ Q+uPBXT4DKm7B+z9zxbHCTF78aTT26dJgCyOijOxtSFAwtzsbSOnUUoMqDtZkGEgbHAq IGJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from; bh=6y8xU0F66KIoMvplobXnbP/sCMXlkm3LwPz1PJrcq9c=; b=tRj5t9MhIVpt5xZXkrgza9H2Xd5nP6YxMz0hkujfhCNsyZ7LO2BMbnEain80EyGjWl sny9jmvUEC5TRJ+pQgHF5QBo7ilDmhqyg+fAOVc8n6Kb0KRXFrJ2erFcUUjDwAjoDuTF vQLV4F/ZyM16V6jsJ4wKgu4mF27a+y1H67t9ChiP9rf96NmQh2WhlALLSXpnh8KfD5u4 rvoXAb7LnR9I23y0pIAKqSIpD9P9A2KlQmhzYQSeHmzVWcEFnk2cZtitxbYfm8IqCkJ7 VGGrRypcxhJmrhNeNjd2iHNb19VoqvAuB/icWNmSCdziNbPjMZfMEFzoW46JcFyBJbmc duKQ== 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 y8-20020ae9f408000000b006cdcce30ce3si2124361qkl.396.2022.09.28.02.56.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Sep 2022 02:56:04 -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]:47324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTnQ-0000Be-1s for patch@linaro.org; Wed, 28 Sep 2022 05:56:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odSEL-0008FE-MK for qemu-devel@nongnu.org; Wed, 28 Sep 2022 04:15:52 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:39337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odSEE-0008G4-Ak for qemu-devel@nongnu.org; Wed, 28 Sep 2022 04:15:43 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mrxjf-1oyp0n0Lcj-00nwjH; Wed, 28 Sep 2022 10:15:36 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Richard Henderson , Laurent Vivier Subject: [PULL 34/38] linux-user: Implement PI futexes Date: Wed, 28 Sep 2022 10:15:13 +0200 Message-Id: <20220928081517.734954-35-laurent@vivier.eu> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928081517.734954-1-laurent@vivier.eu> References: <20220928081517.734954-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:4K+CKP9O1oEKj0MYZ5BWZFjbTXYYxV6lfFCtK1/B14hG+wbPrBA 6Le1oaOcKMted6Kg34LUoShfzbk1TvC8FZRuggEEaMXJOyLyYiKHjv3sBm9of/6qXX/QbRN DNONK5nsUpHN+sJkflElwR/r0Sa/uHSJCymwqAtv7I3TpuKd2R1EpvUWaouiANybIZw+e9b wUov5ysbGMJN8pvhUH1qw== X-UI-Out-Filterresults: notjunk:1;V03:K0:0opjmy1l9dk=:cc/gPryyzukaOuyM5fTJ61 MN4FB0s0PtCWxsLr/4tC3YMBUXq+hNC/y/Ls8aTR/6UgpCLIijbUp/R/u0cHJRJ6OYy8X1w2H 6lzihdZH+5kxfU3KiJNwUfXCVl8QoCrTJ6aVxajdClh5z5dhabqvQWq460N0SacAR9LuV3PB/ puscwuX4WXvFP7jcyzDJP0h9S1XnlHSbOcyIqgxFSXPRYq9TScwSeYkF6kPabs5cchHLPVGn4 eURoKzHHrb4LzAAC0vCkEI9w7Wgk6kdmMO/gB7XnPddc1uDsuSaiclgXCIvJpyBVM1HcLd5+V /eoQqSeRSDno/DKKCmT3F8MgTqeVI6sIFEM4UW6XtAULI6OVmAqpXJHnGaQSUVVfFf5y5ueMP 7t9d5w2DH1vShRx1yyX+2kNpVNTqlsAGvZ6KLY0bmwUqnGL2Oi3Kj4IxcDi/q60Lr3QTWjrZ1 cdvStH+b5i5WIcCqSbZbpOsA4jVe+XKBOgKzJQfh7kHc6hurFcdNkD5cI8v56Wth0UuNY1wID dzRRNrKtXTUczPMl73ypqfg++V7N0X8tsHiBxrXjNwIPZHLOn2MoHUiAr7oZlinIFXOMW3IuR TwElnZe8zvr7lsMMAcnH+qE0Piu7289QopH110RqoMhB/pSE2BDBC8fw8qQsFOVtw0yuAayuK kAOxcqbaq/pm6pIlzFfH3NIRzuhxJ2XEfj1SFSLJgiypWRFoa5sPY83Ge9sLLtgXGyLP/6Tz8 EWTXE80zZUK/XtoafrW/rGnTObrmXpdXjQTelvdWnkklmoAHUnYeYB34530qV0AONKYp2h9Xm UsGEbQ9 Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Define the missing FUTEX_* constants in syscall_defs.h Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20220829021006.67305-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 10 ++++++++++ linux-user/syscall_defs.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3f144e3c1f5d..2e954d8dbd9e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7788,8 +7788,17 @@ static int do_futex(CPUState *cpu, bool time64, target_ulong uaddr, case FUTEX_WAIT_BITSET: val = tswap32(val); break; + case FUTEX_WAIT_REQUEUE_PI: + val = tswap32(val); + haddr2 = g2h(cpu, uaddr2); + break; + case FUTEX_LOCK_PI: + case FUTEX_LOCK_PI2: + break; case FUTEX_WAKE: case FUTEX_WAKE_BITSET: + case FUTEX_TRYLOCK_PI: + case FUTEX_UNLOCK_PI: timeout = 0; break; case FUTEX_FD: @@ -7797,6 +7806,7 @@ static int do_futex(CPUState *cpu, bool time64, target_ulong uaddr, timeout = 0; break; case FUTEX_CMP_REQUEUE: + case FUTEX_CMP_REQUEUE_PI: val3 = tswap32(val3); /* fall through */ case FUTEX_REQUEUE: diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 1e3577bfa56f..01ee10a88fe0 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2699,6 +2699,9 @@ struct target_drm_i915_getparam { #define FUTEX_TRYLOCK_PI 8 #define FUTEX_WAIT_BITSET 9 #define FUTEX_WAKE_BITSET 10 +#define FUTEX_WAIT_REQUEUE_PI 11 +#define FUTEX_CMP_REQUEUE_PI 12 +#define FUTEX_LOCK_PI2 13 #define FUTEX_PRIVATE_FLAG 128 #define FUTEX_CLOCK_REALTIME 256