From patchwork Wed Sep 11 12:27:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08509EE499F for ; Wed, 11 Sep 2024 12:27:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796512.1206124 (Exim 4.92) (envelope-from ) id 1soMRk-0004dm-E5; Wed, 11 Sep 2024 12:27:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796512.1206124; Wed, 11 Sep 2024 12:27:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMRk-0004df-91; Wed, 11 Sep 2024 12:27:44 +0000 Received: by outflank-mailman (input) for mailman id 796512; Wed, 11 Sep 2024 12:27:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMRj-0004dX-5Y for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:27:43 +0000 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [2a00:1450:4864:20::42b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3d0c02e5-7039-11ef-99a1-01e77a169b0f; Wed, 11 Sep 2024 14:27:41 +0200 (CEST) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-374c3eef39eso3834299f8f.0 for ; Wed, 11 Sep 2024 05:27:41 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd46909sm5605302a12.25.2024.09.11.05.27.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:27:40 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3d0c02e5-7039-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057661; x=1726662461; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=RRgULabzxyRKI4iO19jmq0n/El/qBMMV7z8yj44mMJk=; b=OKaPduzZlO/3ac6CYe/eCn686LM0Oyly0BoqMYkSoJxaxRaQIw0fNIEbfS4RAWCfcM Klu3iOOEtArqjy589xcM6B1BwJEOz2PIIrO7ZqiqEEuyF4LQXXvV58jmVXVQNVc1mt31 7DQYeSsZ5kxzIi9GG2boixccqtpyTnhrHpmKG8G8MX2L3DZ8iqsOnHVoE/Ij0nDWM+OX fA53UZYLGUxBqyNPiJYyyq+creXtFi6GDMlx8jrJd+icSUda161NzvnFV4Frj8uWu+fz /XnX8AYebRcHCstTw4np6zMi/a+4UwCfE/YomEytV5JnhqREozBmXWwJtS7jJ2q426rH 5/eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057661; x=1726662461; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RRgULabzxyRKI4iO19jmq0n/El/qBMMV7z8yj44mMJk=; b=asSYfeCfwRUlpJ26e5K4S0t6HsaTs9H2eXMeD1qsqrkHqDgIbJ1SyJupulNYnFmu5O H2ce3VqlNkLtQ/aCAhjgeOH5OalFbJq3nFMfSwLYdIQAViIJ1q/gxl+a/0W/2ea8ZMlU dEpwjTVPs+QzXpVynIvX1j1+2GO9XbPjM/NYmxT54L7jET7HNKY5s5cLO3xUY84cMq+E tNqyVIhdEQmaTqOfIkS3wGitTii/qvlUGsxZUtU6QJ7yDu1NAFbXB1A7CIvuWm2WYHCt Lz6fFkXYdRcjJPkPKBH+DA/xvptsIJNor91X/M2M8GJ66Yvfpf4ICDI5XViwFz9SijZp A7FQ== X-Gm-Message-State: AOJu0Yy+ML1Y1BbyHcuOozYOiXElPiw+Z73eQeVNKTo5eVMm1wVulIBg gaCErFCWXE1qtlbTgulG4BdnsShG4WlRMIe3XQkvZIm5sOhjpWQd2TcwBq74zLeX/rg2n320bLg = X-Google-Smtp-Source: AGHT+IE5mzHyz7nheTFsBnpSbeZhj7wVHdSvNmXxNq3897bSDLfO1OkmQph7oLqEesXOgXko74E6aw== X-Received: by 2002:a05:6000:1143:b0:371:87d4:8f12 with SMTP id ffacd0b85a97d-378895ca2e1mr11114735f8f.17.1726057660682; Wed, 11 Sep 2024 05:27:40 -0700 (PDT) Message-ID: Date: Wed, 11 Sep 2024 14:27:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 1/9] x86/HVM: properly reject "indirect" VRAM writes From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: While ->count will only be different from 1 for "indirect" (data in guest memory) accesses, it being 1 does not exclude the request being an "indirect" one. Check both to be on the safe side, and bring the ->count part also in line with what ioreq_send_buffered() actually refuses to handle. Fixes: 3bbaaec09b1b ("x86/hvm: unify stdvga mmio intercept with standard mmio intercept") Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- v2: New. --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -498,13 +498,13 @@ static bool cf_check stdvga_mem_accept( spin_lock(&s->lock); - if ( p->dir == IOREQ_WRITE && p->count > 1 ) + if ( p->dir == IOREQ_WRITE && (p->data_is_ptr || p->count != 1) ) { /* * We cannot return X86EMUL_UNHANDLEABLE on anything other then the * first cycle of an I/O. So, since we cannot guarantee to always be * able to send buffered writes, we have to reject any multi-cycle - * I/O. + * or "indirect" I/O. */ goto reject; } From patchwork Wed Sep 11 12:28:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45247EE499D for ; Wed, 11 Sep 2024 12:28:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796514.1206132 (Exim 4.92) (envelope-from ) id 1soMS4-00055C-Ja; Wed, 11 Sep 2024 12:28:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796514.1206132; Wed, 11 Sep 2024 12:28:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMS4-000553-Gt; Wed, 11 Sep 2024 12:28:04 +0000 Received: by outflank-mailman (input) for mailman id 796514; Wed, 11 Sep 2024 12:28:02 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMS2-0004dX-Nd for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:28:02 +0000 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [2a00:1450:4864:20::22b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 48e47fb4-7039-11ef-99a1-01e77a169b0f; Wed, 11 Sep 2024 14:28:01 +0200 (CEST) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2f74e613a10so17139071fa.1 for ; Wed, 11 Sep 2024 05:28:01 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25a25897sm607259666b.87.2024.09.11.05.27.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:28:00 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 48e47fb4-7039-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057680; x=1726662480; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=XLf/RPw1YIOaKr3H1z6R8wvZ7gEJiJagpvfMhvGlBU0=; b=IoBY8hwjB/nbM0MzFD/3DTXq0/fHD04ZVfUXjhbjmJW55RaKhUF5HNk4cWfRIFwFYx vJfgtGe5/MV8s+MDKvIw8yBj1t47iJ6BUYCTBwVdz+sC95YycdRHkQuHPc67z4sRbQiy W7lskPOGwJePbzvy5376n0eb6x73Sq5e6rWk9lExTFdx6Hfi3maQoXSIpSlevyrz7Szv bu4SMwDMxXPzANLSmzqi1z5cxziD/czF+8ITOTX4dn4Mh2JtMqIxl4DW2sGmSQm9ALXy yhZ7UWwkcihC0+FnQDhiVymsZWJs6aRoy8IMlGYgQTJ3elAPY+8tBez5I+jOKejzKTpB ntdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057680; x=1726662480; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XLf/RPw1YIOaKr3H1z6R8wvZ7gEJiJagpvfMhvGlBU0=; b=o38EOUUs3z3kyp7FZbq+UuKEwvl9lVVACb+VUNpCIjB9cav7atPI7HY7udCUAWV2qh ax8Xmabs7q3leE0eIwUIqMvNaNRRvN6FoXFIW7zhVdtgsMOE+wb/Fzh5JeclgYttkBZ2 Dw56hyrB2Qj8X33KMbKdi5VH+VaH9kssMtJd5S7YcZJe7Dg6B+lVHzQVnFbQyCH5a65m +XVzkyOTdGOdzGqqqgkX1L9vVLVGAJDV0GsL/TDhX3reSuNVXLkHbD3L136bf+9ouigG CBPO8H1xeAZdNjU57Q89EqBTam2JtHSoQHXxuFe4EqqVIgufHJ/sN3Dn4VEvIdKbF4tp 3dWQ== X-Gm-Message-State: AOJu0YwbQfbJ8Vb0z0QflirEdvmGhpXhfkap36okxD/L2dSbZRcC4ToT mj8YueMCgPc9uUE3peeAXQt6bOCu5XG9NM+1MI9chmZB5plAgdGQ8xLtE20HvQfGIRFcFtK8FW8 = X-Google-Smtp-Source: AGHT+IF7+XNohs41mv2XyAhSG7oyRfbWf88mp+hBBrTq6JcaHcBwnaql3WBTXItFJ10ANOC1u6SSMg== X-Received: by 2002:a05:6512:108b:b0:536:536f:5ed4 with SMTP id 2adb3069b0e04-536587a682amr17822718e87.6.1726057680253; Wed, 11 Sep 2024 05:28:00 -0700 (PDT) Message-ID: <08544fc6-bca0-4c69-8f88-3745ed351d53@suse.com> Date: Wed, 11 Sep 2024 14:28:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 2/9] x86/HVM: drop stdvga's "stdvga" struct member From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Two of its consumers are dead (in compile-time constant conditionals) and the only remaining ones are merely controlling debug logging. Hence the field is now pointless to set, which in particular allows to get rid of the questionable conditional from which the field's value was established (afaict 551ceee97513 ["x86, hvm: stdvga cache always on"] had dropped too much of the earlier extra check that was there, and quite likely further checks were missing). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- v2: Reduce a (largely pre-existing) comment. Re-base over new earlier patch. --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -103,7 +103,7 @@ static void vram_put(struct hvm_hw_stdvg static int stdvga_outb(uint64_t addr, uint8_t val) { struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; - int rc = 1, prev_stdvga = s->stdvga; + int rc = 1; switch ( addr ) { @@ -132,19 +132,6 @@ static int stdvga_outb(uint64_t addr, ui break; } - /* When in standard vga mode, emulate here all writes to the vram buffer - * so we can immediately satisfy reads without waiting for qemu. */ - s->stdvga = (s->sr[7] == 0x00); - - if ( !prev_stdvga && s->stdvga ) - { - gdprintk(XENLOG_INFO, "entering stdvga mode\n"); - } - else if ( prev_stdvga && !s->stdvga ) - { - gdprintk(XENLOG_INFO, "leaving stdvga mode\n"); - } - return rc; } @@ -425,7 +412,6 @@ static int cf_check stdvga_mem_write( const struct hvm_io_handler *handler, uint64_t addr, uint32_t size, uint64_t data) { - struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; ioreq_t p = { .type = IOREQ_TYPE_COPY, .addr = addr, @@ -436,8 +422,7 @@ static int cf_check stdvga_mem_write( }; struct ioreq_server *srv; - if ( true || !s->stdvga ) - goto done; + goto done; /* Intercept mmio write */ switch ( size ) @@ -498,19 +483,14 @@ static bool cf_check stdvga_mem_accept( spin_lock(&s->lock); - if ( p->dir == IOREQ_WRITE && (p->data_is_ptr || p->count != 1) ) + if ( p->dir != IOREQ_WRITE || p->data_is_ptr || p->count != 1 ) { /* - * We cannot return X86EMUL_UNHANDLEABLE on anything other then the - * first cycle of an I/O. So, since we cannot guarantee to always be - * able to send buffered writes, we have to reject any multi-cycle - * or "indirect" I/O. + * Only accept single direct writes, as that's the only thing we can + * accelerate using buffered ioreq handling. */ goto reject; } - else if ( p->dir == IOREQ_READ && - (true || !s->stdvga) ) - goto reject; /* s->lock intentionally held */ return 1; --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -115,7 +115,6 @@ struct hvm_hw_stdvga { uint8_t sr[8]; uint8_t gr_index; uint8_t gr[9]; - bool stdvga; uint32_t latch; struct page_info *vram_page[64]; /* shadow of 0xa0000-0xaffff */ spinlock_t lock; From patchwork Wed Sep 11 12:28:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A933EE499F for ; Wed, 11 Sep 2024 12:28:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796516.1206142 (Exim 4.92) (envelope-from ) id 1soMSJ-0005TQ-Rq; Wed, 11 Sep 2024 12:28:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796516.1206142; Wed, 11 Sep 2024 12:28:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMSJ-0005So-Ob; Wed, 11 Sep 2024 12:28:19 +0000 Received: by outflank-mailman (input) for mailman id 796516; Wed, 11 Sep 2024 12:28:19 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMSJ-0005SW-9c for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:28:19 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 530ab0f8-7039-11ef-a0b5-8be0dac302b0; Wed, 11 Sep 2024 14:28:18 +0200 (CEST) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5365cc68efaso4800658e87.1 for ; Wed, 11 Sep 2024 05:28:18 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cf4aa7sm615263966b.176.2024.09.11.05.28.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:28:17 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 530ab0f8-7039-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057697; x=1726662497; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=GU5uJOFJeV+lLoYSgZiwdkedyXxQBupmKk22qJVGgqc=; b=XHn/sVkecVXnSrrERJqDosELedu+DkyevS5chxOwNmfEhRZflaWu6LZfWdoXmwsMg9 2mcIesGlLT8FSz2ShrOm9+GhZiYKkEye2mdh3x8BjXPgRX/vM2nl81EcjNCzslRjETYw yMObusGdp8tmZRNjJ5hQgBThXX7z2omwhcOxjnUGcDl+2FtV7AVOa37TFFYSbKpdaVwW usN0aaV1yxo4IUSnM3SxjAAHZWwvXF5MKvpb9aLRhdo6a+qnC/DVkcb51Gthp7gchx1I NOBa4j2HppKNJ6EjqgsSrMX9hndFfZsbeOhup/r0m3hOwm4I8l04PnnGmNtR2uq/J63d Jg1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057697; x=1726662497; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GU5uJOFJeV+lLoYSgZiwdkedyXxQBupmKk22qJVGgqc=; b=NW3lTB9LZv4EYi6i1cDiLX2IM4Y1MxDlcDQgUS5Sk/p5kmHRpXv00CpXGVFkL3Jfct DAhLl/ucSB3jYnRt94LhMUNR+Zx2vaOBO7xT7BKiW5nO7XwvZa6QZcm4dWtuGoBnIEB6 7jgwVA/hWEhFp9Mvns5z5oSE7ZXyndAffvRSDHzyQAAGFO/fLj5wapvCPY+xw+rO4aqM xhvjnE429dVnDLuGnolPeMYbiflXEftgMmOqJc/fKaq7V+7vS1cgEQl/WZESvy4pKZxG pzDR3e6hHecDvDVETZlkUPIda3agfPn3Fod7LdItzASzYoXa2hANW/zz012TJQhSJNmJ 4Pgg== X-Gm-Message-State: AOJu0YzWPH6MHAecPgs/4lB7cVbEBVuZ0oyylhlVNyKSoZMowNaNuxCw ftpx8ek1HII5P8aXuOGPfG8gTVQ6j7n4I/ZGaNmCa892+6BZ5TnfrULMycqPL6+RcgYaXulih3Y = X-Google-Smtp-Source: AGHT+IFPE5x4kAcG6OYExYpkdZ3Kff1XuRgrn3sAXugkDl/ggtin8YTOvaRYDhzIvw4RsVHmrS0xoQ== X-Received: by 2002:a05:6512:33c8:b0:52f:d0f0:e37e with SMTP id 2adb3069b0e04-536587f5e2amr11209565e87.42.1726057697367; Wed, 11 Sep 2024 05:28:17 -0700 (PDT) Message-ID: <706ee6f3-ade8-45b2-adaa-eb7938286c29@suse.com> Date: Wed, 11 Sep 2024 14:28:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 3/9] x86/HVM: remove unused MMIO handling code From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: All read accesses are rejected by the ->accept handler, while writes bypass the bulk of the function body. Drop the dead code, leaving an assertion in the read handler. A number of other static items (and a macro) are then unreferenced and hence also need (want) dropping. The same applies to the "latch" field of the state structure. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -37,26 +37,6 @@ #define VGA_MEM_BASE 0xa0000 #define VGA_MEM_SIZE 0x20000 -#define PAT(x) (x) -static const uint32_t mask16[16] = { - PAT(0x00000000U), - PAT(0x000000ffU), - PAT(0x0000ff00U), - PAT(0x0000ffffU), - PAT(0x00ff0000U), - PAT(0x00ff00ffU), - PAT(0x00ffff00U), - PAT(0x00ffffffU), - PAT(0xff000000U), - PAT(0xff0000ffU), - PAT(0xff00ff00U), - PAT(0xff00ffffU), - PAT(0xffff0000U), - PAT(0xffff00ffU), - PAT(0xffffff00U), - PAT(0xffffffffU), -}; - /* force some bits to zero */ static const uint8_t sr_mask[8] = { (uint8_t)~0xfc, @@ -81,25 +61,6 @@ static const uint8_t gr_mask[9] = { (uint8_t)~0x00, /* 0x08 */ }; -static uint8_t *vram_getb(struct hvm_hw_stdvga *s, unsigned int a) -{ - struct page_info *pg = s->vram_page[(a >> 12) & 0x3f]; - uint8_t *p = __map_domain_page(pg); - return &p[a & 0xfff]; -} - -static uint32_t *vram_getl(struct hvm_hw_stdvga *s, unsigned int a) -{ - struct page_info *pg = s->vram_page[(a >> 10) & 0x3f]; - uint32_t *p = __map_domain_page(pg); - return &p[a & 0x3ff]; -} - -static void vram_put(struct hvm_hw_stdvga *s, void *p) -{ - unmap_domain_page(p); -} - static int stdvga_outb(uint64_t addr, uint8_t val) { struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; @@ -168,244 +129,13 @@ static int cf_check stdvga_intercept_pio return X86EMUL_UNHANDLEABLE; /* propagate to external ioemu */ } -static unsigned int stdvga_mem_offset( - struct hvm_hw_stdvga *s, unsigned int mmio_addr) -{ - unsigned int memory_map_mode = (s->gr[6] >> 2) & 3; - unsigned int offset = mmio_addr & 0x1ffff; - - switch ( memory_map_mode ) - { - case 0: - break; - case 1: - if ( offset >= 0x10000 ) - goto fail; - offset += 0; /* assume bank_offset == 0; */ - break; - case 2: - offset -= 0x10000; - if ( offset >= 0x8000 ) - goto fail; - break; - default: - case 3: - offset -= 0x18000; - if ( offset >= 0x8000 ) - goto fail; - break; - } - - return offset; - - fail: - return ~0u; -} - -#define GET_PLANE(data, p) (((data) >> ((p) * 8)) & 0xff) - -static uint8_t stdvga_mem_readb(uint64_t addr) -{ - struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; - int plane; - uint32_t ret, *vram_l; - uint8_t *vram_b; - - addr = stdvga_mem_offset(s, addr); - if ( addr == ~0u ) - return 0xff; - - if ( s->sr[4] & 0x08 ) - { - /* chain 4 mode : simplest access */ - vram_b = vram_getb(s, addr); - ret = *vram_b; - vram_put(s, vram_b); - } - else if ( s->gr[5] & 0x10 ) - { - /* odd/even mode (aka text mode mapping) */ - plane = (s->gr[4] & 2) | (addr & 1); - vram_b = vram_getb(s, ((addr & ~1) << 1) | plane); - ret = *vram_b; - vram_put(s, vram_b); - } - else - { - /* standard VGA latched access */ - vram_l = vram_getl(s, addr); - s->latch = *vram_l; - vram_put(s, vram_l); - - if ( !(s->gr[5] & 0x08) ) - { - /* read mode 0 */ - plane = s->gr[4]; - ret = GET_PLANE(s->latch, plane); - } - else - { - /* read mode 1 */ - ret = (s->latch ^ mask16[s->gr[2]]) & mask16[s->gr[7]]; - ret |= ret >> 16; - ret |= ret >> 8; - ret = (~ret) & 0xff; - } - } - - return ret; -} - static int cf_check stdvga_mem_read( const struct hvm_io_handler *handler, uint64_t addr, uint32_t size, uint64_t *p_data) { - uint64_t data = ~0UL; - - switch ( size ) - { - case 1: - data = stdvga_mem_readb(addr); - break; - - case 2: - data = stdvga_mem_readb(addr); - data |= stdvga_mem_readb(addr + 1) << 8; - break; - - case 4: - data = stdvga_mem_readb(addr); - data |= stdvga_mem_readb(addr + 1) << 8; - data |= stdvga_mem_readb(addr + 2) << 16; - data |= (uint32_t)stdvga_mem_readb(addr + 3) << 24; - break; - - case 8: - data = (uint64_t)(stdvga_mem_readb(addr)); - data |= (uint64_t)(stdvga_mem_readb(addr + 1)) << 8; - data |= (uint64_t)(stdvga_mem_readb(addr + 2)) << 16; - data |= (uint64_t)(stdvga_mem_readb(addr + 3)) << 24; - data |= (uint64_t)(stdvga_mem_readb(addr + 4)) << 32; - data |= (uint64_t)(stdvga_mem_readb(addr + 5)) << 40; - data |= (uint64_t)(stdvga_mem_readb(addr + 6)) << 48; - data |= (uint64_t)(stdvga_mem_readb(addr + 7)) << 56; - break; - - default: - gdprintk(XENLOG_WARNING, "invalid io size: %u\n", size); - break; - } - - *p_data = data; - return X86EMUL_OKAY; -} - -static void stdvga_mem_writeb(uint64_t addr, uint32_t val) -{ - struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; - int plane, write_mode, b, func_select, mask; - uint32_t write_mask, bit_mask, set_mask, *vram_l; - uint8_t *vram_b; - - addr = stdvga_mem_offset(s, addr); - if ( addr == ~0u ) - return; - - if ( s->sr[4] & 0x08 ) - { - /* chain 4 mode : simplest access */ - plane = addr & 3; - mask = (1 << plane); - if ( s->sr[2] & mask ) - { - vram_b = vram_getb(s, addr); - *vram_b = val; - vram_put(s, vram_b); - } - } - else if ( s->gr[5] & 0x10 ) - { - /* odd/even mode (aka text mode mapping) */ - plane = (s->gr[4] & 2) | (addr & 1); - mask = (1 << plane); - if ( s->sr[2] & mask ) - { - addr = ((addr & ~1) << 1) | plane; - vram_b = vram_getb(s, addr); - *vram_b = val; - vram_put(s, vram_b); - } - } - else - { - write_mode = s->gr[5] & 3; - switch ( write_mode ) - { - default: - case 0: - /* rotate */ - b = s->gr[3] & 7; - val = ((val >> b) | (val << (8 - b))) & 0xff; - val |= val << 8; - val |= val << 16; - - /* apply set/reset mask */ - set_mask = mask16[s->gr[1]]; - val = (val & ~set_mask) | (mask16[s->gr[0]] & set_mask); - bit_mask = s->gr[8]; - break; - case 1: - val = s->latch; - goto do_write; - case 2: - val = mask16[val & 0x0f]; - bit_mask = s->gr[8]; - break; - case 3: - /* rotate */ - b = s->gr[3] & 7; - val = (val >> b) | (val << (8 - b)); - - bit_mask = s->gr[8] & val; - val = mask16[s->gr[0]]; - break; - } - - /* apply logical operation */ - func_select = s->gr[3] >> 3; - switch ( func_select ) - { - case 0: - default: - /* nothing to do */ - break; - case 1: - /* and */ - val &= s->latch; - break; - case 2: - /* or */ - val |= s->latch; - break; - case 3: - /* xor */ - val ^= s->latch; - break; - } - - /* apply bit mask */ - bit_mask |= bit_mask << 8; - bit_mask |= bit_mask << 16; - val = (val & bit_mask) | (s->latch & ~bit_mask); - - do_write: - /* mask data according to sr[2] */ - mask = s->sr[2]; - write_mask = mask16[mask]; - vram_l = vram_getl(s, addr); - *vram_l = (*vram_l & ~write_mask) | (val & write_mask); - vram_put(s, vram_l); - } + ASSERT_UNREACHABLE(); + *p_data = ~0; + return X86EMUL_UNHANDLEABLE; } static int cf_check stdvga_mem_write( @@ -420,47 +150,8 @@ static int cf_check stdvga_mem_write( .dir = IOREQ_WRITE, .data = data, }; - struct ioreq_server *srv; - - goto done; - - /* Intercept mmio write */ - switch ( size ) - { - case 1: - stdvga_mem_writeb(addr, (data >> 0) & 0xff); - break; - - case 2: - stdvga_mem_writeb(addr+0, (data >> 0) & 0xff); - stdvga_mem_writeb(addr+1, (data >> 8) & 0xff); - break; - - case 4: - stdvga_mem_writeb(addr+0, (data >> 0) & 0xff); - stdvga_mem_writeb(addr+1, (data >> 8) & 0xff); - stdvga_mem_writeb(addr+2, (data >> 16) & 0xff); - stdvga_mem_writeb(addr+3, (data >> 24) & 0xff); - break; - - case 8: - stdvga_mem_writeb(addr+0, (data >> 0) & 0xff); - stdvga_mem_writeb(addr+1, (data >> 8) & 0xff); - stdvga_mem_writeb(addr+2, (data >> 16) & 0xff); - stdvga_mem_writeb(addr+3, (data >> 24) & 0xff); - stdvga_mem_writeb(addr+4, (data >> 32) & 0xff); - stdvga_mem_writeb(addr+5, (data >> 40) & 0xff); - stdvga_mem_writeb(addr+6, (data >> 48) & 0xff); - stdvga_mem_writeb(addr+7, (data >> 56) & 0xff); - break; - - default: - gdprintk(XENLOG_WARNING, "invalid io size: %u\n", size); - break; - } + struct ioreq_server *srv = ioreq_server_select(current->domain, &p); - done: - srv = ioreq_server_select(current->domain, &p); if ( !srv ) return X86EMUL_UNHANDLEABLE; --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -115,7 +115,6 @@ struct hvm_hw_stdvga { uint8_t sr[8]; uint8_t gr_index; uint8_t gr[9]; - uint32_t latch; struct page_info *vram_page[64]; /* shadow of 0xa0000-0xaffff */ spinlock_t lock; }; From patchwork Wed Sep 11 12:28:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48A41EE499D for ; Wed, 11 Sep 2024 12:28:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796519.1206153 (Exim 4.92) (envelope-from ) id 1soMSc-00063z-7n; Wed, 11 Sep 2024 12:28:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796519.1206153; Wed, 11 Sep 2024 12:28:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMSc-00063s-4a; Wed, 11 Sep 2024 12:28:38 +0000 Received: by outflank-mailman (input) for mailman id 796519; Wed, 11 Sep 2024 12:28:36 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMSa-0005SW-G7 for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:28:36 +0000 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [2a00:1450:4864:20::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5d8e968c-7039-11ef-a0b5-8be0dac302b0; Wed, 11 Sep 2024 14:28:35 +0200 (CEST) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a8d6ac24a3bso166521466b.1 for ; Wed, 11 Sep 2024 05:28:35 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25ceaf86sm605558566b.155.2024.09.11.05.28.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:28:34 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5d8e968c-7039-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057715; x=1726662515; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=qG8cDP93BwNlVsK1ljt1DG0gUd8sN+5TqGY0WyzLe8M=; b=S6FSIU/HtAlGrydQ8AJsQuLWaGj3B8o4uAtyPMyIwwXUxPBYGjXx+KK/gjZAht+rGP GB3KJ271rLiecfsBFsQX3A8bZJigluE6/zxMCzcDASXXJArHSm0afKjPpYLs0A/fZCrf ER4etH2X05/VFlm+GLrkF1Mr/1yvyKnqpsFi5ab5BqrMgiddmVuPSHT4K8Z769r50s1q +RKkp4mFJMqWvIXc3GJ/eXuHdDLNdZ7d6pTrxPIwsVmnQIjGAHdlCkbjeGF3eGLme/t3 vY+R0W+TvpZqsLtvLK6+mSiLnFXzZtDOUX4gzZtbAWOqMTsuohgDLSLKaDBroC7ZjqEY NNUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057715; x=1726662515; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qG8cDP93BwNlVsK1ljt1DG0gUd8sN+5TqGY0WyzLe8M=; b=wGqaod13MT5BrLGJ8udzZ1dHE9DptT23I4nKKyCX+YhjvDdTFaILnLhDiNCMehSQVh VRpCUBx9H7OASIsEKBdq71qluz/HKjMfuxo5snMIgWZaVithqBlK24JZp5C5Jabw7CFI 696RmqYlV2Zk8TdCCSFZSSLiK0xs6LgrGJzdomCm502CEA0Lg/sUSOj0YVPE1+GPZwPA VrmlCRMQZH44axQmEeA9x46Md5OLmsLzKMhgojcDLYoJm0PnJmzTMLLoOX4U1Xz6QbVg RRC13YnDmSx0koHy/t7zCznpRCl73HAAbWCqHF3c6redhNY/vzC9uKTmVL59okVZnCYk UjOg== X-Gm-Message-State: AOJu0YxMMNVVMKexFydfEHlRzdkI72nZNi86VNHe+YATXVHhT2kG49cJ 7pztwLPAfu0v3sWtGJ630Wtizk5/j5T+ue4LOhrvKySBFIS/eDhgz3zRTZPhoNShD736CImORMk = X-Google-Smtp-Source: AGHT+IG0UPGfrviw2qfvMsFj1wTYZ7skIe7CFv6BujrD78SnAH9Zo1kLb0mRTfjEfQPJRRIfV0JxCw== X-Received: by 2002:a17:907:944b:b0:a8a:87d5:2f49 with SMTP id a640c23a62f3a-a8ffae3a20cmr404957266b.28.1726057715139; Wed, 11 Sep 2024 05:28:35 -0700 (PDT) Message-ID: <398a5651-70fa-4c23-b8c7-4eb88aacea81@suse.com> Date: Wed, 11 Sep 2024 14:28:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 4/9] x86/HVM: drop stdvga's "gr[]" struct member From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: No consumers are left, hence the producer and the array itself can also go away. The static gr_mask[] is then orphaned and hence needs dropping, too. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -49,18 +49,6 @@ static const uint8_t sr_mask[8] = { (uint8_t)~0x00, }; -static const uint8_t gr_mask[9] = { - (uint8_t)~0xf0, /* 0x00 */ - (uint8_t)~0xf0, /* 0x01 */ - (uint8_t)~0xf0, /* 0x02 */ - (uint8_t)~0xe0, /* 0x03 */ - (uint8_t)~0xfc, /* 0x04 */ - (uint8_t)~0x84, /* 0x05 */ - (uint8_t)~0xf0, /* 0x06 */ - (uint8_t)~0xf0, /* 0x07 */ - (uint8_t)~0x00, /* 0x08 */ -}; - static int stdvga_outb(uint64_t addr, uint8_t val) { struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; @@ -82,12 +70,6 @@ static int stdvga_outb(uint64_t addr, ui s->gr_index = val; break; - case 0x3cf: /* graphics data register */ - rc = (s->gr_index < sizeof(s->gr)); - if ( rc ) - s->gr[s->gr_index] = val & gr_mask[s->gr_index]; - break; - default: rc = 0; break; --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -114,7 +114,6 @@ struct hvm_hw_stdvga { uint8_t sr_index; uint8_t sr[8]; uint8_t gr_index; - uint8_t gr[9]; struct page_info *vram_page[64]; /* shadow of 0xa0000-0xaffff */ spinlock_t lock; }; From patchwork Wed Sep 11 12:28:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800398 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C94EDEE499F for ; Wed, 11 Sep 2024 12:29:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796525.1206163 (Exim 4.92) (envelope-from ) id 1soMSt-0006ao-ER; Wed, 11 Sep 2024 12:28:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796525.1206163; Wed, 11 Sep 2024 12:28:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMSt-0006ah-Bg; Wed, 11 Sep 2024 12:28:55 +0000 Received: by outflank-mailman (input) for mailman id 796525; Wed, 11 Sep 2024 12:28:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMSs-0005SW-Be for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:28:54 +0000 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [2a00:1450:4864:20::229]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 685bc1aa-7039-11ef-a0b5-8be0dac302b0; Wed, 11 Sep 2024 14:28:53 +0200 (CEST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2f029e9c9cfso14268551fa.2 for ; Wed, 11 Sep 2024 05:28:53 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25d40e8csm608264866b.196.2024.09.11.05.28.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:28:53 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 685bc1aa-7039-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057733; x=1726662533; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=ZjgbdHdpvSXFn+03pMww2FrWmKqGQT7mS4EuJnkyK3Q=; b=VROixrpnRs3LV9Dw349VKYsqzfRpxYFral1XIZvYAph7LV8GrKpWHNkxyEeclvMDGe b0jLOkM0aHeUlicUCBgrpoXwosgVbMHakhF6zkvVVGOFIJ/ZirAEL2ViAoBQNLKrvgue TKhNJTQkbVqDBvfYgGq0rPlzzKcQT0GjrmCBB176LmHC17ftpRD4lAdjKmMbelGDZJ1U uGdQmX0+KVqWGACTZ48zzOGOtuoP1790GgbCB+ngV9AAo7LatkWTbN0wEpXUOupbNA48 LvrN/iS5uP2Ikt3zQcuR3L6oJSwCSBlhdgLLZJFd0cZcZSYTf0y4ErXsippA3MhOY9VQ xJaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057733; x=1726662533; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZjgbdHdpvSXFn+03pMww2FrWmKqGQT7mS4EuJnkyK3Q=; b=UAy3sFai/nDU+srn3M3cTh4k7HXTtQlbvFvMqHSfbBXUeYDFjH7OQJOg5+giZZRD3z PwTPVBD8Dvh6MjEqg3zjqnsZ46W99bSnprZsGTHzSdmtjggZZPVhbPsXy1+0yB+qdQSl gt/faloQfwl73r6rkdaUH5biYmLThqkpwkBK48q0NA1xTt5kmSK8O0XgqUV1qIpqPiX3 maOGofiNQM5xOOr+IHVbDKijImjP4/tfH4jbpYDBu3mLPAk3qA1g5aXlPrAIg1kpInit BcRTUYNUTxCwQlmujqDT7ANI2PF2dPpSG8wLrRfsknbMDtaAwRSUU2t4GEPYW7JNvQGw yHlA== X-Gm-Message-State: AOJu0YygHhZ2CXZMM48sydSoWHXxXBlvTveGOUgc8zu37E05mWf04WY7 CAUOabzJe5bgmEjkbRWUlSF57psbfvOoNHHmdOjLIR3LbWjV4N2vxijKhP+3cwlkS2rHNlN8UFw = X-Google-Smtp-Source: AGHT+IFmdgNr1l+Sgd2/FxCFNpHv/MTEGTB6qsTFi4+GFHrj8jX6GOftmryLhlOkHz2X7TMA6e4REA== X-Received: by 2002:a2e:9c95:0:b0:2f6:62a1:25ff with SMTP id 38308e7fff4ca-2f75a99f825mr105566741fa.28.1726057733287; Wed, 11 Sep 2024 05:28:53 -0700 (PDT) Message-ID: Date: Wed, 11 Sep 2024 14:28:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 5/9] x86/HVM: drop stdvga's "sr[]" struct member From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: No consumers are left, hence the producer and the array itself can also go away. The static sr_mask[] is then orphaned and hence needs dropping, too. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -37,18 +37,6 @@ #define VGA_MEM_BASE 0xa0000 #define VGA_MEM_SIZE 0x20000 -/* force some bits to zero */ -static const uint8_t sr_mask[8] = { - (uint8_t)~0xfc, - (uint8_t)~0xc2, - (uint8_t)~0xf0, - (uint8_t)~0xc0, - (uint8_t)~0xf1, - (uint8_t)~0xff, - (uint8_t)~0xff, - (uint8_t)~0x00, -}; - static int stdvga_outb(uint64_t addr, uint8_t val) { struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; @@ -60,12 +48,6 @@ static int stdvga_outb(uint64_t addr, ui s->sr_index = val; break; - case 0x3c5: /* sequencer data register */ - rc = (s->sr_index < sizeof(s->sr)); - if ( rc ) - s->sr[s->sr_index] = val & sr_mask[s->sr_index] ; - break; - case 0x3ce: /* graphics address register */ s->gr_index = val; break; --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -112,7 +112,6 @@ struct vpci_arch_msix_entry { struct hvm_hw_stdvga { uint8_t sr_index; - uint8_t sr[8]; uint8_t gr_index; struct page_info *vram_page[64]; /* shadow of 0xa0000-0xaffff */ spinlock_t lock; From patchwork Wed Sep 11 12:29:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5BF0EE499D for ; Wed, 11 Sep 2024 12:29:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796531.1206172 (Exim 4.92) (envelope-from ) id 1soMTH-0007B3-Lz; Wed, 11 Sep 2024 12:29:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796531.1206172; Wed, 11 Sep 2024 12:29:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMTH-0007Aw-Iy; Wed, 11 Sep 2024 12:29:19 +0000 Received: by outflank-mailman (input) for mailman id 796531; Wed, 11 Sep 2024 12:29:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMTF-0006QZ-Lj for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:29:17 +0000 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [2a00:1450:4864:20::533]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7587ce88-7039-11ef-99a1-01e77a169b0f; Wed, 11 Sep 2024 14:29:16 +0200 (CEST) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5c40aea5c40so450631a12.0 for ; Wed, 11 Sep 2024 05:29:16 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd467a7sm5299158a12.28.2024.09.11.05.29.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:29:15 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7587ce88-7039-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057755; x=1726662555; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=P1wMR2Ky0D0RnS1CWW7K/sEuXU8VTiVbDfI8MfIKm1k=; b=D2hQM92cbnida/3ir7FlXv1QdqeueVzJkB9I9KEAxy044pQ6/8wUvBn9maXsyv2udc xb3QPR9rtilZC5TqHj62IZyPMOTnvEClnR+RoIEYZFO2TZBebtBzmwx54Q9WC67BrTBw v2RoIVszIOeLHrctiDHxKAaHP+1gyBHCwdjnl8iUL1jb8AN0Q1kfiiQicT75VtZd6m/j IbkenL4pri5/CXFFRcXcoaST/lGZ6JY4qIJDZ1JpRdgsd/5PaRyPJ0OoHCdwnBLoui97 2iU2csnKvDMr19jmU/axRCHJwYhUSwaEzEfqtlgvTkJSpvRsQbZM4He0875V0TIcXKYV /GzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057755; x=1726662555; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=P1wMR2Ky0D0RnS1CWW7K/sEuXU8VTiVbDfI8MfIKm1k=; b=Ba4uD5aZvWQAD0SbZ2qbml5z2M4NROGOPfBeAnIS/KUqig22VZ/SVg08hMwvtW8IUu tbxOI5hhkHp0ZQmM8DwpMCxVk93rRrZngyjgzINC96iq2cdDLnvE0mDB4wHtQ89rqMss DcA/rFm5P3IOzpZe328XEzc9I9IkfxFvoLjthtdvrStxjRut3kUwvJxIizMTS9WfCGc+ 1efwFZhggikYR5swKUBtzDK/MNZwiHhJX9gzTB1CUkiJoR7tvspfSQhlBRrAsuXFmhcs WSB9OC/22wWxpD6kRFTia3jQWDj9a3yH8egpyOIZlVm+Mk6L/sILvAo/cNrc0X6ZS7x0 Hb2g== X-Gm-Message-State: AOJu0YxH4XzLp+AucLYld/6dTIQNhBOK3fB1boh+ff3guzzZyuFmHLG5 xIQIqVNmzCfpx+RvH6EXL+1kjPwiSdGIhNUfUd+5+fCxobfZRfyxyHFgtVNhShJD0/RMuGetEQ8 = X-Google-Smtp-Source: AGHT+IG9u2CdxuO+LSS0wREJWb2P7n3FmHd/ldLRyyc0oFEeWfNT94Sj/OO4v6pgFjA/nWAYwsSSXw== X-Received: by 2002:a05:6402:50c8:b0:5c2:e888:4cf4 with SMTP id 4fb4d7f45d1cf-5c40159115dmr6896227a12.0.1726057755447; Wed, 11 Sep 2024 05:29:15 -0700 (PDT) Message-ID: <1334352a-4f10-4f32-962b-834db166a0c3@suse.com> Date: Wed, 11 Sep 2024 14:29:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 6/9] x86/HVM: drop stdvga's "{g,s}r_index" struct members From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: No consumers are left, hence the producer and the fields themselves can also go away. stdvga_outb() is then useless, rendering stdvga_out() useless as well. Hence the entire I/O port intercept can go away. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -37,62 +37,6 @@ #define VGA_MEM_BASE 0xa0000 #define VGA_MEM_SIZE 0x20000 -static int stdvga_outb(uint64_t addr, uint8_t val) -{ - struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; - int rc = 1; - - switch ( addr ) - { - case 0x3c4: /* sequencer address register */ - s->sr_index = val; - break; - - case 0x3ce: /* graphics address register */ - s->gr_index = val; - break; - - default: - rc = 0; - break; - } - - return rc; -} - -static void stdvga_out(uint32_t port, uint32_t bytes, uint32_t val) -{ - switch ( bytes ) - { - case 1: - stdvga_outb(port, val); - break; - - case 2: - stdvga_outb(port + 0, val >> 0); - stdvga_outb(port + 1, val >> 8); - break; - - default: - break; - } -} - -static int cf_check stdvga_intercept_pio( - int dir, unsigned int port, unsigned int bytes, uint32_t *val) -{ - struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; - - if ( dir == IOREQ_WRITE ) - { - spin_lock(&s->lock); - stdvga_out(port, bytes, *val); - spin_unlock(&s->lock); - } - - return X86EMUL_UNHANDLEABLE; /* propagate to external ioemu */ -} - static int cf_check stdvga_mem_read( const struct hvm_io_handler *handler, uint64_t addr, uint32_t size, uint64_t *p_data) @@ -194,11 +138,6 @@ void stdvga_init(struct domain *d) { struct hvm_io_handler *handler; - /* Sequencer registers. */ - register_portio_handler(d, 0x3c4, 2, stdvga_intercept_pio); - /* Graphics registers. */ - register_portio_handler(d, 0x3ce, 2, stdvga_intercept_pio); - /* VGA memory */ handler = hvm_next_io_handler(d); --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -111,8 +111,6 @@ struct vpci_arch_msix_entry { }; struct hvm_hw_stdvga { - uint8_t sr_index; - uint8_t gr_index; struct page_info *vram_page[64]; /* shadow of 0xa0000-0xaffff */ spinlock_t lock; }; From patchwork Wed Sep 11 12:29:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800400 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77BD9EE499F for ; Wed, 11 Sep 2024 12:29:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796536.1206182 (Exim 4.92) (envelope-from ) id 1soMTe-0007kn-Tj; Wed, 11 Sep 2024 12:29:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796536.1206182; Wed, 11 Sep 2024 12:29:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMTe-0007kg-Qc; Wed, 11 Sep 2024 12:29:42 +0000 Received: by outflank-mailman (input) for mailman id 796536; Wed, 11 Sep 2024 12:29:41 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMTd-0006QZ-Ap for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:29:41 +0000 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [2a00:1450:4864:20::634]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 83a06bcf-7039-11ef-99a1-01e77a169b0f; Wed, 11 Sep 2024 14:29:39 +0200 (CEST) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a7a843bef98so526328366b.2 for ; Wed, 11 Sep 2024 05:29:39 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25ceaf4fsm606146266b.152.2024.09.11.05.29.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:29:38 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 83a06bcf-7039-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057779; x=1726662579; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=s3kc1/kslZn0fKyNCZ0xFJr0vc7t/1tBsHEf2vOZYws=; b=ZaSP5dcNM1vmdZK+NEnC2xpVwW8Wo/QMeqasSVEKOsfC4Jw7pykz086IVvUCzdPi28 hEzgnO1MjAtGXXLpRg5txVTTnPEBEsris8pkqE9SRITGaxUiI3rHV8Z2phD2KM+2Isfv PUEyBr+as3GDOoAogk3Ob8uIMJYWeb/SiuRJHlrn6p44XZ5BzvflPQVNa3bbiY4oYIOI rxXQnofVbXzXE8aGM7mahcs34bn972+xf5NfnL0l0qZPY8mcySr8Z9GJakgupSJAcx4m BS3m9hGKO3up8yi3FUzhJZFFUK2gmRJpPUxR7gK8phpYWKDq1JhXgE/Kl8cqFTRMCUVC 93QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057779; x=1726662579; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s3kc1/kslZn0fKyNCZ0xFJr0vc7t/1tBsHEf2vOZYws=; b=MBH1ZRZzoJmPopnLsFDWuap9t8EeVLjEy1AbkKiLGoEF13CwDby4M5KtX0s7o0xO2t tTpsJ1/7d0qhIK3pY10oR3PY53ZAfNbQk9njdbSS0PZOlFnxwndP+HxwPQkGM9PXuzsq 00X5CbpF53PGmeLNVoCB6jbkcz3XETndqGMH3WazC0EqhN838EHpsyWCHgcLGwwSyLTw rxhWgufCyxOHX0XfETQDpEb3z1/wNVh9ZU4JDruwX5gRvIcUF9IIzfm5Exkc3uaiecPx PhjV6OFBsk3UoWueW8kDi3h5uzvRUcRIrDuS6kif32Syc5FP5PeiFUwI10oN8YR4hEsG bSRA== X-Gm-Message-State: AOJu0YwQgN949WlL8EdR3uRFd2yNbGV2eU4dWfiXiMdWfyDXsb1RhXE1 AZ7b1JqQXqCSirusYZL2xhgKxKcrldUROvNxRYI9duwD+0L24FWJgHHx1/Zk5FG5TmjkPbWsfP4 = X-Google-Smtp-Source: AGHT+IH2mPVwIEJjReX5Hy/bSvfLEpDZ+Ycr2SHLEDAZk3i3lw2MeLOXwfShPYV9vOUgZnh2r9LrlA== X-Received: by 2002:a17:907:6eaa:b0:a86:92a5:247a with SMTP id a640c23a62f3a-a8ffab294eamr357780566b.17.1726057779024; Wed, 11 Sep 2024 05:29:39 -0700 (PDT) Message-ID: <96bc4615-fd26-40db-8feb-f6ece4584550@suse.com> Date: Wed, 11 Sep 2024 14:29:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 7/9] x86/HVM: drop stdvga's "vram_page[]" struct member From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: No uses are left, hence its setup, teardown, and the field itself can also go away. stdvga_deinit() is then empty and can be dropped as well. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- I have no idea whether in the tool stack some memory calculations would want adjusting, to account for the 256k less that a HVM domain now needs. --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -700,7 +700,6 @@ int hvm_domain_initialise(struct domain return 0; fail2: - stdvga_deinit(d); vioapic_deinit(d); fail1: if ( is_hardware_domain(d) ) @@ -763,7 +762,6 @@ void hvm_domain_destroy(struct domain *d if ( hvm_funcs.domain_destroy ) alternative_vcall(hvm_funcs.domain_destroy, d); - stdvga_deinit(d); vioapic_deinit(d); XFREE(d->arch.hvm.pl_time); --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -116,8 +116,7 @@ static const struct hvm_io_ops stdvga_me void stdvga_init(struct domain *d) { struct hvm_hw_stdvga *s = &d->arch.hvm.stdvga; - struct page_info *pg; - unsigned int i; + struct hvm_io_handler *handler; if ( !has_vvga(d) ) return; @@ -125,47 +124,15 @@ void stdvga_init(struct domain *d) memset(s, 0, sizeof(*s)); spin_lock_init(&s->lock); - for ( i = 0; i != ARRAY_SIZE(s->vram_page); i++ ) + /* VGA memory */ + handler = hvm_next_io_handler(d); + if ( handler ) { - pg = alloc_domheap_page(d, MEMF_no_owner); - if ( pg == NULL ) - break; - s->vram_page[i] = pg; - clear_domain_page(page_to_mfn(pg)); - } - - if ( i == ARRAY_SIZE(s->vram_page) ) - { - struct hvm_io_handler *handler; - - /* VGA memory */ - handler = hvm_next_io_handler(d); - - if ( handler == NULL ) - return; - handler->type = IOREQ_TYPE_COPY; handler->ops = &stdvga_mem_ops; } } -void stdvga_deinit(struct domain *d) -{ - struct hvm_hw_stdvga *s = &d->arch.hvm.stdvga; - int i; - - if ( !has_vvga(d) ) - return; - - for ( i = 0; i != ARRAY_SIZE(s->vram_page); i++ ) - { - if ( s->vram_page[i] == NULL ) - continue; - free_domheap_page(s->vram_page[i]); - s->vram_page[i] = NULL; - } -} - /* * Local variables: * mode: C --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -111,12 +111,10 @@ struct vpci_arch_msix_entry { }; struct hvm_hw_stdvga { - struct page_info *vram_page[64]; /* shadow of 0xa0000-0xaffff */ spinlock_t lock; }; void stdvga_init(struct domain *d); -void stdvga_deinit(struct domain *d); extern void hvm_dpci_msi_eoi(struct domain *d, int vector); From patchwork Wed Sep 11 12:29:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB75AEE499D for ; Wed, 11 Sep 2024 12:37:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796557.1206209 (Exim 4.92) (envelope-from ) id 1soMb6-0001ov-8h; Wed, 11 Sep 2024 12:37:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796557.1206209; Wed, 11 Sep 2024 12:37:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMb6-0001nx-1E; Wed, 11 Sep 2024 12:37:24 +0000 Received: by outflank-mailman (input) for mailman id 796557; Wed, 11 Sep 2024 12:37:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMTs-0005SW-Az for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:29:56 +0000 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [2a00:1450:4864:20::535]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8d3788be-7039-11ef-a0b5-8be0dac302b0; Wed, 11 Sep 2024 14:29:55 +0200 (CEST) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5c40aea5c40so451924a12.0 for ; Wed, 11 Sep 2024 05:29:55 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd76f8bsm5257243a12.76.2024.09.11.05.29.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:29:54 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8d3788be-7039-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057795; x=1726662595; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=F+7xG8Xlt7QQ6wJoGrrTXnXBxG7ZbwFf1eyCKqS9od0=; b=RmIkAsnV+UGfJFR6Uj09vEmB1hlE1Qrk5g4p9TalrazxJQhxlMHYHzeo0fuu7+G5C5 oIDfsv1Abdy8NjUVqU6ILqv9gmtYEDCNPA+hQ8TIeWQBBNiA96Ct2/f0iFBSO2WLifCS az18EBB+nOvQs79x7zam6KRS8IE5iiE9/eWBr9xM9lZZgkousKaBoHto6ZZBrKZRCoR+ culcZAaB57omnQKP/3DCoXH/ZXZ/k90nabGA2aKkddblQ1wrmTA62/3qRHeWA8s0ve8Z QwYNYosKXB0hjYLomDhNIqdi3T9QhPi1BDeMc708o/DbsvtEgDkZ+Lsf3E82Voj1HPnm avOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057795; x=1726662595; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=F+7xG8Xlt7QQ6wJoGrrTXnXBxG7ZbwFf1eyCKqS9od0=; b=IRn0xeeDWBi0nxJ1mniR3MeEjCXpLlEPtKGB1HFp9elHMEvvwTf/OimCnVZXA8kJ9k DWhv+BJby1mGch1Fs6crCzlyW7trSoTpBkCi0QsscBW/KGUHbXmO2LZePN+HXkpiXKQ/ n5J3UHsppSzXvsxs9Iwxizm21c0TIYhTzI21JdkAmqFRJc+0qvNkYnsm+OEN8Af1adfz yTIZJ4+rOuQqtU4ewBKY7qMSLjG89PJSGKydPZS2I3a3/Ms8MnnN0JhzWZc8aVN88KH9 5Pi5KPa3GajSK9stvo0181FaKnzPmknTfNSXt3ITFI8sGKt4GQz1BEkhC6KZ9SX0Q1UB 7kVg== X-Gm-Message-State: AOJu0YzsYuegXB21dYRVf9owEIVZDoi4oz1djS1eJy47jvo3I/RSUPTS /bABeZfkn/Eb+qNby/9IFD09RJKM4hFFN/FGMLMnouigRjZ7qNktkZdgSpkR4/8j82yI/41bT28 = X-Google-Smtp-Source: AGHT+IHBc9iPZBTrQE5hJh+YPMuQzCvCvSRO86wsMzJe8fmttkJ/WvW8eyN/vxAWmewbNAhyx0JcqQ== X-Received: by 2002:a05:6402:27d4:b0:5c4:aea:5833 with SMTP id 4fb4d7f45d1cf-5c40aea5cbamr3381668a12.18.1726057795026; Wed, 11 Sep 2024 05:29:55 -0700 (PDT) Message-ID: <716868cb-6a94-4470-a1a5-a4b5994e8195@suse.com> Date: Wed, 11 Sep 2024 14:29:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 8/9] x86/HVM: drop stdvga's "lock" struct member From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: No state is left to protect. It being the last field, drop the struct itself as well. Similarly for then ending up empty, drop the .complete handler. Suggested-by: Andrew Cooper Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper with one change. --- v2: New. --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -69,8 +69,6 @@ static int cf_check stdvga_mem_write( static bool cf_check stdvga_mem_accept( const struct hvm_io_handler *handler, const ioreq_t *p) { - struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; - /* * The range check must be done without taking the lock, to avoid * deadlock when hvm_mmio_internal() is called from @@ -80,50 +78,31 @@ static bool cf_check stdvga_mem_accept( (ioreq_mmio_last_byte(p) >= (VGA_MEM_BASE + VGA_MEM_SIZE)) ) return 0; - spin_lock(&s->lock); - if ( p->dir != IOREQ_WRITE || p->data_is_ptr || p->count != 1 ) { /* * Only accept single direct writes, as that's the only thing we can * accelerate using buffered ioreq handling. */ - goto reject; + return false; } - /* s->lock intentionally held */ - return 1; - - reject: - spin_unlock(&s->lock); - return 0; -} - -static void cf_check stdvga_mem_complete(const struct hvm_io_handler *handler) -{ - struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; - - spin_unlock(&s->lock); + return true; } static const struct hvm_io_ops stdvga_mem_ops = { .accept = stdvga_mem_accept, .read = stdvga_mem_read, .write = stdvga_mem_write, - .complete = stdvga_mem_complete }; void stdvga_init(struct domain *d) { - struct hvm_hw_stdvga *s = &d->arch.hvm.stdvga; struct hvm_io_handler *handler; if ( !has_vvga(d) ) return; - memset(s, 0, sizeof(*s)); - spin_lock_init(&s->lock); - /* VGA memory */ handler = hvm_next_io_handler(d); if ( handler ) --- a/xen/arch/x86/include/asm/hvm/domain.h +++ b/xen/arch/x86/include/asm/hvm/domain.h @@ -72,7 +72,6 @@ struct hvm_domain { struct hvm_hw_vpic vpic[2]; /* 0=master; 1=slave */ struct hvm_vioapic **vioapic; unsigned int nr_vioapics; - struct hvm_hw_stdvga stdvga; /* * hvm_hw_pmtimer is a publicly-visible name. We will defer renaming --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -110,10 +110,6 @@ struct vpci_arch_msix_entry { int pirq; }; -struct hvm_hw_stdvga { - spinlock_t lock; -}; - void stdvga_init(struct domain *d); extern void hvm_dpci_msi_eoi(struct domain *d, int vector); From patchwork Wed Sep 11 12:30:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13800478 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A12C3EE499F for ; Wed, 11 Sep 2024 12:37:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.796556.1206202 (Exim 4.92) (envelope-from ) id 1soMb5-0001mT-Uj; Wed, 11 Sep 2024 12:37:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 796556.1206202; Wed, 11 Sep 2024 12:37:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMb5-0001mM-Ru; Wed, 11 Sep 2024 12:37:23 +0000 Received: by outflank-mailman (input) for mailman id 796556; Wed, 11 Sep 2024 12:37:22 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1soMUN-0005SW-4i for xen-devel@lists.xenproject.org; Wed, 11 Sep 2024 12:30:27 +0000 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [2a00:1450:4864:20::52d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9f98a40c-7039-11ef-a0b5-8be0dac302b0; Wed, 11 Sep 2024 14:30:26 +0200 (CEST) Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5c3d2f9f896so7362481a12.1 for ; Wed, 11 Sep 2024 05:30:26 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd76ef0sm5363597a12.63.2024.09.11.05.30.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2024 05:30:25 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9f98a40c-7039-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1726057826; x=1726662626; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=E/VQYJObNEPJuFiaAletJaE9AeVmIbCDaMEcMMCWqBY=; b=IMQP/f+5X6bEi8aP5gUHuOfkirROK9CW/kxaKInqoOGb355MlSe4zA8eXdzR46PKOg Y+rJqNK6kw+6gs48//XO1dSiOtmeuCTLGgG6798QnDrsLoBOiHNrRH5vBqlD0O2BNBLi rxXtC6oR4mdCTGGpYsG7jTHn/V3OrqIkZC6wPU8OCxf3nRSX7ujy1FkJMxsxtylZH+aT rPEXYulVEoWG7u0Pwd3yr7+qgqRyJKLDKNNYvsMLm8zAH++NW+P+t2L6ItuQDXuj3Ob5 kV4ljG9nczQw1Us20QN6gq3WiECN5CvEDvXdQD+1dcASUaBo/q9DiaZYco+rIt+gnlmh tpZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726057826; x=1726662626; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E/VQYJObNEPJuFiaAletJaE9AeVmIbCDaMEcMMCWqBY=; b=A8rFNOJ4U5JYuxViZ+HjB3vdK2torImCaQAwHz8slt75mponceMOi2zKWk2c+6INl8 Tw1amKsUZ2DX3JtXbpR3tZU8jQMjSM9biwV4J6BGkCbC9UbURVv48UM4qk3eP+CUud+C NgjmRtfAbwzA3dKtWO2TQAhZS0qgOeFCreM/BZw7grFl3h8WR7icRW1RYF09UVhIR1dB rUiIwtOMyPKWZnRppislic+uFV8umW0ZA2YHlcgEUa7ViWojmSeZqTD67iruqn2PVYrs r+cZFynsX3mOyYfColoKnbTDvtKW0eL+9JinHDfF4m+lNikcBjpBFEhK7UX2115yDpHO +Zew== X-Gm-Message-State: AOJu0Yx6QxtK8/i5TD8j+S8VeX9m+0jmVx8A/zKF1L81rXxrgidO9Oyd Ndm/zo4hTamNp3eNxmTepHb+RwO4NVSacEW2H+q7ReluOopEQn2LhKkp3byE+dhmMjTK7EmstNM = X-Google-Smtp-Source: AGHT+IGlT/+XpcVikT9tpnst1rfGQd3lCpyul4pBf+CxxFz5rfPGloVQ/YNZyBF6afxQLQGB8QC8MQ== X-Received: by 2002:a05:6402:254a:b0:5c3:d1ce:261c with SMTP id 4fb4d7f45d1cf-5c3e9630f87mr9255606a12.13.1726057825990; Wed, 11 Sep 2024 05:30:25 -0700 (PDT) Message-ID: Date: Wed, 11 Sep 2024 14:30:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 9/9] x86/HVM: drop .complete hook for intercept handling From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= References: Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: No user of the hook exists anymore. While touching hvm_mmio_internal() also make direction of the request explicit - it only so happens that IOREQ_WRITE is zero. Yet it being a write is imperative for stdvga.c to "accept" the request. Requested-by: Andrew Cooper Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- v2: New. --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -240,21 +240,13 @@ static const struct hvm_io_handler *hvm_ int hvm_io_intercept(ioreq_t *p) { const struct hvm_io_handler *handler; - const struct hvm_io_ops *ops; - int rc; handler = hvm_find_io_handler(p); if ( handler == NULL ) return X86EMUL_UNHANDLEABLE; - rc = hvm_process_io_intercept(handler, p); - - ops = handler->ops; - if ( ops->complete != NULL ) - ops->complete(handler); - - return rc; + return hvm_process_io_intercept(handler, p); } struct hvm_io_handler *hvm_next_io_handler(struct domain *d) @@ -326,25 +318,15 @@ bool relocate_portio_handler(struct doma bool hvm_mmio_internal(paddr_t gpa) { - const struct hvm_io_handler *handler; - const struct hvm_io_ops *ops; ioreq_t p = { .type = IOREQ_TYPE_COPY, .addr = gpa, .count = 1, .size = 1, + .dir = IOREQ_WRITE, /* for stdvga */ }; - handler = hvm_find_io_handler(&p); - - if ( handler == NULL ) - return 0; - - ops = handler->ops; - if ( ops->complete != NULL ) - ops->complete(handler); - - return 1; + return hvm_find_io_handler(&p); } /* --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -56,13 +56,11 @@ typedef int (*hvm_io_write_t)(const stru uint64_t data); typedef bool (*hvm_io_accept_t)(const struct hvm_io_handler *handler, const ioreq_t *p); -typedef void (*hvm_io_complete_t)(const struct hvm_io_handler *handler); struct hvm_io_ops { hvm_io_accept_t accept; hvm_io_read_t read; hvm_io_write_t write; - hvm_io_complete_t complete; }; int hvm_process_io_intercept(const struct hvm_io_handler *handler,