From patchwork Wed Sep 28 20:27:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 610101 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp512714pvb; Wed, 28 Sep 2022 14:19:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zuyKWJJQ8OaPywZv+nWAH0GEwUqCxeEtoCpc1Pug4ezSw2v42CgzV92bVJD4hmfJlrwdK X-Received: by 2002:ac8:5b96:0:b0:35c:ceb4:c1c2 with SMTP id a22-20020ac85b96000000b0035cceb4c1c2mr29153510qta.461.1664399961080; Wed, 28 Sep 2022 14:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664399961; cv=none; d=google.com; s=arc-20160816; b=VQWIoEBoWZi7zqLuGE0hm4u2+eZ4sTfef/KO8c/xfYao1eWIFf96nVDQO0oOVTcq0q f9spM4Zwooj2I+18niu37LWiFdyCDB+qyvDAQqrpC+Y+gpHcwiJkebhLq7+jGEF0TonF NzpMUI/EcC94/SbMcwVEZihIBDV0Eyc+xZTwq9yNnHXv72DCE6zmlcik8bdm+OdALNuY 3mzXNAqhyj3w5cw+KPRA5V/lJ6WgMiq7c2xL9pfIq0qxw25o7vPdaAKJHcE+RYFQJCeM lsW0PVZpqa85BdbrVhAPweG+3/XubD8w7TtcJhVU723bV78mJUd9rJAouNmaSAQoGU1v r2zA== 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=G4RirJjuICnrfEqtYtCXn5UVbd1rWxFTWE/rngiCp6KWZhU7PAdnlpAl1LMd4fRmOv UC0RhTegfLOlU7idQupkU5tCiqJE208YbcA3bxksHNv8OeEDxsFKXOEPhZL+KePkYMjH y9sZfuTpuU1za01VUxkp7o+0NZ45qB36V0tjsW7pNHp2mhSMKJ68G27mC+UW/bDjztzl 5V+5jn91ufwXtpypFSZQ7o3VsFIaJePihlOA+POrsNPiKTga81npOrVMNc2yCwVK9z/A mT6q1AGbqBo+b0EkOBPeyQ+kVVDNFupmXHARdsc4Ri++A6JKViCPngIj0mvnMojRoAaQ 43Nw== 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 e26-20020ac845da000000b0031eb7a0f17bsi226950qto.264.2022.09.28.14.19.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Sep 2022 14:19:21 -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]:54450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odeSd-000464-Ks for patch@linaro.org; Wed, 28 Sep 2022 17:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oddf5-0000eD-ET for qemu-devel@nongnu.org; Wed, 28 Sep 2022 16:28:07 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:53173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oddf3-0006YC-Ry for qemu-devel@nongnu.org; Wed, 28 Sep 2022 16:28:07 -0400 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MTzve-1on1JR2Pru-00QyN6; Wed, 28 Sep 2022 22:28:03 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Richard Henderson , Laurent Vivier Subject: [PULL 34/37] linux-user: Implement PI futexes Date: Wed, 28 Sep 2022 22:27:34 +0200 Message-Id: <20220928202737.793171-35-laurent@vivier.eu> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928202737.793171-1-laurent@vivier.eu> References: <20220928202737.793171-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:ZgvfdCGvrXdYFhC9TqX60aEUkAF5VzmrV0EUY4pGCK7Jn+si3LI oYNrom6aQ/3FjBTFpsRHD1CH2WDWU41lXCsOicOXyq+aapXYY6FyNml2akG8Y+PxRza5rUe htCvEW6IvqIgeO7ZlhAF8cMlq1WDdADskwKIn9t5J0Vi3L3OubN4lVOLQgK05W/sSMhUwH7 cSFJrpqjEyVi7zlhY4/UQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:dbf6zThDfDg=:WGnTVHEAs/DwGg8jGUYaqe kYO4mFBY4Uo23XB6UBxaIRhFOlGc+sao3vpguyhxeHHaI1LUnuZ9nVMtS4u5qc43dnQXM6d0v i5WFquLNKzfL75lcXu01xRSKW+Z3L0jyU5GonB2wU0jHWM26/jeSYgVDz8oeXt3xhPmT1RWfo 4iMggATj97A8zrUiFI8611aOq+qyOQruW04FWwSt5bEYF1es0iXzza0r+Assd1HStsafa4MDi O2Fyio6bkRsDMsVM4LqKCfBXRcRa01MfZlC4aT0FBpI1CvT6agK/tFNhLDoK1JvzWPjwZhfhQ QRHrfxRUkfb/t2Pr4YljTaPdAtjH1IKReaEFNgl3BgNKyJ8smn1mKwhyL6VvY8OD5IMtVXShc XQsv/UxLBwBjtTpikeO4fZaYrU2f6xInRDMK8xS4HfsUeTYEd78HP8iqrgoUz2zHvs6ZJzuW4 uiAMwkt9XrtnGn0PhmNXO2eF1YZY88zETsgjWkNclRt8YLTu0teXjIMFswER+HcJHZ9qBmUYu 1GzimwWyZuzxg5Z3pmmQUUPylK2I+fztCiynU81WAzL1nBokHsAyk/ex4G6LglSQSZwR1bf5a bEUmhHE/ZAjYMotSBRiHU06qcHHtdov9m+W17FZZcf+huzWhZHesDa3xi+raA5Sxjeg1jwhLO owbriQpNlIcjEaRpfrsBgPT2ZwkLAlC3Zg5/S00en+YbwvlKfniBSwWIEbkMXYKcvS/ZajHWX iiK6fk+3T8MgmYSpbpvMP/1mII+XCr5bckoAd0MqAJNQHClBF/vfJi08wAEbYPWWYmQ3nXYl+ ssFhHqz Received-SPF: none client-ip=212.227.126.135; 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_DNSWL_NONE=-0.0001, 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