From patchwork Tue Sep 10 14:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13798627 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 C7E5CEB64DE for ; Tue, 10 Sep 2024 14:39:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795694.1205140 (Exim 4.92) (envelope-from ) id 1so21o-0001tY-N4; Tue, 10 Sep 2024 14:39:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795694.1205140; Tue, 10 Sep 2024 14:39:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1so21o-0001tR-KE; Tue, 10 Sep 2024 14:39:36 +0000 Received: by outflank-mailman (input) for mailman id 795694; Tue, 10 Sep 2024 14:39:35 +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 1so21n-0001bT-DI for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 14:39:35 +0000 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [2a00:1450:4864:20::233]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7ebd2ceb-6f82-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 16:39:33 +0200 (CEST) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2f762de00e5so34228641fa.3 for ; Tue, 10 Sep 2024 07:39:33 -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-5c3ebd76fc4sm4375114a12.78.2024.09.10.07.39.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:39:32 -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: 7ebd2ceb-6f82-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725979173; x=1726583973; 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=WaFqEYBzQE2LZt1yiChdk7M33TQSnb66DPUTwVLJkXU=; b=EA4YfYQTs3jhHxD1jaxlM87VUbWYRi8iM9rknms/11PGjaf2NwgGbapUs2Qtp5q8v1 7lP3advB+iH1khvT8LW/MVV0opGHDLlgDz23rdX3OZPKwdsv5TAr2Eud8FSjjJ2nSgUU AVivvrfg4y3UwSOH92h+G9PdOq3naejA4eZYwnlG9twdFbynVebdpNp5Ewa7gpDEmdaV m+ns0XoDKzKHxVudxwBkgQzz8Uj83dljnmiuUoBaaEYAfxxI89qjAYcMEFdymHaAEpyV R44JU6tojJlf5WWOGbyWB/GLIEkXYOn6nRVgi4j3nm7vvJPC84C7W8YcYrvdxEMAfX0i 7bDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725979173; x=1726583973; 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=WaFqEYBzQE2LZt1yiChdk7M33TQSnb66DPUTwVLJkXU=; b=Xf8J7QRBtt1L4D1dJSPu6nW/GXUipOsLNgRUz8FGmc5cpbI9fDRJ2w8Dl4HKnaQrYW TQTrkQVnMAG+ZnOYkncUO+GccI6zxYu2iuWsf0K/vJYgi7tUJU6V+e+tbTtbn0YcAjpu NO2h5JKTPJUrLc/0waXmeLP7G2FYTjLszY5zi/q34Z5ITrYnKeNS3cNrwD/FYdd7Zck8 MKoIsSiF0HL1QkaWPIaY8+k5OjD6a6zOgAFKMOlm2aHIB06bLVS5JrS/AW0lopXdgsl+ hil7Ux091jed1H1+iSdmNK7+BaCmXVlCMWKJxIjHjF9THLw/a9yTH8Wg0EEZ/m5eaZw+ IVZQ== X-Gm-Message-State: AOJu0Yx90agrYH4Zl7wFtms7PboNXGrNLOAJrgzJK6S3j8URS81JcwAQ zg8mC6RJb1DcT0PLiyE5PiUHSS9OkdFSFHir2EOoncHpUvD9R++NB9JVwwPbrLc/sRPB0AgDtdE = X-Google-Smtp-Source: AGHT+IFSCzl4iBLY+y+n9/z19AaESU/S34kdkDp2DtKEavTSy+WC3SyBDXLlXFJ6wIKYZ2GzrOMFiA== X-Received: by 2002:a2e:b8c7:0:b0:2ef:22ad:77b5 with SMTP id 38308e7fff4ca-2f751f69abcmr114228481fa.29.1725979172793; Tue, 10 Sep 2024 07:39:32 -0700 (PDT) Message-ID: Date: Tue, 10 Sep 2024 16:39:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 1/7] x86/HVM: drop stdvga's "cache" 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: As of 68e1183411be ("libxc: introduce a xc_dom_arch for hvm-3.0-x86_32 guests") caching mode is disabled for HVM domains from start-of-day, due the disabling being unconditional in hvm/save.c:arch_hvm_load(). With that the field is useless, and can be dropped. Drop the helper functions manipulating / checking as well right away, but leave the use sites of stdvga_cache_is_enabled() with the hard-coded result the function would have produced, to aid validation of subsequent dropping of further code. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/hvm/save.c +++ b/xen/arch/x86/hvm/save.c @@ -69,9 +69,6 @@ static void arch_hvm_load(struct domain /* Time when restore started */ d->arch.hvm.sync_tsc = rdtsc(); - - /* VGA state is not saved/restored, so we nobble the cache. */ - d->arch.hvm.stdvga.cache = STDVGA_CACHE_DISABLED; } /* List of handlers for various HVM save and restore types */ --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -100,37 +100,6 @@ static void vram_put(struct hvm_hw_stdvg unmap_domain_page(p); } -static void stdvga_try_cache_enable(struct hvm_hw_stdvga *s) -{ - /* - * Caching mode can only be enabled if the the cache has - * never been used before. As soon as it is disabled, it will - * become out-of-sync with the VGA device model and since no - * mechanism exists to acquire current VRAM state from the - * device model, re-enabling it would lead to stale data being - * seen by the guest. - */ - if ( s->cache != STDVGA_CACHE_UNINITIALIZED ) - return; - - gdprintk(XENLOG_INFO, "entering caching mode\n"); - s->cache = STDVGA_CACHE_ENABLED; -} - -static void stdvga_cache_disable(struct hvm_hw_stdvga *s) -{ - if ( s->cache != STDVGA_CACHE_ENABLED ) - return; - - gdprintk(XENLOG_INFO, "leaving caching mode\n"); - s->cache = STDVGA_CACHE_DISABLED; -} - -static bool stdvga_cache_is_enabled(const struct hvm_hw_stdvga *s) -{ - return s->cache == STDVGA_CACHE_ENABLED; -} - static int stdvga_outb(uint64_t addr, uint8_t val) { struct hvm_hw_stdvga *s = ¤t->domain->arch.hvm.stdvga; @@ -170,7 +139,6 @@ static int stdvga_outb(uint64_t addr, ui if ( !prev_stdvga && s->stdvga ) { gdprintk(XENLOG_INFO, "entering stdvga mode\n"); - stdvga_try_cache_enable(s); } else if ( prev_stdvga && !s->stdvga ) { @@ -468,7 +436,7 @@ static int cf_check stdvga_mem_write( }; struct ioreq_server *srv; - if ( !stdvga_cache_is_enabled(s) || !s->stdvga ) + if ( true || !s->stdvga ) goto done; /* Intercept mmio write */ @@ -536,18 +504,12 @@ static bool cf_check stdvga_mem_accept( * 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 and, since we are rejecting an I/O, we must invalidate the - * cache. - * Single-cycle write transactions are accepted even if the cache is - * not active since we can assert, when in stdvga mode, that writes - * to VRAM have no side effect and thus we can try to buffer them. + * I/O. */ - stdvga_cache_disable(s); - goto reject; } else if ( p->dir == IOREQ_READ && - (!stdvga_cache_is_enabled(s) || !s->stdvga) ) + (true || !s->stdvga) ) goto reject; /* s->lock intentionally held */ --- a/xen/arch/x86/include/asm/hvm/io.h +++ b/xen/arch/x86/include/asm/hvm/io.h @@ -110,19 +110,12 @@ struct vpci_arch_msix_entry { int pirq; }; -enum stdvga_cache_state { - STDVGA_CACHE_UNINITIALIZED, - STDVGA_CACHE_ENABLED, - STDVGA_CACHE_DISABLED -}; - struct hvm_hw_stdvga { uint8_t sr_index; uint8_t sr[8]; uint8_t gr_index; uint8_t gr[9]; bool stdvga; - enum stdvga_cache_state cache; uint32_t latch; struct page_info *vram_page[64]; /* shadow of 0xa0000-0xaffff */ spinlock_t lock; From patchwork Tue Sep 10 14:40:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13798628 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 5339CEB64DE for ; Tue, 10 Sep 2024 14:40:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795698.1205150 (Exim 4.92) (envelope-from ) id 1so22I-0003Kn-0n; Tue, 10 Sep 2024 14:40:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795698.1205150; Tue, 10 Sep 2024 14:40:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1so22H-0003Kg-Rk; Tue, 10 Sep 2024 14:40:05 +0000 Received: by outflank-mailman (input) for mailman id 795698; Tue, 10 Sep 2024 14:40:05 +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 1so22H-0001bT-Cp for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 14:40:05 +0000 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [2a00:1450:4864:20::52e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 90c331a7-6f82-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 16:40:03 +0200 (CEST) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5c26311c6f0so7009139a12.3 for ; Tue, 10 Sep 2024 07:40:03 -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-5c3ebd8c4c6sm4339178a12.86.2024.09.10.07.40.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:40:02 -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: 90c331a7-6f82-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725979203; x=1726584003; 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=JtF6rX15d8QXjen/iS3ft5RyDQCEqObl6NadGkjDRxw=; b=fcBuJULcHGZ/hcW5X1C04UxOFq7NeoG11mNZZTMsu8j0IVGNMccRil/B8sJI8MrcwI b5/g95TmkdZ5ttGZJch4iUkaa26XdOcIMPsBrIDo6Chmc1Z8NX8elY4PVX27diLdKY7u LqE55N2STItwuQHdgagbUC4rbhpoqliHLvHEz3fWvSTjpw1LK0zRMK1qs9EonvjdBRVq tv61TvWANEw0N6pr0sdUN7hI3nR8h/RcAksfc6HzeZp9hEESuyxnL/r5ZY1z67hxHdrX egWF6wr7JTxNz3d0Iys97HZTf9HwUvNjOIMIc95AZ5jqJmP48IRpIWxRZjIQxYLMjpby YCYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725979203; x=1726584003; 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=JtF6rX15d8QXjen/iS3ft5RyDQCEqObl6NadGkjDRxw=; b=d6QSBmkg+y/LZKaBEjtF+xXczPCP6k5es+d2qjLW7Q7DMMiVCvEtswnAHzZ5UOQDtr eZgzGEe7z5GSVmrfxdcOxuXJGdeKnkacmXtrpaIqoU+4ntVYKeYsdjIO8wvNJjGzJ6wH ZRY0FjBAu+RM9H3jkMRyoF2mcmFl75SCGFY2vOqClaxMM5LU4gEZM77E6dPGZyIko9m6 CYkHEYAHPDh1ozXQvTNOUhy6QYMpnOAeLpIL7T44sZot0bn8XhNG5t50XFicCQ1lulIV ybLTaj3Q9F/BxKMJRdwgSjLNYqnRpgcJwsz408E7WiBK3s3Zcu/QGhMzvtRIGsEXes15 pBVg== X-Gm-Message-State: AOJu0YzJMJLI1gojCh1rAI3DDgQRFkUH/yYLgBqt3nkiciFHSBrcq9EV I8zpGoJudLSquZwLpmtDtuJggdX/pV9XSIQbK/HZdQFB3xOFiPmvUNnT+V+Rc0XzBlOntahRlJU = X-Google-Smtp-Source: AGHT+IHnI3SrYGR6O7LNUw/aJlCsNCoWnLkRrnmBDU9XXILtpTC5z90FwZZT5TaGg4cLwAGdosuKKQ== X-Received: by 2002:a05:6402:3894:b0:5c2:6c2d:3fb3 with SMTP id 4fb4d7f45d1cf-5c3dc7cc3fcmr8017407a12.36.1725979203038; Tue, 10 Sep 2024 07:40:03 -0700 (PDT) Message-ID: <836afb28-581c-4ab8-a0a9-badf29a51b5e@suse.com> Date: Tue, 10 Sep 2024 16:40:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/7] 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 (debugging) log messages. 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 --- 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,17 @@ 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->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. + * I/O. And of course we have to reject all reads, for not being + * able to service them. */ 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 Tue Sep 10 14:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13798629 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 67B42ECE564 for ; Tue, 10 Sep 2024 14:40:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795701.1205160 (Exim 4.92) (envelope-from ) id 1so22b-0003tF-6k; Tue, 10 Sep 2024 14:40:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795701.1205160; Tue, 10 Sep 2024 14:40:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1so22b-0003t8-3T; Tue, 10 Sep 2024 14:40:25 +0000 Received: by outflank-mailman (input) for mailman id 795701; Tue, 10 Sep 2024 14:40:24 +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 1so22a-0001bT-3H for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 14:40:24 +0000 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [2a00:1450:4864:20::130]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9bb3181e-6f82-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 16:40:22 +0200 (CEST) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-53661a131b4so3778507e87.1 for ; Tue, 10 Sep 2024 07:40:22 -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-a8d25d40b2esm491089366b.194.2024.09.10.07.40.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:40:21 -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: 9bb3181e-6f82-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725979222; x=1726584022; 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=k0ozxlmym8hxnxnury+fqQXwyDDPs3t3c1Ygv0tRIH4=; b=On92KTqqUT96tOT/0XQci4AeeaU7OzczRR3de5ubr3zmag75Q2v7VMTPeRqNI6LVCp vcqGCnzPLLXZj4EJlZ71WpC15tiUqGF+/x1DUDcayP8MVgIC0uSyOQYZpY+LvNfQrJ56 EPUlP3vLsTHuBNiC1kvTVWJZOSV7SFIVs/aURgkyUEG1vo+rQbBQO/yI2iF5YYB+/pNQ dC7CoinzCbdWNH54+4bZC9cCaqhE1x0D9sJACBXy1UNwTjhOAMEgRn0OD6arzwzMOOJU KdVSVHrNIZ6JszU1vOs3kkzSbt9Bdup38JlXp2UHdUzVezc2S4YjQhckzvck8urdEgYJ lIVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725979222; x=1726584022; 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=k0ozxlmym8hxnxnury+fqQXwyDDPs3t3c1Ygv0tRIH4=; b=SYmbhdatjkOcSh8s3CpQOHOROtN2V9DnR9WEyVNX/uvhu9GP3UQ2uUYEWA2+ze+BLU xFoQQJLuvfEfK6yxIK5zQs8uhRvTh5BTD9QN0b3CRxUv5x+zUxOI0UEWjHQ8PYmcHoyK lIH8wm88nfgJzBpq7lHXWP5Xdnz7GiVvZnopbYyjDlgKV6cn6zIGs5FB3g7sC0EstDcv UvqMkYCXmtJJe8f6+S1R4C7xEK9mTXhHpffgfoKSTvNUskEKN7KJUbZ0Bw2WNJCjBWuV xMhrmlZ6xGSMCMqwQxo+SenfJXJXp4ggRTTgMSVcZnEKkebgwkFv8jaIVaeoBwiiQR/x ZfAQ== X-Gm-Message-State: AOJu0Yw0bKOJxKMBkFK+mQ9e0rzjKGrXhEOnJMefm9APBxZQFNsWe5pp 8g8faK0vmQpNpSMLBhZOKyT2B2eViruyqy/n7hV9IqB8wlhmK9YqWAifV7kah4IuyfU+AmL7U3w = X-Google-Smtp-Source: AGHT+IE1L3n/lLhmllQ4i1TSuqOBGHxMd31IBO3D3fEdCdw2MnlFK+yZeys1e8BdTPcH7zMuUCBN5Q== X-Received: by 2002:a05:6512:1103:b0:52e:9ac6:a20f with SMTP id 2adb3069b0e04-536587fc91amr10104524e87.37.1725979221530; Tue, 10 Sep 2024 07:40:21 -0700 (PDT) Message-ID: Date: Tue, 10 Sep 2024 16:40:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 3/7] 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 Tue Sep 10 14:40:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13798630 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 7EC34EB64DE for ; Tue, 10 Sep 2024 14:40:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795704.1205170 (Exim 4.92) (envelope-from ) id 1so22t-0004OU-Gh; Tue, 10 Sep 2024 14:40:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795704.1205170; Tue, 10 Sep 2024 14:40:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1so22t-0004ON-D6; Tue, 10 Sep 2024 14:40:43 +0000 Received: by outflank-mailman (input) for mailman id 795704; Tue, 10 Sep 2024 14:40:42 +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 1so22s-0003oG-Bp for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 14:40:42 +0000 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [2a00:1450:4864:20::62f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id a7854523-6f82-11ef-a0b5-8be0dac302b0; Tue, 10 Sep 2024 16:40:42 +0200 (CEST) Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a8d0d0aea3cso537780866b.3 for ; Tue, 10 Sep 2024 07:40: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 a640c23a62f3a-a8d25830f09sm486005566b.31.2024.09.10.07.40.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:40:41 -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: a7854523-6f82-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725979241; x=1726584041; 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=EtyWpgBFgoc9BlhXkBCsVjBPxqDYbXt4OGznf+FjOTo=; b=Q2oaTxTW3P91OqLqU7AWBdg5+/L6Yz9Nw1fFVBAqvMmoXSwUEeSHwisnFcitGcDJD1 g0J+f9kfC+rY2L71w28JVHVBMXb7SlROpHK6TF4CswJIac0s4rqRk1Y7wg5DtgS4ohEf e0dsBPjV92AzgIglDhm1OcS1Eng0XthNcwVc0Rcy76LGdOq3CNkKtbzXwQ4nk4ZYEqdJ flVJxH4pax0diITs2D5GmoVFMCYOBMHcyuHy/3UhvA6r4NHmAGmxnbbhbRWTUixYLKOc O6MiTpgfUj6BCXbsTxM3OoMuvxMJ9zKppXj3Aprri9/aQJCwqKGQzgekudFPB1oeOaBO J5MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725979241; x=1726584041; 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=EtyWpgBFgoc9BlhXkBCsVjBPxqDYbXt4OGznf+FjOTo=; b=WMDxIN44v4z5ZHlh82ztmjb7HEp7GvQY1PVMJ6zb7D5+RU1eijqZq4vtjlY/x29ape 7/jSQz/f10+t0dbPgwEB0Ewz0T0GjwldarFGa5oaEXAjAp343l0FXRg7yb76rhmM6ZWI Wa+MU9Eoi5OTwa8/b6w3T9sLJ12jx58/Me22PEbV+H9eN7Vxw5DahbIPgdcLgogsMgfe 7WFOSWKRz2xRRWyBuo1nopjagzCO3mkycb8YsebViJqYTsUM0xhXsniiDm2U5eH4gpkM 7rchyEjwcHBKPhGW1Dg78XWCgu3lYOFowRP9e/KNxXtu+UOVo/VNytu2Tgi/SW7TOC68 5cjw== X-Gm-Message-State: AOJu0YwrJX78Zt+h/Mh6W2fPAcJCcwTmP/e2KzOB51n5lIOey9PEyM0Q Z0psLZYHeChEnXagvjnY0qCXLA5MB8SAFFE8uYxQe5mqjc+eBS4qMei1YWmzILy+z7RKs1iA2a0 = X-Google-Smtp-Source: AGHT+IE20oeMh8XF8jYQEAdn3un4pb8WuJLiK6TAO262rrRvKizHOWshbcpKYpt55EpkKBJZE+2Jgg== X-Received: by 2002:a17:907:9717:b0:a8d:2c00:949a with SMTP id a640c23a62f3a-a8ffaa983a6mr113293766b.9.1725979241248; Tue, 10 Sep 2024 07:40:41 -0700 (PDT) Message-ID: <0d1fa212-8f99-461f-92ef-0647ecfcc899@suse.com> Date: Tue, 10 Sep 2024 16:40:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 4/7] 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 Tue Sep 10 14:41: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: 13798631 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 92F11EB64DE for ; Tue, 10 Sep 2024 14:41:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795710.1205179 (Exim 4.92) (envelope-from ) id 1so23D-0004wU-Mp; Tue, 10 Sep 2024 14:41:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795710.1205179; Tue, 10 Sep 2024 14:41:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1so23D-0004wN-KJ; Tue, 10 Sep 2024 14:41:03 +0000 Received: by outflank-mailman (input) for mailman id 795710; Tue, 10 Sep 2024 14:41:02 +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 1so23C-0003oG-0S for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 14:41:02 +0000 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [2a00:1450:4864:20::536]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b33637fe-6f82-11ef-a0b5-8be0dac302b0; Tue, 10 Sep 2024 16:41:01 +0200 (CEST) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5c3d20eed0bso1017485a12.0 for ; Tue, 10 Sep 2024 07:41: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 4fb4d7f45d1cf-5c3ebd41bd4sm4323065a12.11.2024.09.10.07.41.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:41: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: b33637fe-6f82-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725979261; x=1726584061; 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=JlkqykofbAb7CGlOxkQ+0hyYPlFf+ytgSxl8MBR56jg=; b=E5TB94dyLzJbSxEO2rJweQor0vfMBjiiYQiJswIT76zjrL123xwUQOvOIHLmnajnzm 2NsiznBntsIjozsniFdaesNiAd/0gEcefrbAmWcI9TAiQtnGMdde2phMvvaox+ZPtJaf YbmWMXAobcNtsYBcliN1EC5cKUhqCGGn2+fssCy2vlPulgQb+8iJ3lbAYfXG3enYDz/m 23gM7QlIOJi9cRRtOdwfMI1nzbQbivNeEEAFBaY4Y+nDxpZkoU5UvyOxMBbG5m+e5UH+ FihMctPmoXDkHIC5eFmwbvIcQ8XRLUUwzjgV/6PR2AG5wWr0OKv2r2RqMQiGlTUXzg6T k+0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725979261; x=1726584061; 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=JlkqykofbAb7CGlOxkQ+0hyYPlFf+ytgSxl8MBR56jg=; b=PKTER21Ei26mT9G3f/23qNKEjCaR3QIyoi97zIUHG7N+oGaLXD/pnr8Z9BF/26UK1L WNMHVrgbBkc1jEGij0MZDkjgHzUjWG5+ZcN2lcWVkRGLuVKsNHyOfp5wbTQBeGfkrvfo frouth+Nq+FlnkA2SMUgb/C3u83uHgBuhpQLQkDwaTzqO+SfPSyTZtgwmRKP16+LAzRa FS+DCftGgayRMKHyqiohZhMWp7uwCl1umuwrRH+MoUwGjcHrZLruz0C8w87TgdFKzWTZ xQkaUXNO38hhgQqll0lMfmGM3Ko+nEenGgwEyr3L6Cyq4Kh+arfyeA8/cLaaQ3pMmDsa wCVg== X-Gm-Message-State: AOJu0YxBMLYjGGrV7OgpNfjdjaTiVaR+EKik0tjs8aNHqrVZT5KC+bCG DBklnlbvr+iIhqIunsOxtJOxiPo39BQPqh4nEfCXwPs0UN8trrDw54nnH0b1mM3aM+rr3FgxfaI = X-Google-Smtp-Source: AGHT+IHaV8/7AnGV27K8IamtuurkTRAiSMga1aJeTyhE1r+GAyT1gEzRBD48QRS21zNNHcIwOjSLng== X-Received: by 2002:a05:6402:5294:b0:5c2:6311:844f with SMTP id 4fb4d7f45d1cf-5c3dc79c527mr8322847a12.17.1725979260640; Tue, 10 Sep 2024 07:41:00 -0700 (PDT) Message-ID: Date: Tue, 10 Sep 2024 16:41:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 5/7] 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 Tue Sep 10 14:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13798679 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 6F2F0ECE564 for ; Tue, 10 Sep 2024 14:50:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795735.1205211 (Exim 4.92) (envelope-from ) id 1so2C6-0000E2-1o; Tue, 10 Sep 2024 14:50:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795735.1205211; Tue, 10 Sep 2024 14:50:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1so2C5-0000Dv-TD; Tue, 10 Sep 2024 14:50:13 +0000 Received: by outflank-mailman (input) for mailman id 795735; Tue, 10 Sep 2024 14:50:13 +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 1so23X-0004pU-7G for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 14:41:23 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bde4e3e4-6f82-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 16:41:19 +0200 (CEST) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a8d13b83511so447664866b.2 for ; Tue, 10 Sep 2024 07:41:19 -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-a8d25cf6a88sm486405666b.182.2024.09.10.07.41.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:41:18 -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: bde4e3e4-6f82-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725979279; x=1726584079; 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=+an3treqQP08FQ/4v2IVBHHJXdUo5OxtUySraZtU00s=; b=WWwGVS1FzMJ/Tp0id/F3+q5kpu1CqdJk/NytjTKpFQWVwHuCeNfJv/HBfMnVtLuUs8 uI3A2Dy+GexWZEFONjHPHh5FYWC5Wih5WaQ3Xh5grWRRNd1gTJiiZrjHd/9HhuXWKmN6 bWulY2mQsAVGg8vQfWONpce7aER/IHSPz7oKX5ebEt6gHhGz775jr7fEWdB359N+638r WlSUq6M0sA6xxd/obtp5BvIU4bjm62uJzXSTuuh+6JCdqNyK8d6BWMh/wcNJwLPfrUoS 2pd65FzRKBUy6ZfiNkz6VAgNhZxT3lEtDXnqyBJh5a/zPAyyl56Ae1WtRLvr0PCMI2AZ FUJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725979279; x=1726584079; 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=+an3treqQP08FQ/4v2IVBHHJXdUo5OxtUySraZtU00s=; b=bAxsSkvN/R8AzdJ/QaFZ4HBDVQ5telu7Rtx6d2tm1NcVkm7G13C7uNmOrt1AVg8mFj S7LDIAvQE1eCQ6rDBVP9UecYcJ6M4vXHncdeQxBXeOn1rOFxgVvUCADgfoVaLY0NjXl/ Js/BXwnw7sicQx5vD46BVx9tpVBneeGn7PyHmPtMh2ErJxt7pQ3BtCvH1ZR2euMIolyL vBVw2srRwiRbVgkoL/7eMgv/0fQLD4YE3vfOg4LbsPbzkfaXeZoQSUd1wWSCFqjliO3q 7ptY58KnlEN4oBs9LsB0jLtk8wvEi+iBFYxUYrL3UPg8KU2hWMQgiGArNoEAscSDFr1y AjDQ== X-Gm-Message-State: AOJu0YwcIdw/dc5Xu6r2edfirYbZ06XN/IGcwTY/9Hi6OqImqd1hq4qT VXibXmyS2y6pK8sgBQqP5vUE1EgS1ZiuAnft7wRifOSHeiFj7hDu+GlBSTQ60B2rTsRE6yUibH0 = X-Google-Smtp-Source: AGHT+IEL43VKLBgnsb/rYvhsWFRr2S0ZOZER3ChseZVfzNKPzJNE38MkCxUMvUjCV5fUJnkaoPwasw== X-Received: by 2002:a17:907:3f96:b0:a77:cbe5:413f with SMTP id a640c23a62f3a-a8ffaaa6494mr107386766b.4.1725979278891; Tue, 10 Sep 2024 07:41:18 -0700 (PDT) Message-ID: <64883365-9ed1-45d4-a586-90b488480a82@suse.com> Date: Tue, 10 Sep 2024 16:41:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 6/7] 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) @@ -197,11 +141,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 Tue Sep 10 14:41:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13798680 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 EACA7ECE57A for ; Tue, 10 Sep 2024 14:50:27 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.795737.1205220 (Exim 4.92) (envelope-from ) id 1so2CB-0000Vh-A4; Tue, 10 Sep 2024 14:50:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 795737.1205220; Tue, 10 Sep 2024 14:50: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 1so2CB-0000VY-6I; Tue, 10 Sep 2024 14:50:19 +0000 Received: by outflank-mailman (input) for mailman id 795737; Tue, 10 Sep 2024 14:50:18 +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 1so23u-0003oG-Lv for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 14:41:46 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id cdd31445-6f82-11ef-a0b5-8be0dac302b0; Tue, 10 Sep 2024 16:41:46 +0200 (CEST) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a7a843bef98so380231166b.2 for ; Tue, 10 Sep 2024 07:41:46 -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-a8d25835abbsm490822066b.9.2024.09.10.07.41.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:41:45 -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: cdd31445-6f82-11ef-a0b5-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725979305; x=1726584105; 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=T0HPYysww8NjDfVR7D5Ro3dCBVCxnKMFK0Vtc+tPX5w=; b=eaQJdsoexvkMGtDwj5bfYncZmc59lP5n3+fJR/FQTaueX/AzVAscr0e2JZuCftAjqU oUUlL6Hhkki1fMPnJWaoClUNVMxAaCGW1G6SXnuCoQFSe/7ECfJ6FkFoMgMSPYp33LOq T9uOgwZMiOAWSwhkc1ylcCDWK85uSTj1bHj9Plb9y+RxNZmWE5wn2BF+YO7tRf7W1vZc woChaGKwMF3x/5OuaLHEovoHPgNgVrh9dVjBP10dLFjqFQF0IT1WV95Jb8nKtxsGjVZC SBO/EFxdWXqA9AUk6o54TVA4bRoHKDGILnwZmm0wIU9CHTXfxaYwZPzRcbLcA9Uht2pe cc+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725979305; x=1726584105; 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=T0HPYysww8NjDfVR7D5Ro3dCBVCxnKMFK0Vtc+tPX5w=; b=wT8SJ7o/T6qM0gBEtQLe2hCExHKCMl9zZ0bRjlDmGAIvjx8FiL3IByXWFxsdWqIn/m CwHCQT1M1deO7iFvxXCyWRtB+Pk+rbUffxpDgxKf0j89zegYIO6u7OhivtBStpWy4HLe WC8ERQncEcYvJDb0gu2LK3wNyXYeSp5OIab0vXyFIxbKwQJkZPBMEOVBCK7UjYBYRZ9E HaS5VHZTNBGFKhtEAax6RyLUgAXQLWwBoP0Vvfo+yYdcfqyC9pRTRKTigTxbmGxCPBGl 5unwhn9PpS33V0lXj5GH2jXm/9TIKRu8DOH7RrO0r4w+NP/HjBpjqTcHz95YJuyJK147 ovpQ== X-Gm-Message-State: AOJu0Yz9XqDWXbGb17Ind6i419ZfL1q9K8yCbOEMhbFWcozU6mvzXl2g BYJ/I63S94C1kC0QK6Bj+DJcvkn9qPBTzu/wQL2/w2f8IL+9QufaPs36upULDm81LgRTjzpHtH0 = X-Google-Smtp-Source: AGHT+IGsXMt2gYa0m8r8uAsXTtdVcBwOA09R8xfJDdn+51Kv36iJJXt4HR3SyAZS6KYwvPBxPoUMWg== X-Received: by 2002:a17:907:6d0c:b0:a8a:8c04:ce95 with SMTP id a640c23a62f3a-a8ffadee50dmr109540466b.43.1725979305389; Tue, 10 Sep 2024 07:41:45 -0700 (PDT) Message-ID: Date: Tue, 10 Sep 2024 16:41:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 7/7] 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 , although I think --- 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 @@ -119,8 +119,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; @@ -128,47 +127,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);