From patchwork Tue Feb 20 08:52:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13563622 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 AE0A1C48BC3 for ; Tue, 20 Feb 2024 08:52:59 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683258.1062696 (Exim 4.92) (envelope-from ) id 1rcLrw-0002FI-SD; Tue, 20 Feb 2024 08:52:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683258.1062696; Tue, 20 Feb 2024 08:52:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLrw-0002FB-PZ; Tue, 20 Feb 2024 08:52:52 +0000 Received: by outflank-mailman (input) for mailman id 683258; Tue, 20 Feb 2024 08:52:51 +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 1rcLrv-0002F1-Gq for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:52:51 +0000 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [2a00:1450:4864:20::42a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6cb49d55-cfcd-11ee-98f5-efadbce2ee36; Tue, 20 Feb 2024 09:52:49 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33d066f8239so2400258f8f.1 for ; Tue, 20 Feb 2024 00:52:49 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.52.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:52:48 -0800 (PST) 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: 6cb49d55-cfcd-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419169; x=1709023969; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=WRod7K1c22IPHMjkp91uZ7nODYMwBBoK3lXCfwDbDuI=; b=aip4Y3F4NXVJyTTIb7c3oEiYSHFXiNPPMpPIodVp2NvONU59jEPhAPeSaFufdP4Ycf n9CMY4agsSxSchxxvFGKbhpgtBHpAkyJBW2LanWGbxIstkAbNzY7zk8WyLmqHJGS19Yn qUmN+mnxkWyDsQhqZ+fLykn/EVKzpxefFIvKbxlGYmLWCYIbWemLa73uQ17PDBHCTu3m 2DT+lW6CTSAJfa+b0X2FnhLg8zQCn8vOo6R3oytd/eRM4o5TPiSmp8dPD4TimbvuUHJ6 Rj2fi4ohng09hYDr16M8a204AWYPOcDTbPQ+lJ0XbSRAogYEon0qd/F/YNvLFWKGNxTn 4sJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419169; x=1709023969; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WRod7K1c22IPHMjkp91uZ7nODYMwBBoK3lXCfwDbDuI=; b=nVOkmC3rAmBAnua82VXcDik0rLfBcOgft4ZVaMT4P9w6vDWioZ0MMgtDVYSnUHloDJ g+5PIvP1ekKCyeZP/TIJrBOAFbe8J6OfET91ywpufwX/BWMDtJh5oGPLzTYB27kGn1gW 3ZOXG67dtbRhwxA02zMSIw8gcc/ZjWNtBW76eA2MavNiVB2SRuTis7lvXPGbjUyAGK0O EOy4hbZY1+sHnXnnxenBmzabiQNWjFzbdl3TnIeGGBKcwyhkMadvx5gJFGew2kEg5p2P UoA09iYmqmhVmp5TAVc/1Mozi++3hHVZIOnzV42RSA3wI7lVnSAHnvNGN7wBMGFfAqfK uo9Q== X-Gm-Message-State: AOJu0YwDyq5YVUi42HJEV9VhgyCWu7fxa/ddB33WEZlt/nhs1cH5LtuD RHHjiRUJjfkRFTfXSZqshWUS1PE76g8rpcGL4yEMENm7L2WJqUpGCu5fsgK7XZ4AyF/NOkF2PoA = X-Google-Smtp-Source: AGHT+IEpHdJFuqVJhMhY5pj5+YOKKSzQlBfKrUOA5rRUTJ7UfOR2TR9gjLx4gSRka+z2g1v92KZ+7w== X-Received: by 2002:adf:e450:0:b0:33b:60ca:269f with SMTP id t16-20020adfe450000000b0033b60ca269fmr9573558wrm.43.1708419169003; Tue, 20 Feb 2024 00:52:49 -0800 (PST) Message-ID: Date: Tue, 20 Feb 2024 09:52:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 1/8] serial: fake IRQ-regs context in poll handlers Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu References: 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: In preparation of dropping the register parameters from serial_[rt]x_interrupt() and in turn from IRQ handler functions, register state needs making available another way for the few key handlers which need it. Fake IRQ-like state. Signed-off-by: Jan Beulich Reviewed-by: Julien Grall --- The use of guest_cpu_user_regs() in dbc_uart_poll() is inconsistent with other console poll functions we have, and it's unclear whether that's actually generally correct. It is only for this reason that it doesn't need changing here. Andrew suggested to move set_irq_regs() to BUGFRAME_run_fn handling; it's not clear to me whether that would be (a) correct from an abstract pov (that's exception, not interrupt context after all) and (b) really beneficial. --- v4: Drop xhci-dbc.c change as unnecessary with dump_registers() falling back to using guest_cpu_user_regs() as of patch 2, i.e. ahead of serial_rx_interrupt() having its 2nd parameter dropped. v2: New. --- a/xen/drivers/char/ehci-dbgp.c +++ b/xen/drivers/char/ehci-dbgp.c @@ -1253,6 +1253,7 @@ static void cf_check _ehci_dbgp_poll(str unsigned long flags; unsigned int timeout = MICROSECS(DBGP_CHECK_INTERVAL); bool empty = false; + struct cpu_user_regs *old_regs; if ( !dbgp->ehci_debug ) return; @@ -1268,12 +1269,17 @@ static void cf_check _ehci_dbgp_poll(str spin_unlock_irqrestore(&port->tx_lock, flags); } + /* Mimic interrupt context. */ + old_regs = set_irq_regs(regs); + if ( dbgp->in.chunk ) serial_rx_interrupt(port, regs); if ( empty ) serial_tx_interrupt(port, regs); + set_irq_regs(old_regs); + if ( spin_trylock_irqsave(&port->tx_lock, flags) ) { if ( dbgp->state == dbgp_idle && !dbgp->in.chunk && --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -211,10 +211,14 @@ static void cf_check __ns16550_poll(stru { struct serial_port *port = this_cpu(poll_port); struct ns16550 *uart = port->uart; + struct cpu_user_regs *old_regs; if ( uart->intr_works ) return; /* Interrupts work - no more polling */ + /* Mimic interrupt context. */ + old_regs = set_irq_regs(regs); + while ( ns_read_reg(uart, UART_LSR) & UART_LSR_DR ) { if ( ns16550_ioport_invalid(uart) ) @@ -227,6 +231,7 @@ static void cf_check __ns16550_poll(stru serial_tx_interrupt(port, regs); out: + set_irq_regs(old_regs); set_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms)); } From patchwork Tue Feb 20 08:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13563623 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 89FC0C54764 for ; Tue, 20 Feb 2024 08:53:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683262.1062707 (Exim 4.92) (envelope-from ) id 1rcLsF-0002g9-4A; Tue, 20 Feb 2024 08:53:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683262.1062707; Tue, 20 Feb 2024 08:53:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLsF-0002g0-18; Tue, 20 Feb 2024 08:53:11 +0000 Received: by outflank-mailman (input) for mailman id 683262; Tue, 20 Feb 2024 08:53:09 +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 1rcLsD-0002dz-DP for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:53:09 +0000 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [2a00:1450:4864:20::434]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7785ecbe-cfcd-11ee-8a52-1f161083a0e0; Tue, 20 Feb 2024 09:53:07 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33d568fbf62so836196f8f.3 for ; Tue, 20 Feb 2024 00:53:07 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.53.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:53:06 -0800 (PST) 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: 7785ecbe-cfcd-11ee-8a52-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419187; x=1709023987; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=r6p6O9Is+mZ3Yah69zqykHr7kyUZhreWLXWu9KFJdS8=; b=ZwBgJeQGpqX0OtIPWHS+bbvDztCAt56suCEN8s7ALpN6K+25XNRcKgsMsJpe18TxT5 995Ho4xLTJ9actib/LxOcRHNAXbarlLdfNFgaHLAN+fTB4801hAFO2WHZ6zZoFiWIyeY xaTBeOtDLSgH72JrYs1AVwJH41bvXCcj8SrZEvtV5Dr7/zKmgMVdRsWP7SwspYcjMTA9 8aGsB04AfnJBEbto3twRCRSc/iSDSdjkktcLwgEbUaIByzE1KtRqpBe2uUv+gyHjdnmw cjDvljO5nEgiiS//tGewBa4M+F+E5R+MHiRXZJkJ2f1M5hjgzgyCkLxFP3EewK2s6Bs4 bbdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419187; x=1709023987; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r6p6O9Is+mZ3Yah69zqykHr7kyUZhreWLXWu9KFJdS8=; b=oUSRWcCl1qPEgw7LANI3N2rdM9bhgjjnykoUqhA4MJYOjTrp/SQZDgOe1PjzR2Q1YC tdUIZ3IXkIYtxZ6q6tAv/CqTnXMalYmT3mTx1qRb0gRmfvuBjOWm8CCRDTpA7foOH0rY F1HUmGVSpxvUkISUZZKpTIovIivsTfdfhomaAloxf8BEYLr1R+1X2awbHTga/QNYy85n gwRtpNy85YgwneAOLg8N/M6HvFIC/uvaDSfZuLkFRfqhwdL2LsbL3vX4o3EjZH6byZBI +NQY/9CeV4s3zZ5kH6oSTOlZVBYE82XRW+mvHBixewE/5VmyaCgbBr0h7eentd67Yix/ yceA== X-Gm-Message-State: AOJu0YxFTnJJTxXIXXqk8n9mXHVjBMljGIITd70k8IZhE1pHL520HXpy leChpNgV4sJbrwEj8OnTAcdIRfHLPX/3A9mHr5vAj7i8Fq8qWDydotOOyWQ3WweGqyXhH15wpC4 = X-Google-Smtp-Source: AGHT+IGJcp+HX1PmMQpXJxFiKlDh5AMnw513Hl/8pUFan8/kp8S2U6yj2x7GBWXsGOJUlwYLsqQatQ== X-Received: by 2002:a5d:6288:0:b0:33d:6bd5:d372 with SMTP id k8-20020a5d6288000000b0033d6bd5d372mr637680wru.15.1708419187200; Tue, 20 Feb 2024 00:53:07 -0800 (PST) Message-ID: <8c76ba07-c850-4e3e-aac8-e5516877d848@suse.com> Date: Tue, 20 Feb 2024 09:53:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 2/8] keyhandler: drop regs parameter from handle_keyregs() Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu References: 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: In preparation for further removal of regs parameters, drop it here. In the two places where it's actually needed, retrieve IRQ context if available, or else guest context. Suggested-by: Andrew Cooper Signed-off-by: Jan Beulich Reviewed-by: Julien Grall --- As an alternative to the new boolean parameter, I wonder if we couldn't special-case the idle vCPU case: It's only there where we would not have proper context retrievable via guest_cpu_user_regs(). --- v3: Re-base. v2: New. --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -73,12 +73,12 @@ static struct keyhandler { static void cf_check keypress_action(void *unused) { - handle_keypress(keypress_key, NULL); + handle_keypress(keypress_key, true); } static DECLARE_TASKLET(keypress_tasklet, keypress_action, NULL); -void handle_keypress(unsigned char key, struct cpu_user_regs *regs) +void handle_keypress(unsigned char key, bool need_context) { struct keyhandler *h; @@ -88,7 +88,7 @@ void handle_keypress(unsigned char key, if ( !in_irq() || h->irq_callback ) { console_start_log_everything(); - h->irq_callback ? h->irq_fn(key, regs) : h->fn(key); + h->irq_callback ? h->irq_fn(key, need_context) : h->fn(key); console_end_log_everything(); } else @@ -169,7 +169,7 @@ void cf_check dump_execstate(struct cpu_ } static void cf_check dump_registers( - unsigned char key, struct cpu_user_regs *regs) + unsigned char key, bool need_context) { unsigned int cpu; @@ -182,8 +182,8 @@ static void cf_check dump_registers( cpumask_copy(&dump_execstate_mask, &cpu_online_map); /* Get local execution state out immediately, in case we get stuck. */ - if ( regs ) - dump_execstate(regs); + if ( !need_context ) + dump_execstate(get_irq_regs() ?: guest_cpu_user_regs()); else run_in_exception_handler(dump_execstate); @@ -245,8 +245,7 @@ static void cf_check dump_hwdom_register } } -static void cf_check reboot_machine( - unsigned char key, struct cpu_user_regs *regs) +static void cf_check reboot_machine(unsigned char key, bool unused) { printk("'%c' pressed -> rebooting machine\n", key); machine_restart(0); @@ -474,8 +473,7 @@ static void cf_check run_all_nonirq_keyh static DECLARE_TASKLET(run_all_keyhandlers_tasklet, run_all_nonirq_keyhandlers, NULL); -static void cf_check run_all_keyhandlers( - unsigned char key, struct cpu_user_regs *regs) +static void cf_check run_all_keyhandlers(unsigned char key, bool need_context) { struct keyhandler *h; unsigned int k; @@ -491,7 +489,7 @@ static void cf_check run_all_keyhandlers if ( !h->irq_fn || !h->diagnostic || !h->irq_callback ) continue; printk("[%c: %s]\n", k, h->desc); - h->irq_fn(k, regs); + h->irq_fn(k, need_context); } watchdog_enable(); @@ -500,8 +498,7 @@ static void cf_check run_all_keyhandlers tasklet_schedule(&run_all_keyhandlers_tasklet); } -static void cf_check do_toggle_alt_key( - unsigned char key, struct cpu_user_regs *regs) +static void cf_check do_toggle_alt_key(unsigned char key, bool unused) { alt_key_handling = !alt_key_handling; printk("'%c' pressed -> using %s key handling\n", key, @@ -566,7 +563,7 @@ void keyhandler_crash_action(enum crash_ if ( *action == '+' ) mdelay(10); else - handle_keypress(*action, NULL); + handle_keypress(*action, true); action++; } } --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -134,7 +134,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xe { if ( copy_from_guest_offset(&c, op->u.debug_keys.keys, i, 1) ) goto out; - handle_keypress(c, guest_cpu_user_regs()); + handle_keypress(c, false); } ret = 0; copyback = 0; --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -279,7 +279,7 @@ static int *__read_mostly upper_thresh_a static int *__read_mostly lower_thresh_adj = &xenlog_lower_thresh; static const char *__read_mostly thresh_adj = "standard"; -static void cf_check do_toggle_guest(unsigned char key, struct cpu_user_regs *regs) +static void cf_check do_toggle_guest(unsigned char key, bool unused) { if ( upper_thresh_adj == &xenlog_upper_thresh ) { @@ -306,13 +306,13 @@ static void do_adj_thresh(unsigned char loglvl_str(*upper_thresh_adj)); } -static void cf_check do_inc_thresh(unsigned char key, struct cpu_user_regs *regs) +static void cf_check do_inc_thresh(unsigned char key, bool unused) { ++*lower_thresh_adj; do_adj_thresh(key); } -static void cf_check do_dec_thresh(unsigned char key, struct cpu_user_regs *regs) +static void cf_check do_dec_thresh(unsigned char key, bool unused) { if ( *lower_thresh_adj ) --*lower_thresh_adj; @@ -531,7 +531,7 @@ static void __serial_rx(char c, struct c switch ( console_rx ) { case 0: - return handle_keypress(c, regs); + return handle_keypress(c, false); case 1: /* --- a/xen/include/xen/keyhandler.h +++ b/xen/include/xen/keyhandler.h @@ -24,9 +24,8 @@ typedef void (keyhandler_fn_t)(unsigned * * Called in hardirq context with interrupts disabled. */ -struct cpu_user_regs; typedef void (irq_keyhandler_fn_t)(unsigned char key, - struct cpu_user_regs *regs); + bool need_context); /* Initialize keytable with default handlers. */ void initialize_keytable(void); @@ -46,7 +45,7 @@ void register_irq_keyhandler(unsigned ch bool diagnostic); /* Inject a keypress into the key-handling subsystem. */ -extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs); +extern void handle_keypress(unsigned char key, bool need_context); enum crash_reason { CRASHREASON_PANIC, From patchwork Tue Feb 20 08:53:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13563625 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 48F2EC48BC3 for ; Tue, 20 Feb 2024 08:53:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683271.1062727 (Exim 4.92) (envelope-from ) id 1rcLsd-0003mk-Oo; Tue, 20 Feb 2024 08:53:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683271.1062727; Tue, 20 Feb 2024 08:53:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLsd-0003mc-LA; Tue, 20 Feb 2024 08:53:35 +0000 Received: by outflank-mailman (input) for mailman id 683271; Tue, 20 Feb 2024 08:53:34 +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 1rcLsc-0002F1-Hp for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:53:34 +0000 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [2a00:1450:4864:20::329]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 868ac1f3-cfcd-11ee-98f5-efadbce2ee36; Tue, 20 Feb 2024 09:53:32 +0100 (CET) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-412698cdd77so8099685e9.1 for ; Tue, 20 Feb 2024 00:53:32 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.53.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:53:32 -0800 (PST) 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: 868ac1f3-cfcd-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419212; x=1709024012; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=uPp0elCmf96AfayiOwn8U2QJcfk2O81aOrNPDxDcp70=; b=CxZovJAV5o3cIq+PVjJeqWA671HKoDoc5D9KDuXqyRtBYbzZEkgnRb5fFEqdfcYUum 6JivygeyVIJQvjQWoSJz86C2gi/KP0WSHM+FRddzXMTa+qfFX3YYMBBFVr0atoAgSCeX 8Y1pawcF4RDU3T2ZGGy7J5BQErRAJp1WJvnoMaRYny+1+idV8zKf3CTzgxl7MEUwTELs JhW1MRCho6Ziz5aZmQ4g7AJ27HIYN55oH+Rcqh7zO+XNOPi9AgLwbi2hbteXEA3EOTkC NpvcqvsjhAlLNADFTFI/x2tZfq1849QCvLl7Q/c9OGLxH9DMmqYyuAhR8csLPK2GT4lb 9n1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419212; x=1709024012; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uPp0elCmf96AfayiOwn8U2QJcfk2O81aOrNPDxDcp70=; b=vk2MtnlFsFjvpK4ZMd5CC2CR1XNEbnhIOrBXV+duJIQEqQWgnN4zCg/L4TO4YIOJQ+ Mc7A8lFEoGMUP4S4x3xpNi7cDoDEviF0ikvtE+qYcq+DQRzilWAdJYZ4q6ppVhoo12LH 0FiPBF2kKINvbeYPgPsU40Tp/rgfPuD3olkqVFsSayQzxIJPIwvilCVkk/BEd4FkFrob O5FWTgFE49DyZsdzCw3NHLP9lepRKpyyZlymw/p1q+GDld4EjCnSgFqhdUze0e1D6e8p 4C4CsKCLjL8bN+iFPpQPl31Kv/awR5uG+xUH+hNU4dNkIQupH0eXlD5Vu5sp0EeaAq04 G9/A== X-Gm-Message-State: AOJu0YzFNyDVEfKFR4sM/b1DkkFvbKjACFZmww0iwOP+sUXDvv3bIf9m iTdG/rxGWjOxWTTMTB0szBRT3uRHUiKVHg+NJuVn91gr9Y6rWZnn+sDuLScoQW5RLUBEjbzt64s = X-Google-Smtp-Source: AGHT+IFHtjbHbKo4h5YKKP2rg1k+1j2Twm/B3b+aRITSLkoDCKBr6vLlArxlwCAT4vJ98Z5XQY+t1w== X-Received: by 2002:a05:600c:45d1:b0:412:6de4:cbe1 with SMTP id s17-20020a05600c45d100b004126de4cbe1mr1344836wmo.15.1708419212431; Tue, 20 Feb 2024 00:53:32 -0800 (PST) Message-ID: <9836c01a-7f9f-4f8e-ba7d-1a7ab7e2e4e1@suse.com> Date: Tue, 20 Feb 2024 09:53:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 3/8] serial: drop serial_rx_fn's regs parameter Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu References: 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: It's simply not needed anymore. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- v2: Re-base over earlier (new/split) patches. --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -526,7 +526,7 @@ static void switch_serial_input(void) printk("\n"); } -static void __serial_rx(char c, struct cpu_user_regs *regs) +static void __serial_rx(char c) { switch ( console_rx ) { @@ -578,7 +578,7 @@ static void __serial_rx(char c, struct c #endif } -static void cf_check serial_rx(char c, struct cpu_user_regs *regs) +static void cf_check serial_rx(char c) { static int switch_code_count = 0; @@ -594,10 +594,10 @@ static void cf_check serial_rx(char c, s } for ( ; switch_code_count != 0; switch_code_count-- ) - __serial_rx(switch_code, regs); + __serial_rx(switch_code); /* Finally process the just-received character. */ - __serial_rx(c, regs); + __serial_rx(c); } static void cf_check notify_dom0_con_ring(void *unused) --- a/xen/drivers/char/serial.c +++ b/xen/drivers/char/serial.c @@ -68,7 +68,7 @@ void serial_rx_interrupt(struct serial_p spin_unlock_irqrestore(&port->rx_lock, flags); if ( fn != NULL ) - (*fn)(c & 0x7f, regs); + fn(c & 0x7f); } void serial_tx_interrupt(struct serial_port *port, struct cpu_user_regs *regs) --- a/xen/drivers/char/xen_pv_console.c +++ b/xen/drivers/char/xen_pv_console.c @@ -118,7 +118,7 @@ size_t pv_console_rx(struct cpu_user_reg { c = cons_ring->in[MASK_XENCONS_IDX(cons++, cons_ring->in)]; if ( cons_rx_handler ) - cons_rx_handler(c, regs); + cons_rx_handler(c); recv++; } --- a/xen/include/xen/serial.h +++ b/xen/include/xen/serial.h @@ -15,7 +15,7 @@ struct cpu_user_regs; /* Register a character-receive hook on the specified COM port. */ -typedef void (*serial_rx_fn)(char c, struct cpu_user_regs *regs); +typedef void (*serial_rx_fn)(char c); void serial_set_rx_handler(int handle, serial_rx_fn fn); /* Number of characters we buffer for a polling receiver. */ From patchwork Tue Feb 20 08:53:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13563626 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 89198C48BC3 for ; Tue, 20 Feb 2024 08:54:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683278.1062737 (Exim 4.92) (envelope-from ) id 1rcLt2-0004Li-0E; Tue, 20 Feb 2024 08:54:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683278.1062737; Tue, 20 Feb 2024 08:53:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLt1-0004Lb-TK; Tue, 20 Feb 2024 08:53:59 +0000 Received: by outflank-mailman (input) for mailman id 683278; Tue, 20 Feb 2024 08:53:58 +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 1rcLt0-0002dz-CL for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:53:58 +0000 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [2a00:1450:4864:20::434]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 95764024-cfcd-11ee-8a52-1f161083a0e0; Tue, 20 Feb 2024 09:53:57 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33d375993f4so1288961f8f.1 for ; Tue, 20 Feb 2024 00:53:57 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.53.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:53:57 -0800 (PST) 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: 95764024-cfcd-11ee-8a52-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419237; x=1709024037; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=YO3g36PvHebDUpK9/W9a6xU16xqzRXgrwigdPTnIuIA=; b=MRCDNx/jzxK3ryhZdl7QLnVevdcK5YROT9z2EVNCy9KGgKmXCkICJByY4NpgtiGAog bU9XdOdYS7f6r0PHqsI0d4D68FKBjMf0T5u0WmP1FTD5Jj9Uh35QQ15A2H5I+pvyUcex 0mvXpMunu3a9I7upZcjYS6TaAsLOI21N6Lvl5Vg9oTvqdTaIE2Lzbzb2u2bBEHKd92dy nqeRGcJbCN6MbeogPgM5Pftu6ifpx8sgTtNUoFbHy+C42pqpeuna97Hkb3HBqEZAFvPP AR1yN+MuPXI7gb9WqjqQ9afSykTHGYfCnxxUayRtgeV2siFadMrsJjyMLy3yRDb6Z8OD 0YGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419237; x=1709024037; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YO3g36PvHebDUpK9/W9a6xU16xqzRXgrwigdPTnIuIA=; b=ZfNDLxGGIYfk3LxP8XsVPMsLq87MqT3SND3Cw84B4xNKB26TiL9ZInx6kZ4PJKXYkr 0jNvnrPHOYkmDYPNSEzsEJeBGQfycpeZ3F+2MgspX86z+dmeTJaZDsCvzcTHP3G722QE Iii/Jc3yJIOWEp385xD7mrB8vJE5jJ8UwSR0srfRP8Z5067EWSdUxsljA983G0dFP3Dy OokJrovhEEOMqcEzKu7U1u0jDtcA2HUjcnpj4tRE+92SyGknssJftnw3S4CPVCq5EjS0 21Q4+FcCTK8UZJbr3Nfs6fwvCElWCuUtc/jABZx8rwPKuCZ3BuCyyblDI9SQfne+f0Hz fq/A== X-Gm-Message-State: AOJu0YzslzT7PZmAjOmp/ck7MbihhJaOBtApjnpgNk/ekEfYhO5AEH1I xEj0pFl7q67G0hOhjxqixmFdZPV8h+5AxUefdxVaoTesjUneTwN2gTX0Qd0KQD9Kz1ViDX8MNPY = X-Google-Smtp-Source: AGHT+IFFQxNe9Z1KKGyLsocntV93gLhIIqAJrcaLAmuQLTKz+j0cxjaKOyV0sNxP743pK6/Rw7kOIw== X-Received: by 2002:a5d:5f51:0:b0:33d:6a83:1a61 with SMTP id cm17-20020a5d5f51000000b0033d6a831a61mr1116259wrb.37.1708419237433; Tue, 20 Feb 2024 00:53:57 -0800 (PST) Message-ID: Date: Tue, 20 Feb 2024 09:53:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 4/8] PV-shim: drop pv_console_rx()'s regs parameter Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu References: 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: It's not needed anymore. This is in preparation of dropping the register parameters from IRQ handler functions. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/guest/xen/xen.c +++ b/xen/arch/x86/guest/xen/xen.c @@ -181,7 +181,7 @@ static void cf_check xen_evtchn_upcall(s port += l1 * BITS_PER_LONG; if ( pv_console && port == pv_console_evtchn() ) - pv_console_rx(regs); + pv_console_rx(); else if ( pv_shim ) pv_shim_inject_evtchn(port); } --- a/xen/drivers/char/xen_pv_console.c +++ b/xen/drivers/char/xen_pv_console.c @@ -94,7 +94,7 @@ evtchn_port_t pv_console_evtchn(void) return cons_evtchn; } -size_t pv_console_rx(struct cpu_user_regs *regs) +size_t pv_console_rx(void) { char c; XENCONS_RING_IDX cons, prod; --- a/xen/include/xen/pv_console.h +++ b/xen/include/xen/pv_console.h @@ -9,7 +9,7 @@ void pv_console_init(void); void pv_console_set_rx_handler(serial_rx_fn fn); void pv_console_init_postirq(void); void pv_console_puts(const char *buf, size_t nr); -size_t pv_console_rx(struct cpu_user_regs *regs); +size_t pv_console_rx(void); evtchn_port_t pv_console_evtchn(void); #else @@ -18,7 +18,7 @@ static inline void pv_console_init(void) static inline void pv_console_set_rx_handler(serial_rx_fn fn) { } static inline void pv_console_init_postirq(void) { } static inline void pv_console_puts(const char *buf, size_t nr) { } -static inline size_t pv_console_rx(struct cpu_user_regs *regs) { return 0; } +static inline size_t pv_console_rx(void) { return 0; } #endif /* !CONFIG_XEN_GUEST */ #endif /* __XEN_PV_CONSOLE_H__ */ From patchwork Tue Feb 20 08:55:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13563651 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 A4968C48BC3 for ; Tue, 20 Feb 2024 08:55:28 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683285.1062746 (Exim 4.92) (envelope-from ) id 1rcLuI-0004zi-Ao; Tue, 20 Feb 2024 08:55:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683285.1062746; Tue, 20 Feb 2024 08:55:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLuI-0004zZ-7i; Tue, 20 Feb 2024 08:55:18 +0000 Received: by outflank-mailman (input) for mailman id 683285; Tue, 20 Feb 2024 08:55:16 +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 1rcLuG-0004zL-Mi for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:55:16 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c3ae5476-cfcd-11ee-8a52-1f161083a0e0; Tue, 20 Feb 2024 09:55:15 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4126f486429so2456985e9.0 for ; Tue, 20 Feb 2024 00:55:15 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.55.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:55:14 -0800 (PST) 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: c3ae5476-cfcd-11ee-8a52-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419315; x=1709024115; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=rQ9ZnllqLcHW3EN3PU74ZZkd02EgCuqNow+7TRn8kGU=; b=SoEk0yBMF1T3cBFn1N+F07hlHweALsNYehpUVvSqOEU97WboHJALxmxT8AP9XPRqDu XBTStnhVMlJfw6syceXK8sJJEaYYG/cW5nbWbWZrvM2m+I+ePUMHItWxP3xYuN5MySDI TKGnSZPVOSRP6DJek3cByTUDPObibdX32LH2R29z14Z5oU6BVASoyZGQ9ulrWUOg251o 5HMFEtglXftXRUtyPBRI4tuWPPDDqiTmT8TFL8GXYR/rICd956pKl32Ng7h5Lh2N67fU AygiUAlkc9XIYkypGp4i7v7iI7lvbadg9JG5gWS9D0u473SsSl00hDEtEtuAcWsXcr6G RIFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419315; x=1709024115; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rQ9ZnllqLcHW3EN3PU74ZZkd02EgCuqNow+7TRn8kGU=; b=vGbawdjNat03buWI4NIH7qf536vHir2jN3polzTNtHNyW1g9BuiZGqw2ivSglGZh+f JppxS4Ulxg9nqtsVdkUzi/+iM+NIvoInFvSfMuasE/GfZO8MUiBbKCLzsJXFlAREWEJJ SxaWIjLPmU/s4bb2RCcP+IidqvFpRQNM9Dix7ALTRKtrw5eiULuxzp60DWHyDf6Yjn33 bOVOKrWX+Pzp6azBP9b9NxbmIZ57VPYEtnevDMpeDFwzlN5CYZKgZTP4TgX/CtBY4kb8 VaQoDwjER8GdmsgXQePbLRK5ZHdE6I1c4hNb/BwwoIgJfXVF7EObsvXVjcK9uURB04u7 coQw== X-Gm-Message-State: AOJu0YyYpSz+YyOo7xoTuToVQ+cYjl7gftkwnAJ5M/gJWNfNl+ksOSdN yWGnYwmu27Liqm/uBF6gIN0gyNXcmr0Acmt8bAHWWKfnn5YjesZzBG+w5MrJp7Cp8+8XVW0AxF8 = X-Google-Smtp-Source: AGHT+IFDLesNYiLVeXV72g1fEvH0MEGr/FkIU8RrKKBp4bxbJfLh6uIlXLuofaMJTVoKc4FffLuGwg== X-Received: by 2002:a5d:6288:0:b0:33d:6bd5:d372 with SMTP id k8-20020a5d6288000000b0033d6bd5d372mr641139wru.15.1708419314941; Tue, 20 Feb 2024 00:55:14 -0800 (PST) Message-ID: <6476a662-14f2-4206-83c6-a561c6c4aee5@suse.com> Date: Tue, 20 Feb 2024 09:55:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 5/8] serial: drop serial_[rt]x_interrupt()'s regs parameter Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu , Michal Orzel , Bertrand Marquis , Volodymyr Babchuk References: 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: They're simply not needed anymore. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Acked-by: Julien Grall --- v4: Re-base over changes earlier in the series. v2: Setting of IRQ regs split off to an earlier patch. --- a/xen/drivers/char/cadence-uart.c +++ b/xen/drivers/char/cadence-uart.c @@ -51,7 +51,7 @@ static void cuart_interrupt(int irq, voi /* ACK. */ if ( status & UART_SR_INTR_RTRIG ) { - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); cuart_write(uart, R_UART_CISR, UART_SR_INTR_RTRIG); } } while ( status & UART_SR_INTR_RTRIG ); --- a/xen/drivers/char/ehci-dbgp.c +++ b/xen/drivers/char/ehci-dbgp.c @@ -1273,10 +1273,10 @@ static void cf_check _ehci_dbgp_poll(str old_regs = set_irq_regs(regs); if ( dbgp->in.chunk ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); if ( empty ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); set_irq_regs(old_regs); --- a/xen/drivers/char/exynos4210-uart.c +++ b/xen/drivers/char/exynos4210-uart.c @@ -81,7 +81,7 @@ static void exynos4210_uart_interrupt(in if ( status & (UINTM_RXD | UINTM_ERROR) ) { /* uart->regs[UINTM] |= RXD|ERROR; */ - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); /* uart->regs[UINTM] &= ~(RXD|ERROR); */ exynos4210_write(uart, UINTP, UINTM_RXD | UINTM_ERROR); } @@ -89,7 +89,7 @@ static void exynos4210_uart_interrupt(in if ( status & (UINTM_TXD | UINTM_MODEM) ) { /* uart->regs[UINTM] |= TXD|MODEM; */ - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); /* uart->regs[UINTM] &= ~(TXD|MODEM); */ exynos4210_write(uart, UINTP, UINTM_TXD | UINTM_MODEM); } --- a/xen/drivers/char/imx-lpuart.c +++ b/xen/drivers/char/imx-lpuart.c @@ -48,10 +48,10 @@ static void imx_lpuart_interrupt(int irq rxcnt = imx_lpuart_read(uart, UARTWATER) >> UARTWATER_RXCNT_OFF; if ( (sts & UARTSTAT_RDRF) || (rxcnt > 0) ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); if ( sts & UARTSTAT_TDRE ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); imx_lpuart_write(uart, UARTSTAT, sts); } --- a/xen/drivers/char/meson-uart.c +++ b/xen/drivers/char/meson-uart.c @@ -69,10 +69,10 @@ static void meson_uart_interrupt(int irq uint32_t st = readl(uart->regs + AML_UART_STATUS_REG); if ( !(st & AML_UART_RX_FIFO_EMPTY) ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); if ( !(st & AML_UART_TX_FIFO_FULL) ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); } static void __init meson_uart_init_preirq(struct serial_port *port) --- a/xen/drivers/char/mvebu-uart.c +++ b/xen/drivers/char/mvebu-uart.c @@ -76,10 +76,10 @@ static void mvebu3700_uart_interrupt(int if ( st & (STATUS_RX_RDY | STATUS_OVR_ERR | STATUS_FRM_ERR | STATUS_BRK_DET) ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); if ( st & STATUS_TX_RDY ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); } static void __init mvebu3700_uart_init_preirq(struct serial_port *port) --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -188,9 +188,9 @@ static void cf_check ns16550_interrupt( u8 lsr = ns_read_reg(uart, UART_LSR); if ( (lsr & uart->lsr_mask) == uart->lsr_mask ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); if ( lsr & UART_LSR_DR ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); /* A "busy-detect" condition is observed on Allwinner/sunxi UART * after LCR is written during setup. It needs to be cleared at @@ -224,11 +224,11 @@ static void cf_check __ns16550_poll(stru if ( ns16550_ioport_invalid(uart) ) goto out; - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); } if ( ( ns_read_reg(uart, UART_LSR) & uart->lsr_mask ) == uart->lsr_mask ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); out: set_irq_regs(old_regs); --- a/xen/drivers/char/omap-uart.c +++ b/xen/drivers/char/omap-uart.c @@ -70,9 +70,9 @@ static void omap_uart_interrupt(int irq, { lsr = omap_read(uart, UART_LSR) & 0xff; if ( lsr & UART_LSR_THRE ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); if ( lsr & UART_LSR_DR ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); if ( port->txbufc == port->txbufp ) { reg = omap_read(uart, UART_IER); --- a/xen/drivers/char/pl011.c +++ b/xen/drivers/char/pl011.c @@ -95,7 +95,7 @@ static void pl011_interrupt(int irq, voi pl011_write(uart, ICR, status & ~(TXI|RTI|RXI)); if ( status & (RTI|RXI) ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); /* TODO if ( status & (DSRMI|DCDMI|CTSMI|RIMI) ) @@ -103,7 +103,7 @@ static void pl011_interrupt(int irq, voi */ if ( status & (TXI) ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); status = pl011_intr_status(uart); } while (status != 0); --- a/xen/drivers/char/scif-uart.c +++ b/xen/drivers/char/scif-uart.c @@ -119,11 +119,11 @@ static void scif_uart_interrupt(int irq, { /* TX Interrupt */ if ( status & SCFSR_TDFE ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); /* RX Interrupt */ if ( status & (SCFSR_RDF | SCFSR_DR) ) - serial_rx_interrupt(port, regs); + serial_rx_interrupt(port); /* Error Interrupt */ if ( status & params->error_mask ) --- a/xen/drivers/char/serial.c +++ b/xen/drivers/char/serial.c @@ -45,7 +45,7 @@ static inline void serial_stop_tx(struct port->driver->stop_tx(port); } -void serial_rx_interrupt(struct serial_port *port, struct cpu_user_regs *regs) +void serial_rx_interrupt(struct serial_port *port) { char c; serial_rx_fn fn = NULL; @@ -71,7 +71,7 @@ void serial_rx_interrupt(struct serial_p fn(c & 0x7f); } -void serial_tx_interrupt(struct serial_port *port, struct cpu_user_regs *regs) +void serial_tx_interrupt(struct serial_port *port) { int i, n; unsigned long flags; --- a/xen/drivers/char/xhci-dbc.c +++ b/xen/drivers/char/xhci-dbc.c @@ -1176,9 +1176,10 @@ static void cf_check dbc_uart_poll(void } while ( dbc_work_ring_size(&dbc->dbc_iwork) ) - serial_rx_interrupt(port, guest_cpu_user_regs()); + serial_rx_interrupt(port); + + serial_tx_interrupt(port); - serial_tx_interrupt(port, guest_cpu_user_regs()); set_timer(&uart->timer, NOW() + MICROSECS(DBC_POLL_INTERVAL)); } --- a/xen/include/xen/serial.h +++ b/xen/include/xen/serial.h @@ -12,8 +12,6 @@ #include #include -struct cpu_user_regs; - /* Register a character-receive hook on the specified COM port. */ typedef void (*serial_rx_fn)(char c); void serial_set_rx_handler(int handle, serial_rx_fn fn); @@ -145,8 +143,8 @@ void serial_register_uart(int idx, struc /* Place the serial port into asynchronous transmit mode. */ void serial_async_transmit(struct serial_port *port); /* Process work in interrupt context. */ -void serial_rx_interrupt(struct serial_port *port, struct cpu_user_regs *regs); -void serial_tx_interrupt(struct serial_port *port, struct cpu_user_regs *regs); +void serial_rx_interrupt(struct serial_port *port); +void serial_tx_interrupt(struct serial_port *port); /* * Initialisers for individual uart drivers. From patchwork Tue Feb 20 08:55:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13563652 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 40478C48BC4 for ; Tue, 20 Feb 2024 08:56:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683290.1062757 (Exim 4.92) (envelope-from ) id 1rcLuy-0005V0-IH; Tue, 20 Feb 2024 08:56:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683290.1062757; Tue, 20 Feb 2024 08:56:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLuy-0005Ut-Fe; Tue, 20 Feb 2024 08:56:00 +0000 Received: by outflank-mailman (input) for mailman id 683290; Tue, 20 Feb 2024 08:55:58 +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 1rcLuw-0005Lw-Fu for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:55:58 +0000 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [2a00:1450:4864:20::436]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id dc286481-cfcd-11ee-98f5-efadbce2ee36; Tue, 20 Feb 2024 09:55:56 +0100 (CET) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33d26da3e15so1862341f8f.1 for ; Tue, 20 Feb 2024 00:55:56 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.55.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:55:55 -0800 (PST) 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: dc286481-cfcd-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419356; x=1709024156; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=vY7h+x/uY/tx4SThVUK3+EyH+28fbreju2/f4B+vk7s=; b=TgP4aljbe6DfV4p0ep0ppvmPhxn1dZI8yfesFfFAuzJY7l58BNSXm8YsPp4onKU9xH OYGtr05GquwA3P4XMq5a2Rt0VGBroX2/Wttx4lQ/EluiqH4pYRgg8ktuhEWcCT9pgM3c 6h7ZSAEeaTzRIlxDUZ1KgqHsbSBgACz+s1gKbhXNc+U+6Hb6O+KOyz+z9lEdkDPUg1Z/ reuDmfYHWJ2Wz9pEB5kXL+vaONiIBxfDMKaNmaLSrpUXBQSZhDtkGqpUf9hRydoagcW5 CWqhgIjZS0b8sqz25tzUMXZTv3V2/OUPR9MRzmJZhijDw/kdfzW5JgFfagqDX0zDZ09s eakw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419356; x=1709024156; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vY7h+x/uY/tx4SThVUK3+EyH+28fbreju2/f4B+vk7s=; b=cbYcWVoCFohYSIEnymwoINrssjSa3ZO9ROWCLdEfo1yEF8TIHzpxU1Rm8uwuU/gxTf xUsvX//yumZhSuN3EoQGtno5VSxnMyKsR8hfJAuiKJZ+x9Q7GhgqHifKKDhdrmq/T0Wp gwzVoiMpqpdBQGHfIS/ycJbPApOmD+xMUfLqAkg9M1A0bRL8bbozdlqu1YAajGeCinLp 58cNT1SSmJQPNQoxB8p7jjbZ1Ul0RVUElkg1TZiWNalLzgIGKI1iJhXlMS3e1tEIj9OS HvPTKw0B9L8ALMwc/rsGyyoSdHQu+lqX2XNuiEYpx0tKigDpHTR9NzOfAMBqq6OS9hTc rgsA== X-Gm-Message-State: AOJu0YxiH3HccmOk/ZG+Jj4FswptzZESgtjJwngVHGDEsWUd8gyyclCR Lcd6atobzxLXIKIW8xCJzeeBBpq1CViZCUmlGI4Q3AlIVuBWqBhsRmTSH7X4bwQH3AFxpchMZEk = X-Google-Smtp-Source: AGHT+IGHn4367SFgbvnMktpZZ1dQ1rWBIxFaDsWpXzI8tbcOjs3bL2NkuZwGgf/P4Aurp9SWp8nsLA== X-Received: by 2002:a5d:5345:0:b0:33d:1bd1:8ae2 with SMTP id t5-20020a5d5345000000b0033d1bd18ae2mr9444079wrv.19.1708419355920; Tue, 20 Feb 2024 00:55:55 -0800 (PST) Message-ID: <74a35cb6-9211-46ae-85cf-c83ad49d0786@suse.com> Date: Tue, 20 Feb 2024 09:55:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 6/8] IRQ: drop regs parameter from handler functions Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu , Michal Orzel , Bertrand Marquis , Volodymyr Babchuk References: 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: It's simply not needed anymore. Note how Linux made this change many years ago already, in 2.6.19 (late 2006, see [1]). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Acked-by: Julien Grall [1] https://git.kernel.org/torvalds/c/7d12e780e003f93433d49ce78cfedf4b4c52adc5 --- v2: Arm build fixes. --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -397,7 +397,7 @@ void gic_interrupt(struct cpu_user_regs } while (1); } -static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs) +static void maintenance_interrupt(int irq, void *dev_id) { /* * This is a dummy interrupt handler. --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -182,8 +182,7 @@ void irq_set_affinity(struct irq_desc *d } int request_irq(unsigned int irq, unsigned int irqflags, - void (*handler)(int irq, void *dev_id, - struct cpu_user_regs *regs), + void (*handler)(int irq, void *dev_id), const char *devname, void *dev_id) { struct irqaction *action; @@ -276,7 +275,7 @@ void do_IRQ(struct cpu_user_regs *regs, do { - action->handler(irq, action->dev_id, regs); + action->handler(irq, action->dev_id); action = action->next; } while ( action ); --- a/xen/arch/arm/time.c +++ b/xen/arch/arm/time.c @@ -241,7 +241,7 @@ int reprogram_timer(s_time_t timeout) } /* Handle the firing timer */ -static void htimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs) +static void htimer_interrupt(int irq, void *dev_id) { if ( unlikely(!(READ_SYSREG(CNTHP_CTL_EL2) & CNTx_CTL_PENDING)) ) return; @@ -255,7 +255,7 @@ static void htimer_interrupt(int irq, vo WRITE_SYSREG(0, CNTHP_CTL_EL2); } -static void vtimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs) +static void vtimer_interrupt(int irq, void *dev_id) { /* * Edge-triggered interrupts can be used for the virtual timer. Even --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -962,7 +962,7 @@ static int __init cf_check irq_ratelimit __initcall(irq_ratelimit_init); int __init request_irq(unsigned int irq, unsigned int irqflags, - void (*handler)(int irq, void *dev_id, struct cpu_user_regs *regs), + void (*handler)(int irq, void *dev_id), const char * devname, void *dev_id) { struct irqaction * action; @@ -2009,7 +2009,7 @@ void do_IRQ(struct cpu_user_regs *regs) spin_unlock_irq(&desc->lock); tsc_in = tb_init_done ? get_cycles() : 0; - action->handler(irq, action->dev_id, regs); + action->handler(irq, action->dev_id); TRACE_3D(TRC_HW_IRQ_HANDLED, irq, tsc_in, get_cycles()); spin_lock_irq(&desc->lock); --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -237,8 +237,7 @@ again: } } -static void cf_check hpet_interrupt_handler( - int irq, void *data, struct cpu_user_regs *regs) +static void cf_check hpet_interrupt_handler(int irq, void *data) { struct hpet_event_channel *ch = data; --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -198,8 +198,7 @@ static void smp_send_timer_broadcast_ipi } } -static void cf_check timer_interrupt( - int irq, void *dev_id, struct cpu_user_regs *regs) +static void cf_check timer_interrupt(int irq, void *dev_id) { ASSERT(local_irq_is_enabled()); --- a/xen/common/irq.c +++ b/xen/common/irq.c @@ -29,7 +29,7 @@ int init_one_irq_desc(struct irq_desc *d return err; } -void cf_check no_action(int cpl, void *dev_id, struct cpu_user_regs *regs) +void cf_check no_action(int cpl, void *dev_id) { } --- a/xen/drivers/char/cadence-uart.c +++ b/xen/drivers/char/cadence-uart.c @@ -40,7 +40,7 @@ static struct cuart { #define cuart_read(uart, off) readl((uart)->regs + (off)) #define cuart_write(uart, off,val) writel((val), (uart)->regs + (off)) -static void cuart_interrupt(int irq, void *data, struct cpu_user_regs *regs) +static void cuart_interrupt(int irq, void *data) { struct serial_port *port = data; struct cuart *uart = port->uart; --- a/xen/drivers/char/exynos4210-uart.c +++ b/xen/drivers/char/exynos4210-uart.c @@ -45,7 +45,7 @@ static struct exynos4210_uart { #define exynos4210_read(uart, off) readl((uart)->regs + off) #define exynos4210_write(uart, off, val) writel(val, (uart->regs) + off) -static void exynos4210_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs) +static void exynos4210_uart_interrupt(int irq, void *data) { struct serial_port *port = data; struct exynos4210_uart *uart = port->uart; --- a/xen/drivers/char/imx-lpuart.c +++ b/xen/drivers/char/imx-lpuart.c @@ -37,8 +37,7 @@ static struct imx_lpuart { struct vuart_info vuart; } imx8_com; -static void imx_lpuart_interrupt(int irq, void *data, - struct cpu_user_regs *regs) +static void imx_lpuart_interrupt(int irq, void *data) { struct serial_port *port = data; struct imx_lpuart *uart = port->uart; --- a/xen/drivers/char/meson-uart.c +++ b/xen/drivers/char/meson-uart.c @@ -61,8 +61,7 @@ static struct meson_uart { struct vuart_info vuart; } meson_com; -static void meson_uart_interrupt(int irq, void *data, - struct cpu_user_regs *regs) +static void meson_uart_interrupt(int irq, void *data) { struct serial_port *port = data; struct meson_uart *uart = port->uart; --- a/xen/drivers/char/mvebu-uart.c +++ b/xen/drivers/char/mvebu-uart.c @@ -67,8 +67,7 @@ static struct mvebu3700_uart { #define mvebu3700_read(uart, off) readl((uart)->regs + (off)) #define mvebu3700_write(uart, off, val) writel(val, (uart)->regs + (off)) -static void mvebu3700_uart_interrupt(int irq, void *data, - struct cpu_user_regs *regs) +static void mvebu3700_uart_interrupt(int irq, void *data) { struct serial_port *port = data; struct mvebu3700_uart *uart = port->uart; --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -175,8 +175,7 @@ static void handle_dw_usr_busy_quirk(str } } -static void cf_check ns16550_interrupt( - int irq, void *dev_id, struct cpu_user_regs *regs) +static void cf_check ns16550_interrupt(int irq, void *dev_id) { struct serial_port *port = dev_id; struct ns16550 *uart = port->uart; --- a/xen/drivers/char/omap-uart.c +++ b/xen/drivers/char/omap-uart.c @@ -59,7 +59,7 @@ static struct omap_uart { struct vuart_info vuart; } omap_com = {0}; -static void omap_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs) +static void omap_uart_interrupt(int irq, void *data) { struct serial_port *port = data; struct omap_uart *uart = port->uart; --- a/xen/drivers/char/pl011.c +++ b/xen/drivers/char/pl011.c @@ -82,7 +82,7 @@ static unsigned int pl011_intr_status(st return (pl011_read(uart, RIS) & pl011_read(uart, IMSC)); } -static void pl011_interrupt(int irq, void *data, struct cpu_user_regs *regs) +static void pl011_interrupt(int irq, void *data) { struct serial_port *port = data; struct pl011 *uart = port->uart; --- a/xen/drivers/char/scif-uart.c +++ b/xen/drivers/char/scif-uart.c @@ -102,7 +102,7 @@ static const struct port_params port_par }, }; -static void scif_uart_interrupt(int irq, void *data, struct cpu_user_regs *regs) +static void scif_uart_interrupt(int irq, void *data) { struct serial_port *port = data; struct scif_uart *uart = port->uart; --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -718,8 +718,7 @@ static void cf_check do_amd_iommu_irq(vo static DECLARE_SOFTIRQ_TASKLET(amd_iommu_irq_tasklet, do_amd_iommu_irq, NULL); -static void cf_check iommu_interrupt_handler( - int irq, void *dev_id, struct cpu_user_regs *regs) +static void cf_check iommu_interrupt_handler(int irq, void *dev_id) { unsigned long flags; struct amd_iommu *iommu = dev_id; --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c @@ -642,7 +642,7 @@ static void ipmmu_domain_irq(struct ipmm domain->d, status, iova); } -static void ipmmu_irq(int irq, void *dev, struct cpu_user_regs *regs) +static void ipmmu_irq(int irq, void *dev) { struct ipmmu_vmsa_device *mmu = dev; unsigned int i; --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -1097,16 +1097,14 @@ static irqreturn_t arm_smmu_global_fault } /* Xen: Interrupt handlers wrapper */ -static void arm_smmu_context_fault_xen(int irq, void *dev, - struct cpu_user_regs *regs) +static void arm_smmu_context_fault_xen(int irq, void *dev) { arm_smmu_context_fault(irq, dev); } #define arm_smmu_context_fault arm_smmu_context_fault_xen -static void arm_smmu_global_fault_xen(int irq, void *dev, - struct cpu_user_regs *regs) +static void arm_smmu_global_fault_xen(int irq, void *dev) { arm_smmu_global_fault(irq, dev); } --- a/xen/drivers/passthrough/arm/smmu-v3.c +++ b/xen/drivers/passthrough/arm/smmu-v3.c @@ -880,8 +880,7 @@ static void arm_smmu_priq_tasklet(void * static int arm_smmu_device_disable(struct arm_smmu_device *smmu); -static void arm_smmu_gerror_handler(int irq, void *dev, - struct cpu_user_regs *regs) +static void arm_smmu_gerror_handler(int irq, void *dev) { u32 gerror, gerrorn, active; struct arm_smmu_device *smmu = dev; @@ -926,12 +925,11 @@ static void arm_smmu_gerror_handler(int writel(gerror, smmu->base + ARM_SMMU_GERRORN); } -static void arm_smmu_combined_irq_handler(int irq, void *dev, - struct cpu_user_regs *regs) +static void arm_smmu_combined_irq_handler(int irq, void *dev) { struct arm_smmu_device *smmu = dev; - arm_smmu_gerror_handler(irq, dev, regs); + arm_smmu_gerror_handler(irq, dev); tasklet_schedule(&(smmu->combined_irq_tasklet)); } @@ -945,16 +943,14 @@ static void arm_smmu_combined_irq_taskle arm_smmu_priq_tasklet(dev); } -static void arm_smmu_evtq_irq_tasklet(int irq, void *dev, - struct cpu_user_regs *regs) +static void arm_smmu_evtq_irq_tasklet(int irq, void *dev) { struct arm_smmu_device *smmu = dev; tasklet_schedule(&(smmu->evtq_irq_tasklet)); } -static void arm_smmu_priq_irq_tasklet(int irq, void *dev, - struct cpu_user_regs *regs) +static void arm_smmu_priq_irq_tasklet(int irq, void *dev) { struct arm_smmu_device *smmu = dev; --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1117,8 +1117,7 @@ static void cf_check do_iommu_page_fault __do_iommu_page_fault(drhd->iommu); } -static void cf_check iommu_page_fault( - int irq, void *dev_id, struct cpu_user_regs *regs) +static void cf_check iommu_page_fault(int irq, void *dev_id) { /* * Just flag the tasklet as runnable. This is fine, according to VT-d --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -18,7 +18,7 @@ ASSERT(!in_irq() && (local_irq_is_enabled() || num_online_cpus() <= 1)) struct irqaction { - void (*handler)(int irq, void *dev_id, struct cpu_user_regs *regs); + void (*handler)(int irq, void *dev_id); const char *name; void *dev_id; bool free_on_release; @@ -119,12 +119,11 @@ extern int setup_irq(unsigned int irq, u struct irqaction *new); extern void release_irq(unsigned int irq, const void *dev_id); extern int request_irq(unsigned int irq, unsigned int irqflags, - void (*handler)(int irq, void *dev_id, - struct cpu_user_regs *regs), + void (*handler)(int irq, void *dev_id), const char *devname, void *dev_id); extern hw_irq_controller no_irq_type; -void cf_check no_action(int cpl, void *dev_id, struct cpu_user_regs *regs); +void cf_check no_action(int cpl, void *dev_id); unsigned int cf_check irq_startup_none(struct irq_desc *desc); void cf_check irq_actor_none(struct irq_desc *desc); #define irq_shutdown_none irq_actor_none From patchwork Tue Feb 20 08:56:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13563653 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 2CA10C48BC4 for ; Tue, 20 Feb 2024 08:56:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683305.1062766 (Exim 4.92) (envelope-from ) id 1rcLvR-00064Z-Ug; Tue, 20 Feb 2024 08:56:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683305.1062766; Tue, 20 Feb 2024 08:56:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLvR-00064S-Rx; Tue, 20 Feb 2024 08:56:29 +0000 Received: by outflank-mailman (input) for mailman id 683305; Tue, 20 Feb 2024 08:56:29 +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 1rcLvR-0005pz-97 for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:56:29 +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 ef22c0a5-cfcd-11ee-8a52-1f161083a0e0; Tue, 20 Feb 2024 09:56:28 +0100 (CET) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2d247c31e1aso5044261fa.1 for ; Tue, 20 Feb 2024 00:56:28 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.56.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:56:27 -0800 (PST) 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: ef22c0a5-cfcd-11ee-8a52-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419388; x=1709024188; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=UDhUrA6tM7xm4y+MMtOUTP3hYExqNaG8GAdW+v0Ujq4=; b=bqbyqfPzkmlEAMEMfFq7iuZMpyQVhgIkQz2bT2TbguG9hCjXBC/BIrXFrUCYLiMYjZ KQE0MxieGFyVxZVianpSNDqhA7KFK98d7OUcH7t5eEIC+tnxL0MRccthFQcwedDyHNz7 vW5fG/QTRIFTgnjU4XdrXrdH8TLjNHCODFLrH/ITyg1ECk7fMdE3lbaCsCdg7kFWzMfD c+Q+2I3UZ4Z9zgvc9x5SfROb0weIQ/PB63yLziHZ4iD60FJT0hw6dnbDdMt4c4M5ed3m eltGbuhVGdBekDipxih3dyWzgb1l2mXJ4nSwY9Y4xr9520jo7x2MYXqIF/Y/r1oRkLpK PFeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419388; x=1709024188; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UDhUrA6tM7xm4y+MMtOUTP3hYExqNaG8GAdW+v0Ujq4=; b=oWAlPuU8ujHHBImbaCzUlTXYJ2vm+GS0uYI4DH9kTab+UZ/eBD430kE6Ibr9WC6FVD 0fT9ygmvEwy6O7XUKMlmyncFyvolYgJmK7NI2zO4ISxF38BWZovJ5eXZ66X6vOjMbBjH 65V3kE3VQtX6tQ7xqVjvvmSArnOj6fe4er2oE3J2VRGn95bhDZhSrM9x4nqmyr2t6Eju 1mCY8u+q7nPAxdROsd+2oZbDjJVZ2MHhNf9eEFhK7kD39jFgDtDIaPw7mGOjYkm4jTNe NpQQ9FK5KDbLJSXJxkObGpr9aiTpJYnKvlfHGMfzPgrsf1gGihKKNEUrddnPtRD+F3OJ 3UfA== X-Gm-Message-State: AOJu0Yxm/OquBhVDCRLVV8olqcnEAV650vITpQypFJJ1GEJxJq2DD8/D +5UNmMpLZVmRHcXBu23s8aM/pmRCxvYb7byt42lDaea9u1YRqSRmtHZwinCUwdG0SAE+xtPrYfE = X-Google-Smtp-Source: AGHT+IHuJs0sbdMFsDfsnlWZQ85DshqCj5umcoFkvdkaMWTKP5kDN7x4qkZSjrcF5Eipjhvdn4z/0w== X-Received: by 2002:a05:651c:118d:b0:2d2:34d5:63f5 with SMTP id w13-20020a05651c118d00b002d234d563f5mr3365975ljo.52.1708419387794; Tue, 20 Feb 2024 00:56:27 -0800 (PST) Message-ID: <8c9abefd-2871-42e6-b857-6a450f5b833a@suse.com> Date: Tue, 20 Feb 2024 09:56:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 7/8] x86/APIC: drop regs parameter from direct vector handler functions Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Wei Liu , =?utf-8?q?R?= =?utf-8?q?oger_Pau_Monn=C3=A9?= References: 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: The only place it was needed is in the spurious handler, and there we can use get_irq_regs() instead. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -1322,7 +1322,7 @@ int reprogram_timer(s_time_t timeout) return apic_tmict || !timeout; } -static void cf_check apic_timer_interrupt(struct cpu_user_regs *regs) +static void cf_check apic_timer_interrupt(void) { ack_APIC_irq(); perfc_incr(apic_timer); @@ -1341,7 +1341,7 @@ void smp_send_state_dump(unsigned int cp /* * Spurious interrupts should _never_ happen with our APIC/SMP architecture. */ -static void cf_check spurious_interrupt(struct cpu_user_regs *regs) +static void cf_check spurious_interrupt(void) { /* * Check if this is a vectored interrupt (most likely, as this is probably @@ -1355,7 +1355,7 @@ static void cf_check spurious_interrupt( is_spurious = !nmi_check_continuation(); if (this_cpu(state_dump_pending)) { this_cpu(state_dump_pending) = false; - dump_execstate(regs); + dump_execstate(get_irq_regs()); is_spurious = false; } @@ -1372,7 +1372,7 @@ static void cf_check spurious_interrupt( * This interrupt should never happen with our APIC/SMP architecture */ -static void cf_check error_interrupt(struct cpu_user_regs *regs) +static void cf_check error_interrupt(void) { static const char *const esr_fields[] = { ", Send CS error", @@ -1407,7 +1407,7 @@ static void cf_check error_interrupt(str * This interrupt handles performance counters interrupt */ -static void cf_check pmu_interrupt(struct cpu_user_regs *regs) +static void cf_check pmu_interrupt(void) { ack_APIC_irq(); vpmu_do_interrupt(); --- a/xen/arch/x86/cpu/mcheck/mce_intel.c +++ b/xen/arch/x86/cpu/mcheck/mce_intel.c @@ -58,7 +58,7 @@ bool __read_mostly lmce_support; #define MCE_RING 0x1 static DEFINE_PER_CPU(int, last_state); -static void cf_check intel_thermal_interrupt(struct cpu_user_regs *regs) +static void cf_check intel_thermal_interrupt(void) { uint64_t msr_content; unsigned int cpu = smp_processor_id(); @@ -642,7 +642,7 @@ static void cpu_mcheck_disable(void) clear_cmci(); } -static void cf_check cmci_interrupt(struct cpu_user_regs *regs) +static void cf_check cmci_interrupt(void) { mctelem_cookie_t mctc; struct mca_summary bs; --- a/xen/arch/x86/guest/xen/xen.c +++ b/xen/arch/x86/guest/xen/xen.c @@ -158,7 +158,7 @@ static void __init init_memmap(void) } } -static void cf_check xen_evtchn_upcall(struct cpu_user_regs *regs) +static void cf_check xen_evtchn_upcall(void) { struct vcpu_info *vcpu_info = this_cpu(vcpu_info); unsigned long pending; --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2782,7 +2782,7 @@ static struct hvm_function_table __initd }; /* Handle VT-d posted-interrupt when VCPU is blocked. */ -static void cf_check pi_wakeup_interrupt(struct cpu_user_regs *regs) +static void cf_check pi_wakeup_interrupt(void) { struct vmx_vcpu *vmx, *tmp; spinlock_t *lock = &per_cpu(vmx_pi_blocking, smp_processor_id()).lock; @@ -2814,7 +2814,7 @@ static void cf_check pi_wakeup_interrupt } /* Handle VT-d posted-interrupt when VCPU is running. */ -static void cf_check pi_notification_interrupt(struct cpu_user_regs *regs) +static void cf_check pi_notification_interrupt(void) { ack_APIC_irq(); this_cpu(irq_count)++; --- a/xen/arch/x86/include/asm/irq.h +++ b/xen/arch/x86/include/asm/irq.h @@ -72,17 +72,15 @@ extern int opt_irq_vector_map; #define platform_legacy_irq(irq) ((irq) < 16) -void cf_check event_check_interrupt(struct cpu_user_regs *regs); -void cf_check invalidate_interrupt(struct cpu_user_regs *regs); -void cf_check call_function_interrupt(struct cpu_user_regs *regs); -void cf_check irq_move_cleanup_interrupt(struct cpu_user_regs *regs); +void cf_check event_check_interrupt(void); +void cf_check invalidate_interrupt(void); +void cf_check call_function_interrupt(void); +void cf_check irq_move_cleanup_interrupt(void); uint8_t alloc_hipriority_vector(void); -void set_direct_apic_vector( - uint8_t vector, void (*handler)(struct cpu_user_regs *regs)); -void alloc_direct_apic_vector( - uint8_t *vector, void (*handler)(struct cpu_user_regs *regs)); +void set_direct_apic_vector(uint8_t vector, void (*handler)(void)); +void alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void)); void do_IRQ(struct cpu_user_regs *regs); --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -743,7 +743,7 @@ void move_native_irq(struct irq_desc *de desc->handler->enable(desc); } -void cf_check irq_move_cleanup_interrupt(struct cpu_user_regs *regs) +void cf_check irq_move_cleanup_interrupt(void) { unsigned vector, me; @@ -913,16 +913,14 @@ uint8_t alloc_hipriority_vector(void) return next++; } -static void (*direct_apic_vector[X86_NR_VECTORS])(struct cpu_user_regs *regs); -void set_direct_apic_vector( - uint8_t vector, void (*handler)(struct cpu_user_regs *regs)) +static void (*direct_apic_vector[X86_NR_VECTORS])(void); +void set_direct_apic_vector(uint8_t vector, void (*handler)(void)) { BUG_ON(direct_apic_vector[vector] != NULL); direct_apic_vector[vector] = handler; } -void alloc_direct_apic_vector( - uint8_t *vector, void (*handler)(struct cpu_user_regs *regs)) +void alloc_direct_apic_vector(uint8_t *vector, void (*handler)(void)) { static DEFINE_SPINLOCK(lock); @@ -1907,7 +1905,7 @@ void do_IRQ(struct cpu_user_regs *regs) if ( irq < 0 ) { if ( direct_apic_vector[vector] ) - direct_apic_vector[vector](regs); + direct_apic_vector[vector](); else { const char *kind = ", LAPIC"; --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -245,7 +245,7 @@ static cpumask_t flush_cpumask; static const void *flush_va; static unsigned int flush_flags; -void cf_check invalidate_interrupt(struct cpu_user_regs *regs) +void cf_check invalidate_interrupt(void) { unsigned int flags = flush_flags; ack_APIC_irq(); @@ -387,14 +387,14 @@ void smp_send_nmi_allbutself(void) send_IPI_mask(&cpu_online_map, APIC_DM_NMI); } -void cf_check event_check_interrupt(struct cpu_user_regs *regs) +void cf_check event_check_interrupt(void) { ack_APIC_irq(); perfc_incr(ipis); this_cpu(irq_count)++; } -void cf_check call_function_interrupt(struct cpu_user_regs *regs) +void cf_check call_function_interrupt(void) { ack_APIC_irq(); perfc_incr(ipis); From patchwork Tue Feb 20 08:57: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: 13563654 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 C8899C48BC4 for ; Tue, 20 Feb 2024 08:57:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683310.1062777 (Exim 4.92) (envelope-from ) id 1rcLwJ-0006cL-6j; Tue, 20 Feb 2024 08:57:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683310.1062777; Tue, 20 Feb 2024 08:57: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 1rcLwJ-0006cC-3x; Tue, 20 Feb 2024 08:57:23 +0000 Received: by outflank-mailman (input) for mailman id 683310; Tue, 20 Feb 2024 08:57:22 +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 1rcLwI-0006c0-Hh for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:57:22 +0000 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [2a00:1450:4864:20::434]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0e1759d4-cfce-11ee-98f5-efadbce2ee36; Tue, 20 Feb 2024 09:57:20 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33aeb088324so2737124f8f.2 for ; Tue, 20 Feb 2024 00:57:20 -0800 (PST) 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 w14-20020adfcd0e000000b0033d14c96ec1sm12607957wrm.45.2024.02.20.00.57.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Feb 2024 00:57:19 -0800 (PST) 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: 0e1759d4-cfce-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1708419440; x=1709024240; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=jWqlogxB928KUsvmRqerAeKEQfMENuclb4BguYyVDTk=; b=SF4ohpnW9D7Fm8wjP4cqrFRtqujcxVdbqmbJMquRcWyW5AWDFuV7UQuDdLITV/X3gM WaKTpjZqkZTbK0VqmXIniVFYzTk0Gto5X5pPk21WaDEH3fUdlIU2U2J3xqDYwL1WQRLS 8xts3rTU4P4pszUvofiFJGnwrIArfiDD0SRQ5+Uq/YF42I7d225xM0hya+CyA+c41ciu 01vLMEvCVIcZFEe0Tp8FH90xeg9JbOaiXx3wdd/ddbV81sen35miUNfhgN4C69ytGN1w 921LKuQPrPo801kxHxMhETLeZ/pKDQiJ40Q/JAuDE2jOM0oZu/SpyOckVZ/YgEtiA3kd 0zKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419440; x=1709024240; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jWqlogxB928KUsvmRqerAeKEQfMENuclb4BguYyVDTk=; b=uBavmlinFU38OUmEH3VxxHOTG9mVMwPWhTRTCh/IKD9zmWuVcIOGXARl2o8evvvMRu SSzx7zq14qvhtbiUneIoy1oZX+YFvKLqF06RzVeAe+eyh0HdvXo8hgBLYl+co75xDG1j 6oT9HJWhWb/REW73fz5gmLTN7hnsLTJGQ0Hpv0w8mUoWSce048gXXOMtPs1koTWMzCNy lzHKgJDl3C8O0jCY/pWhFAdQRvqYCmATCOur089p9ejbMywAzHEASgghu8l3bT7EPRpm Yr13KnLbwenYk5hN8eBHTnmfAA4aLvI815clDEqlKXQdLSDs5ieP3Jtq6JTWj9C700Hc B9Wg== X-Gm-Message-State: AOJu0Yw07t83kOI6Pl7MNLrb4uDTVgcuNh1cIkkrH4q72GrBmQPGTjpk 3umwezMEe3wpFlWzGzcewFMoSnLjsL+0zAiRpWmc3Zow6iVRTcTVKytUyL7CHqoGTPygpq/8lgI = X-Google-Smtp-Source: AGHT+IGimlpP3q+zJai3qTgVg7wBX5QVYnZUsKu23U7JIy9kYANwGKOm8T5rfmhwGcF89Jp2y2Ei3A== X-Received: by 2002:a5d:47ac:0:b0:33d:38cf:aa73 with SMTP id 12-20020a5d47ac000000b0033d38cfaa73mr5898159wrb.47.1708419439684; Tue, 20 Feb 2024 00:57:19 -0800 (PST) Message-ID: Date: Tue, 20 Feb 2024 09:57:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v4 8/8] consolidate do_bug_frame() / bug_fn_t Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu , Michal Orzel , Bertrand Marquis , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Volodymyr Babchuk References: 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: The type not being used in do_bug_frame() is suspicious. Apparently that's solely because the type uses a pointer-to-const parameter, when so far run_in_exception_handler() wanted functions taking pointer- to-non-const. Expand use of const, in turn requiring common code's do_bug_frame() as well as [gs]et_irq_regs() to also gain const. This then brings the former function also closer to the common one, with Arm's use of vaddr_t remaining as a difference. While there also replace the bogus use of hard tabs in [gs]et_irq_regs() (I clearly didn't mean to put it in like this). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Acked-by: Julien Grall --- This is an alternative proposal to https://lists.xen.org/archives/html/xen-devel/2023-12/msg01385.html. --- v4: Re-base over changes earlier in the series (drop xhci-dbc.c change). v3: Retain / extend use of const. Make part of series. v2: [skipped] --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -220,7 +220,7 @@ void do_IRQ(struct cpu_user_regs *regs, { struct irq_desc *desc = irq_to_desc(irq); struct irqaction *action; - struct cpu_user_regs *old_regs = set_irq_regs(regs); + const struct cpu_user_regs *old_regs = set_irq_regs(regs); perfc_incr(irqs); --- a/xen/arch/x86/include/asm/processor.h +++ b/xen/arch/x86/include/asm/processor.h @@ -409,8 +409,7 @@ static always_inline void rep_nop(void) void show_code(const struct cpu_user_regs *regs); void show_stack_overflow(unsigned int cpu, const struct cpu_user_regs *regs); void show_registers(const struct cpu_user_regs *regs); -#define dump_execution_state() \ - run_in_exception_handler(show_execution_state_nonconst) +#define dump_execution_state() run_in_exception_handler(show_execution_state) void show_page_walk(unsigned long addr); void noreturn fatal_trap(const struct cpu_user_regs *regs, bool show_remote); --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1896,7 +1896,7 @@ void do_IRQ(struct cpu_user_regs *regs) struct irq_desc *desc; unsigned int vector = (uint8_t)regs->entry_vector; int irq = this_cpu(vector_irq)[vector]; - struct cpu_user_regs *old_regs = set_irq_regs(regs); + const struct cpu_user_regs *old_regs = set_irq_regs(regs); perfc_incr(irqs); this_cpu(irq_count)++; --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -643,7 +643,7 @@ void show_stack_overflow(unsigned int cp printk("\n"); } -void show_execution_state(const struct cpu_user_regs *regs) +void cf_check show_execution_state(const struct cpu_user_regs *regs) { /* Prevent interleaving of output. */ unsigned long flags = console_lock_recursive_irqsave(); @@ -655,11 +655,6 @@ void show_execution_state(const struct c console_unlock_recursive_irqrestore(flags); } -void cf_check show_execution_state_nonconst(struct cpu_user_regs *regs) -{ - show_execution_state(regs); -} - void vcpu_show_execution_state(struct vcpu *v) { unsigned long flags = 0; --- a/xen/common/bug.c +++ b/xen/common/bug.c @@ -10,7 +10,7 @@ * Returns a negative value in case of an error otherwise * BUGFRAME_{run_fn, warn, bug, assert} */ -int do_bug_frame(struct cpu_user_regs *regs, unsigned long pc) +int do_bug_frame(const struct cpu_user_regs *regs, unsigned long pc) { const struct bug_frame *bug = NULL; const struct virtual_region *region; @@ -44,14 +44,10 @@ int do_bug_frame(struct cpu_user_regs *r if ( id == BUGFRAME_run_fn ) { - void (*fn)(struct cpu_user_regs *) = bug_ptr(bug); + bug_fn_t *fn = bug_ptr(bug); fn(regs); - /* Re-enforce consistent types, because of the casts involved. */ - if ( false ) - run_in_exception_handler(fn); - return id; } --- a/xen/common/irq.c +++ b/xen/common/irq.c @@ -1,7 +1,7 @@ #include #include -DEFINE_PER_CPU(struct cpu_user_regs *, irq_regs); +DEFINE_PER_CPU(const struct cpu_user_regs *, irq_regs); int init_one_irq_desc(struct irq_desc *desc) { --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -135,7 +135,7 @@ static void cf_check show_handlers(unsig static cpumask_t dump_execstate_mask; -void cf_check dump_execstate(struct cpu_user_regs *regs) +void cf_check dump_execstate(const struct cpu_user_regs *regs) { unsigned int cpu = smp_processor_id(); --- a/xen/drivers/char/ehci-dbgp.c +++ b/xen/drivers/char/ehci-dbgp.c @@ -1246,14 +1246,14 @@ static int cf_check ehci_dbgp_getc(struc /* Safe: ehci_dbgp_poll() runs as timer handler, so not reentrant. */ static struct serial_port *poll_port; -static void cf_check _ehci_dbgp_poll(struct cpu_user_regs *regs) +static void cf_check _ehci_dbgp_poll(const struct cpu_user_regs *regs) { struct serial_port *port = poll_port; struct ehci_dbgp *dbgp = port->uart; unsigned long flags; unsigned int timeout = MICROSECS(DBGP_CHECK_INTERVAL); bool empty = false; - struct cpu_user_regs *old_regs; + const struct cpu_user_regs *old_regs; if ( !dbgp->ehci_debug ) return; --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -206,11 +206,11 @@ static void cf_check ns16550_interrupt(i /* Safe: ns16550_poll() runs as softirq so not reentrant on a given CPU. */ static DEFINE_PER_CPU(struct serial_port *, poll_port); -static void cf_check __ns16550_poll(struct cpu_user_regs *regs) +static void cf_check __ns16550_poll(const struct cpu_user_regs *regs) { struct serial_port *port = this_cpu(poll_port); struct ns16550 *uart = port->uart; - struct cpu_user_regs *old_regs; + const struct cpu_user_regs *old_regs; if ( uart->intr_works ) return; /* Interrupts work - no more polling */ --- a/xen/include/xen/bug.h +++ b/xen/include/xen/bug.h @@ -101,8 +101,7 @@ typedef void bug_fn_t(const struct cpu_u #ifndef run_in_exception_handler -static void always_inline run_in_exception_handler( - void (*fn)(struct cpu_user_regs *regs)) +static void always_inline run_in_exception_handler(bug_fn_t *fn) { BUG_FRAME(BUGFRAME_run_fn, 0, fn, 0, NULL); } @@ -133,7 +132,7 @@ static void always_inline run_in_excepti * Returns a negative value in case of an error otherwise * BUGFRAME_{run_fn, warn, bug, assert} */ -int do_bug_frame(struct cpu_user_regs *regs, unsigned long pc); +int do_bug_frame(const struct cpu_user_regs *regs, unsigned long pc); #endif /* CONFIG_GENERIC_BUG_FRAME */ --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -134,21 +134,22 @@ void cf_check irq_actor_none(struct irq_ * Per-cpu interrupted context register state - the inner-most interrupt frame * on the stack. */ -DECLARE_PER_CPU(struct cpu_user_regs *, irq_regs); +DECLARE_PER_CPU(const struct cpu_user_regs *, irq_regs); -static inline struct cpu_user_regs *get_irq_regs(void) +static inline const struct cpu_user_regs *get_irq_regs(void) { - return this_cpu(irq_regs); + return this_cpu(irq_regs); } -static inline struct cpu_user_regs *set_irq_regs(struct cpu_user_regs *new_regs) +static inline const struct cpu_user_regs *set_irq_regs( + const struct cpu_user_regs *new_regs) { - struct cpu_user_regs *old_regs, **pp_regs = &this_cpu(irq_regs); + const struct cpu_user_regs *old_regs, **pp_regs = &this_cpu(irq_regs); - old_regs = *pp_regs; - *pp_regs = new_regs; + old_regs = *pp_regs; + *pp_regs = new_regs; - return old_regs; + return old_regs; } struct domain; --- a/xen/include/xen/kernel.h +++ b/xen/include/xen/kernel.h @@ -110,8 +110,7 @@ extern const unsigned int xen_config_dat struct cpu_user_regs; struct vcpu; -void show_execution_state(const struct cpu_user_regs *regs); -void cf_check show_execution_state_nonconst(struct cpu_user_regs *regs); +void cf_check show_execution_state(const struct cpu_user_regs *regs); void vcpu_show_execution_state(struct vcpu *v); #endif /* _LINUX_KERNEL_H */ --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -173,7 +173,7 @@ extern char *print_tainted(char *str); extern void add_taint(unsigned int taint); struct cpu_user_regs; -void cf_check dump_execstate(struct cpu_user_regs *regs); +void cf_check dump_execstate(const struct cpu_user_regs *regs); void init_constructors(void);