From nobody Tue Feb 10 07:40:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1639214913; cv=none; d=zohomail.com; s=zohoarc; b=MNQDXBJZDhvkHDvhreIcxhudfRPiFBmfe0wOePWR0SDn7GCAwyMOyX+X9OTAgTaEH74guDo/206ee4S6j6MJ7OUWrLes3BA4m/6GVH/Q/ASR/c9kCQBpF2SjDvwYkgftVJO5BsqVv63a2madNTm+6f1vmJsPILVm2ZcnA0MG2BE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639214913; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CrOUghzPEPWUSUHwujj/LIcQrPwhnw1OvJdWErKdR8M=; b=DKEdEh7dJLMk5GSBaMBigi847J8t2PzxubVTTPMSjyuBmNIiXeFJaWt/qWmkq9vZCsIV+sFVCndmzHNgT6jEYumWBSZesnDHABF6e9L22G5YL8GF8EUWUhk6NgQ7inzIkg8ziM2iNxfy+7d5mZHtb9PiHoHISPRki5q+H+9gz84= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1639214913624233.66979053476666; Sat, 11 Dec 2021 01:28:33 -0800 (PST) Received: from localhost ([::1]:39122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvygC-0005UP-OA for importer@patchew.org; Sat, 11 Dec 2021 04:28:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvsA6-0004Dx-Sg for qemu-devel@nongnu.org; Fri, 10 Dec 2021 21:30:58 -0500 Received: from [2607:f8b0:4864:20::52d] (port=33491 helo=mail-pg1-x52d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvsA4-0001Za-Nw for qemu-devel@nongnu.org; Fri, 10 Dec 2021 21:30:58 -0500 Received: by mail-pg1-x52d.google.com with SMTP id f125so9621414pgc.0 for ; Fri, 10 Dec 2021 18:30:56 -0800 (PST) Received: from localhost ([2601:646:100:6be:6177:c6b7:1b7d:7a95]) by smtp.gmail.com with UTF8SMTPSA id mg12sm292397pjb.10.2021.12.10.18.30.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Dec 2021 18:30:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CrOUghzPEPWUSUHwujj/LIcQrPwhnw1OvJdWErKdR8M=; b=hbvOCBeLFC+bt43BZiJdHeHl7qNb1lvyUg6ZzPdgiZVZq7rb8fMIZOGzlz4RL+oMy5 qBvoT95CxYoVgCVIl5We5T9wa4T2urCg8BFkwYrD0W9Evm6MYSvqW2KLprtERCxk4EwY NjiyBuvRplTGb34IknXhvF94DXO/IT4BeKT6/RT/to3BfO+7HW9kQ89Vcl0UGUadKapz tl0lKISojead9mJ1e7Ya6itbazgDHC5gXlW7M9YIJ9PVpP8JXWw5Jy0o38ydjsKypwDT MbHdFdVYQ7/AQHjq96URHutcn6xz3PAw3U8SB0VcojEZ2Ch7UKR+/0jiG1PFLVPecKl8 4hNQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=CrOUghzPEPWUSUHwujj/LIcQrPwhnw1OvJdWErKdR8M=; b=g8ZLEXeLxst9E7pfdaLGVfcSCyG3834CLox4vmx/yRZrLHUg3zOVsMPez8+2yXqTQC lW6B6gmf46SyiREvDhXhCOfF6VQQyU3xWIxVKcxM7QIFVC8PWF90oWDDbqJBY6QtVIoV tYZc7RUXGvV5GMxJWkb7I4jiR2sdLYzjlUVcjobrO2Tqi8vHJhp89CwgbueFrmvtlE4i rMJR8VeV0E8m0UipWIJoF+AwDUHrLbQCjoznaJB53H9u8eKSKncDuKFR15GxxMtj9Yf8 uTJk71bhFRaQOGv2CiDvkep93HLJ8Bp6q7/ZIAQ2NoreeLfCjxt/kPXKNNaljmu6GtaL zvfQ== X-Gm-Message-State: AOAM53261ACl6WB2kJpuniUZBi8dtr8CLqtTj25WRackDkGie2yjUdG4 xl0hrg1EpwG/ejvz2UnxbJrik5gb8jk= X-Google-Smtp-Source: ABdhPJyNX2pQkY1NgXpyfrhzK9JkpLgbAikp7WdBLMP1VR07c4b7KJR6/aW4TbajfQVALqI1PHl6LA== X-Received: by 2002:a63:41c6:: with SMTP id o189mr42475643pga.625.1639189854207; Fri, 10 Dec 2021 18:30:54 -0800 (PST) From: Tonis Tiigi To: qemu-devel@nongnu.org, Laurent Vivier Subject: [PATCH 2/2] linux-user: call set/getscheduler set/getparam directly Date: Fri, 10 Dec 2021 18:27:50 -0800 Message-Id: <20211211022749.95384-3-tonistiigi@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20211211022749.95384-1-tonistiigi@gmail.com> References: <20211211022749.95384-1-tonistiigi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::52d (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=tonistiigi@gmail.com; helo=mail-pg1-x52d.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, FREEMAIL_FROM=0.001, 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-Mailman-Approved-At: Sat, 11 Dec 2021 04:25:17 -0500 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: Tonis Tiigi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1639214914326100001 Content-Type: text/plain; charset="utf-8" There seems to be difference in syscall and libc definition of these methods and therefore musl does not implement them (1e21e78bf7). Call syscall directly to ensure the behavior of the libc of user application, not the libc that was used to build QEMU. Signed-off-by: Tonis Tiigi --- linux-user/syscall.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 670b61b2ef..263d7fac5e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -343,6 +343,14 @@ _syscall3(int, sys_sched_setaffinity, pid_t, pid, unsi= gned int, len, _syscall4(int, sys_sched_getattr, pid_t, pid, struct sched_attr *, attr, u= nsigned int, size, unsigned int, flags); #define __NR_sys_sched_setattr __NR_sched_setattr _syscall3(int, sys_sched_setattr, pid_t, pid, struct sched_attr *, attr, u= nsigned int, flags); +#define __NR_sys_sched_getscheduler __NR_sched_getscheduler +_syscall1(int, sys_sched_getscheduler, pid_t, pid); +#define __NR_sys_sched_setscheduler __NR_sched_setscheduler +_syscall3(int, sys_sched_setscheduler, pid_t, pid, int, policy, const stru= ct sched_param *, param); +#define __NR_sys_sched_getparam __NR_sched_getparam +_syscall2(int, sys_sched_getparam, pid_t, pid, struct sched_param *, param= ); +#define __NR_sys_sched_setparam __NR_sched_setparam +_syscall2(int, sys_sched_setparam, pid_t, pid, const struct sched_param *,= param); #define __NR_sys_getcpu __NR_getcpu _syscall3(int, sys_getcpu, unsigned *, cpu, unsigned *, node, void *, tcac= he); _syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd, @@ -10563,7 +10571,7 @@ static abi_long do_syscall1(void *cpu_env, int num,= abi_long arg1, return -TARGET_EFAULT; schp.sched_priority =3D tswap32(target_schp->sched_priority); unlock_user_struct(target_schp, arg2, 0); - return get_errno(sched_setparam(arg1, &schp)); + return get_errno(sys_sched_setparam(arg1, &schp)); } case TARGET_NR_sched_getparam: { @@ -10573,7 +10581,7 @@ static abi_long do_syscall1(void *cpu_env, int num,= abi_long arg1, if (arg2 =3D=3D 0) { return -TARGET_EINVAL; } - ret =3D get_errno(sched_getparam(arg1, &schp)); + ret =3D get_errno(sys_sched_getparam(arg1, &schp)); if (!is_error(ret)) { if (!lock_user_struct(VERIFY_WRITE, target_schp, arg2, 0)) return -TARGET_EFAULT; @@ -10593,10 +10601,10 @@ static abi_long do_syscall1(void *cpu_env, int nu= m, abi_long arg1, return -TARGET_EFAULT; schp.sched_priority =3D tswap32(target_schp->sched_priority); unlock_user_struct(target_schp, arg3, 0); - return get_errno(sched_setscheduler(arg1, arg2, &schp)); + return get_errno(sys_sched_setscheduler(arg1, arg2, &schp)); } case TARGET_NR_sched_getscheduler: - return get_errno(sched_getscheduler(arg1)); + return get_errno(sys_sched_getscheduler(arg1)); case TARGET_NR_sched_getattr: { struct target_sched_attr *target_scha; --=20 2.30.1 (Apple Git-130)