From nobody Tue Nov 26 10:36:40 2024 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1708736781; cv=none; d=zohomail.com; s=zohoarc; b=NDPI7BuitpwP6E0Ih3FLE5JsK1dywK/6b8QKsRBAvZL6sG8gvZ9AJaEiPtLBaMA9RbgvEXxHDfiH59oP8Bt9BpNRoVldH9aj6of2JeWXA22Co3945kbXhEwfQG1I1YfzO1c4W6nSUTh2r9GMhdxhrsJ4ojHY8g8bMlf/D1NegDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708736781; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xfZZqsebUHyUVLONNyqFeLCKzRlol9H6yrC5xBxB6h0=; b=dqWsaUX72Th59qxBV80kecUQj3wnuf5usiY+L1evPU6Kp3seEmQEr2o5iN5IL99M7WQaQJNLTPA6dw/fDT10ac01EV6kA+x2XwPihT0sptwWlKHq+XHnXycmuwOjXF8VOQ7RXFcUmoGUeaJ37c/kGm7Qy6Ql9NE3YdiEuCc8AXM= 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 1708736781175986.7346532671464; Fri, 23 Feb 2024 17:06:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdgTo-0006FL-Lq; Fri, 23 Feb 2024 20:05:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdgTl-0006El-Qm for qemu-devel@nongnu.org; Fri, 23 Feb 2024 20:05:26 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdgTk-0006qV-5J for qemu-devel@nongnu.org; Fri, 23 Feb 2024 20:05:25 -0500 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6e46b5e7c43so589488b3a.2 for ; Fri, 23 Feb 2024 17:05:23 -0800 (PST) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id g17-20020a62e311000000b006ddc7ed6edfsm93513pfh.51.2024.02.23.17.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 17:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708736722; x=1709341522; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xfZZqsebUHyUVLONNyqFeLCKzRlol9H6yrC5xBxB6h0=; b=xfN+vP47w542nj7U7ySVg+ZwYyKT234mFOMWOuyKaHdhcTuKe4WhoWeu+ZVMU5KJRy bVIW2HLmgx7jVguSpobKPy0LMIg+Od3RrCwp+hKpF6qr9aS6fhzkXd9hbk/gI9GMjuap W/0Nyoy+1eiv4u+VqIDfAPE2pDmddjpfw0cx0xnNlDsdolCvIQQAPEu9tWnVQ2u7aQxD 0pB4wCTMfp1NFOPpGLx3pQnleYYFPUFLd0NrVaQPvmWGg74m9OIEtyT9zVpoIeS0XSbd 6wh1BA39/shGUwR9G76HQGtBzdkT0hKVglEctPgR/cgCS/BNe1qq/ZOGJ8oD5PdZhVUb SVYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708736722; x=1709341522; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xfZZqsebUHyUVLONNyqFeLCKzRlol9H6yrC5xBxB6h0=; b=SbqMWMa2okA5gtngJ/2Lk3hVa4z90PtYSmFZT/dxavZaHh0E0w5dRJmoU3HiOtlBo4 +6gV4Ycbz/DvNw5G75I/jom8oTZLzAi3C8+zB+gcltVq5akWTtzvtxfRXEcMK/Dj8152 6bkgAVT7KE1h3AbqpQTXZTej6jhtA2DoWrUmoCVdCtTDDFv2d/1XEd0jjEQccdAVHK7A Nj5E/oFKO9sSUy+lRr414M2c1aaZSvyWPvWTvOs/TQe3zdW8sH2qJOKzGXm0fzCpNcpT Q+dUWTFweqgOaSpjKifWvWTOVZvwm5zxoQGbVVb7/7iL5XhhQG65kM6u5NXeFhq/gHeF t5YQ== X-Gm-Message-State: AOJu0Yz+iM6qsyulsB5TN2ZkCv/Alt4/pG6qd/E6vBBpyBGHD8DRsRam E+iT8fUXu8NYn7qiKY8ImRoW9m8zF2MuwnEwSHPBUQBs2be6Gkxh/XbEYSFFTFgm5s+LsViv2LF c X-Google-Smtp-Source: AGHT+IGd+Mbe0pZO4QS/37LvPQ7jfS3B2OFDATPqnUAlgOaBExmecKAXytvFI8Gwmb/3CiyJO9scYg== X-Received: by 2002:aa7:9a1d:0:b0:6e4:8793:61ff with SMTP id w29-20020aa79a1d000000b006e4879361ffmr1342628pfj.32.1708736722374; Fri, 23 Feb 2024 17:05:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Warner Losh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Helge Deller Subject: [PULL v2 31/39] *-user: Deprecate and disable -p pagesize Date: Fri, 23 Feb 2024 15:05:16 -1000 Message-Id: <20240224010517.619640-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240224010517.619640-1-richard.henderson@linaro.org> References: <20240224010517.619640-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1708736782726100001 This option controls the host page size. From the mis-usage in our own testsuite, this is easily confused with guest page size. The only thing that occurs when changing the host page size is that stuff breaks, because one cannot actually change the host page size. Therefore reject all but the no-op setting as part of the deprecation process. Reviewed-by: Warner Losh Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Helge Deller Message-Id: <20240102015808.132373-27-richard.henderson@linaro.org> --- docs/about/deprecated.rst | 10 ++++++++++ docs/user/main.rst | 3 --- bsd-user/main.c | 11 ++++++----- linux-user/main.c | 12 ++++++------ 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 5a2305ccd6..3074303b9c 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -63,6 +63,16 @@ as short-form boolean values, and passed to plugins as `= `arg_name=3Don``. However, short-form booleans are deprecated and full explicit ``arg_name= =3Don`` form is preferred. =20 +User-mode emulator command line arguments +----------------------------------------- + +``-p`` (since 9.0) +'''''''''''''''''' + +The ``-p`` option pretends to control the host page size. However, +it is not possible to change the host page size, and using the +option only causes failures. + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/docs/user/main.rst b/docs/user/main.rst index 7e7ad07409..d5fbb78d3c 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -87,9 +87,6 @@ Debug options: Activate logging of the specified items (use '-d help' for a list of log items) =20 -``-p pagesize`` - Act as if the host page size was 'pagesize' bytes - ``-g port`` Wait gdb connection to port =20 diff --git a/bsd-user/main.c b/bsd-user/main.c index e5efb7b845..6ab3efd6c0 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -364,11 +364,12 @@ int main(int argc, char **argv) } else if (!strcmp(r, "L")) { interp_prefix =3D argv[optind++]; } else if (!strcmp(r, "p")) { - qemu_host_page_size =3D atoi(argv[optind++]); - if (qemu_host_page_size =3D=3D 0 || - (qemu_host_page_size & (qemu_host_page_size - 1)) !=3D 0) { - fprintf(stderr, "page size must be a power of two\n"); - exit(1); + unsigned size, want =3D qemu_real_host_page_size(); + + r =3D argv[optind++]; + if (qemu_strtoui(r, NULL, 10, &size) || size !=3D want) { + warn_report("Deprecated page size option cannot " + "change host page size (%u)", want); } } else if (!strcmp(r, "g")) { gdbstub =3D g_strdup(argv[optind++]); diff --git a/linux-user/main.c b/linux-user/main.c index e540acb84a..bad03f06d3 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -332,11 +332,11 @@ static void handle_arg_ld_prefix(const char *arg) =20 static void handle_arg_pagesize(const char *arg) { - qemu_host_page_size =3D atoi(arg); - if (qemu_host_page_size =3D=3D 0 || - (qemu_host_page_size & (qemu_host_page_size - 1)) !=3D 0) { - fprintf(stderr, "page size must be a power of two\n"); - exit(EXIT_FAILURE); + unsigned size, want =3D qemu_real_host_page_size(); + + if (qemu_strtoui(arg, NULL, 10, &size) || size !=3D want) { + warn_report("Deprecated page size option cannot " + "change host page size (%u)", want); } } =20 @@ -496,7 +496,7 @@ static const struct qemu_argument arg_table[] =3D { {"D", "QEMU_LOG_FILENAME", true, handle_arg_log_filename, "logfile", "write logs to 'logfile' (default stderr)"}, {"p", "QEMU_PAGESIZE", true, handle_arg_pagesize, - "pagesize", "set the host page size to 'pagesize'"}, + "pagesize", "deprecated change to host page size"}, {"one-insn-per-tb", "QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per= _tb, "", "run with one guest instruction per emulated TB"}, --=20 2.34.1