From patchwork Mon Aug 19 22:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 820293 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c8:0:b0:367:895a:4699 with SMTP id m8csp1653774wrb; Mon, 19 Aug 2024 15:55:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVAKTtxXBMgogh0W+tLlz/pM63lDjcOBxby31aI4w8wED4bFrkitqSmi9ds0JHyF+dh6Tkzrg==@linaro.org X-Google-Smtp-Source: AGHT+IFWSu+vX4Wfi1ok1pPn1HnYVO/lJNjPGqpHd87oWLQDLSf7bO7FTlF/Bu+SXEOzoJpTHm9I X-Received: by 2002:a05:6214:5c05:b0:6b7:b236:6944 with SMTP id 6a1803df08f44-6bf7cdca43emr192993946d6.8.1724108131671; Mon, 19 Aug 2024 15:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724108131; cv=none; d=google.com; s=arc-20160816; b=nxJisCNylAyLoc8EED5C52ofYSMPx92Yp2qsW6/LdERfn4Tt1Ii2o3eqzp/40rBcxv xtwUYHUI5DUm98WMDqhCkS7DXGxFxUEqICQa0TzJLjJ5Dmn4PtL0Cthz/ZgAK2IsNelE HarfQrevCN8Db7uZ63717vUVQ7iB0nV572fjRAcDgPvzGqTpHkYejUvHLDqeawMWXFYG kfFT0EiOLxNu496pOWuq3zHCdQCkwK+uXAnKtoR6Xjj9L4c7oCorf3rOeHMecCAv2ihP I313Jw1gRMcosfkVHOSyxclc90LyUmQiD2ddiMG/IthF+9b+Ru8wqMQWEPTIzb/i9MHy G3PQ== 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:dkim-signature; bh=8Rpj0D5ZMl/IBwW6NXczoFAZCXLiZ4uNQ1t/B/Sarn0=; fh=a30mAVWKbuJ6aXZi/tQWCDa7aCA03tENVBzCoaOdc7s=; b=A6vW82M27Tj1KJhMiss+0AOpEq8FGcoN/ioObe2nXQ24wSU3gLHTtup7xdr+Fr0712 w5/sT9LaF0IYW2tV794taU+qYn1zM62IQNuVspPvBHAldLTq2RXCV6A+fxhSXlN6a1NG vwEvSjy7H1IbtugldiIdQZu+qLo85BBjp4O+fwJ/lzuzmZ6faZ5WQ8BfCKeS9sqG4FzH wUpFkbZvOx0ynryEdvYzrL13ZX88qBdOJQsI2v9NLz0A6RRQ/mf9OrbjKcDYtaXl68/4 TbfcUTQ11EwbYDDx7jtwH1KHLdBPTGfTGwCznkZ6qyiPefsyyc7tGgflTWLmdAm5M00T OsxA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uhN6TedF; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bf6ff2b9a4si80812866d6.566.2024.08.19.15.55.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2024 15:55:31 -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; dkim=pass header.i=@linaro.org header.s=google header.b=uhN6TedF; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgBGH-00009C-Ii; Mon, 19 Aug 2024 18:54:06 -0400 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 1sgBF4-0002mk-PK for qemu-devel@nongnu.org; Mon, 19 Aug 2024 18:52:53 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450: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 1sgBF2-0000qE-ML for qemu-devel@nongnu.org; Mon, 19 Aug 2024 18:52:50 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37196229343so2253352f8f.0 for ; Mon, 19 Aug 2024 15:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724107967; x=1724712767; 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=8Rpj0D5ZMl/IBwW6NXczoFAZCXLiZ4uNQ1t/B/Sarn0=; b=uhN6TedFXli2mt+RFohEyh5171RnC2ndEU8AUp9Sh8L7WG4ROgCceYy/A5IS9Oaw9s 2xAT5QBU6tbILcgcfsLeWeknNwTCC0Aimsiyon+GtE4nQp9IWPpNZ6lSpjZdLXgSZ2Z+ 6mNtZM9fbQZ0fLX4ORdC2o1wV6058lbLITOXIBQaLZWahb9COHwjdoU//2KQN6jCbJ2Z dWBzroGChHkSgbTLanzLUuhYQAgO1mQqfSOXnzJ2//CmpSwRz0WidwpobnLd1HglkixL WKDEUrbICbpHLL6t5FbWomYvx5e7nwYbSGf2Mv+4P/5GXEy+/mpAgcv0GA1BjT9RKzzS Y2AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724107967; x=1724712767; 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=8Rpj0D5ZMl/IBwW6NXczoFAZCXLiZ4uNQ1t/B/Sarn0=; b=vwmI/Z9m8x1cFppGwgvi0izTNJbgTEmTD5y9Zi9pGwfFEd8YatALGsRm3I3FdXyrk9 nCVfUdShT5Sjs7ob7D1wbr3fHm6m99vUIeHmaFzE8D2+kaxGkY6ANXxPuE2ij+2l2wjT MBl9rlBkm69uGygunkAbOXbx4F0FL5Dljqb/jEYUy+ATHYGcBiAyB0CHrTJFJpN0FwJ/ AjysBgocZVP1OCFXzeRovKSUVKAl7zBny6onrLpLrjukPItEwQvzWyIaEBZ84Mx3f7Jn bNqEtfWSyh+rXvc5nUb/kbo9N1NZoIh+ydQ78KnMes27EYq8/rGNv9u2VtPLLXMqhaIB 8CkQ== X-Gm-Message-State: AOJu0YwIVkSkHQzOBCZGGLxh1PTIEXVO8WbdYWzhoawqPNweGRoouHP6 CN/rMUp5d23KxC5dNPdajWwqQkrjrDCV8Hs/bs7YgggYEzCDuVWFFGoIsuAPou48LnpY94zmDOE nQxU= X-Received: by 2002:adf:ec04:0:b0:371:7e73:eb43 with SMTP id ffacd0b85a97d-37194694f88mr8068307f8f.42.1724107966740; Mon, 19 Aug 2024 15:52:46 -0700 (PDT) Received: from localhost.localdomain (88-178-97-237.subs.proxad.net. [88.178.97.237]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429ded2931asm173290985e9.17.2024.08.19.15.52.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 19 Aug 2024 15:52:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Kamil_Szcz=C4=99k?= , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 19/20] hw/i386/pc: Ensure vmport prerequisites are fulfilled Date: Tue, 20 Aug 2024 00:51:15 +0200 Message-ID: <20240819225116.17928-20-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240819225116.17928-1-philmd@linaro.org> References: <20240819225116.17928-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Kamil Szczęk Since commit 4ccd5fe22feb95137d325f422016a6473541fe9f ('pc: add option to disable PS/2 mouse/keyboard'), the vmport will not be created unless the i8042 PS/2 controller is enabled. To avoid confusion, let's fail if vmport was explicitly requested, but the i8042 controller is disabled. This also changes the behavior of vmport=auto to take i8042 controller availability into account. Signed-off-by: Kamil Szczęk Reviewed-by: Bernhard Beschow Message-ID: <0MS3y5E-hHqODIhiuFxmCnIrXd612JIGq31UuMsz4KGCKZ_wWuF-PHGKTRSGS0nWaPEddOdF4YOczHdgorulECPo792OhWov7O9BBF6UMX4=@szczek.dev> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 11 ++++++++--- qemu-options.hx | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 72229a24ff..7779c88a91 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1075,7 +1075,7 @@ static const MemoryRegionOps ioportF0_io_ops = { }; static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, - bool create_i8042, bool no_vmport) + bool create_i8042, bool no_vmport, Error **errp) { int i; DriveInfo *fd[MAX_FD]; @@ -1100,6 +1100,10 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, } if (!create_i8042) { + if (!no_vmport) { + error_setg(errp, + "vmport requires the i8042 controller to be enabled"); + } return; } @@ -1219,12 +1223,13 @@ void pc_basic_device_init(struct PCMachineState *pcms, assert(pcms->vmport >= 0 && pcms->vmport < ON_OFF_AUTO__MAX); if (pcms->vmport == ON_OFF_AUTO_AUTO) { - pcms->vmport = xen_enabled() ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON; + pcms->vmport = (xen_enabled() || !pcms->i8042_enabled) + ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON; } /* Super I/O */ pc_superio_init(isa_bus, create_fdctrl, pcms->i8042_enabled, - pcms->vmport != ON_OFF_AUTO_ON); + pcms->vmport != ON_OFF_AUTO_ON, &error_fatal); } void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus) diff --git a/qemu-options.hx b/qemu-options.hx index d99084a5ee..d94e2cbbae 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -68,8 +68,8 @@ SRST ``vmport=on|off|auto`` Enables emulation of VMWare IO port, for vmmouse etc. auto says - to select the value based on accel. For accel=xen the default is - off otherwise the default is on. + to select the value based on accel and i8042. For accel=xen or + i8042=off the default is off otherwise the default is on. ``dump-guest-core=on|off`` Include guest memory in a core dump. The default is on.