From patchwork Thu Jan 11 07:31: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: 13516846 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 F2C0BC4725D for ; Thu, 11 Jan 2024 07:32:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665931.1036263 (Exim 4.92) (envelope-from ) id 1rNpXk-0006kz-N7; Thu, 11 Jan 2024 07:32:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665931.1036263; Thu, 11 Jan 2024 07:32: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 1rNpXk-0006ks-KL; Thu, 11 Jan 2024 07:32:00 +0000 Received: by outflank-mailman (input) for mailman id 665931; Thu, 11 Jan 2024 07:31: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 1rNpXi-0006km-Tg for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:31:58 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 805b57fa-b053-11ee-98f0-6d05b1d4d9a1; Thu, 11 Jan 2024 08:31:57 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3368b9bbeb4so4746911f8f.2 for ; Wed, 10 Jan 2024 23:31: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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.31.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:31: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: 805b57fa-b053-11ee-98f0-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958317; x=1705563117; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=0ec8vWmu/5aIAhFU+GtuouuNHSKMP58o3QH8ANpxtGg=; b=I/KoAXKqYCLKRnuVh9/rtkg/KW4c/RHFFgfayPD1jSp0jPNk7spZhZpKBTVI8uqSYB 6whUr8nKJBhnAdSJI4iELq/rdr4i3Rn0q0UmsADkUO5XO1e2ScdOaxo2hRidXFJtVZOi 5pb6qZStGvrMNHJTGV0I4T/SfNi7dqqst8+7Bc1HOkzDkTfxPmS1DM2/WRLc56KU3VEC u+twnmqSFiPUWF/vtdI5C+bF+LtbiBUq4+/+YxRAHRrIb4+8Katp1EwierzRDXtPB1Uz //Xu1X0HJFx9fLhLjuaJsUKml+sZSmZHPGwfFD586bJaA9oNuzEBqSpMc96tMMsSydYZ M4Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958317; x=1705563117; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0ec8vWmu/5aIAhFU+GtuouuNHSKMP58o3QH8ANpxtGg=; b=AOfMA8KE83RQeyx2v8aW8YPrmAitod+2iJDCvPrCS0JrFa8LbInD/rwq3EsAgPatMV ZhVauNNkeXlOzcZa034jpDfI0FQIjn4D/E5Kn49HJDRMoJxBdVUJ9lEOWzdkH+U3keNJ W59wYkCNJvNzR7ZZ6QOlZ/m+rLHsf3zfPkB2QGTI0jImja9T0HrxfFHxhw9nmX8wpKvQ Z3BLvuN0kXE/CxvsPC0hl+MgemqD18wQ/sCYQUXbRd1EEPsgsjxOPgBsbPoDR/vCypD5 EpW4+AVfSdXTMQkmA7AB42Kdrz/x40zspeRNcIox6VqoiFwXiCxohCM2eRWQCorbv2Qv x45g== X-Gm-Message-State: AOJu0Yx5vQOlyCKrW1C72JvdYmWqDRr47mw001jXR5ihxBS3vsJPnXQc GCwv4Y0Q+fp7AdH3ArqOSE7v4GrtiVgXkSbdbBxnWxRheg== X-Google-Smtp-Source: AGHT+IGhgxIDgO87l4RjWlKzB5FKF5WI1Cp6iqB39lTenwigtQLspP79tdMvxU216jd8w1rdt2tonQ== X-Received: by 2002:adf:e612:0:b0:32d:cd02:d4f3 with SMTP id p18-20020adfe612000000b0032dcd02d4f3mr149688wrm.40.1704958317480; Wed, 10 Jan 2024 23:31:57 -0800 (PST) Message-ID: Date: Thu, 11 Jan 2024 08:31:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 1/8] keyhandler: don't pass cpu_user_regs around From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu References: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZ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5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> There are exactly two handlers which care about the registers. Have handle_keypress() make the pointer available via a per-CPU variable, thus eliminating the need to pass it to all IRQ key handlers, making sure that a console-invoked key's handling can still nest inside a sysctl-invoked one's. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper with a few trivial Reviewed-by: Julien Grall --- Subsequently we may want to eliminate the fn/irq_fn union as well, along with dropping the now redundant irq_keyhandler_fn_t. --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -80,6 +80,7 @@ static void cf_check keypress_action(voi } static DECLARE_TASKLET(keypress_tasklet, keypress_action, NULL); +static DEFINE_PER_CPU(struct cpu_user_regs *, keypress_regs); void handle_keypress(unsigned char key, struct cpu_user_regs *regs) { @@ -91,7 +92,16 @@ 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); + if ( h->irq_callback ) + { + struct cpu_user_regs *old = this_cpu(keypress_regs); + + this_cpu(keypress_regs) = regs; + h->irq_fn(key); + this_cpu(keypress_regs) = old; + } + else + h->fn(key); console_end_log_everything(); } else @@ -171,8 +181,7 @@ void cf_check dump_execstate(struct cpu_ watchdog_enable(); } -static void cf_check dump_registers( - unsigned char key, struct cpu_user_regs *regs) +static void cf_check dump_registers(unsigned char key) { unsigned int cpu; @@ -185,8 +194,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 ( this_cpu(keypress_regs) ) + dump_execstate(this_cpu(keypress_regs)); else run_in_exception_handler(dump_execstate); @@ -248,8 +257,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) { printk("'%c' pressed -> rebooting machine\n", key); machine_restart(0); @@ -477,8 +485,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) { struct keyhandler *h; unsigned int k; @@ -494,7 +501,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); } watchdog_enable(); @@ -511,17 +518,16 @@ static void cf_check do_debugger_trap_fa barrier(); } -static void cf_check do_debug_key(unsigned char key, struct cpu_user_regs *regs) +static void cf_check do_debug_key(unsigned char key) { printk("'%c' pressed -> trapping into debugger\n", key); - if ( regs ) - do_debugger_trap_fatal(regs); + if ( this_cpu(keypress_regs) ) + do_debugger_trap_fatal(this_cpu(keypress_regs)); else run_in_exception_handler(do_debugger_trap_fatal); } -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) { alt_key_handling = !alt_key_handling; printk("'%c' pressed -> using %s key handling\n", key, --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -280,7 +280,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) { if ( upper_thresh_adj == &xenlog_upper_thresh ) { @@ -307,13 +307,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) { ++*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) { if ( *lower_thresh_adj ) --*lower_thresh_adj; --- a/xen/include/xen/keyhandler.h +++ b/xen/include/xen/keyhandler.h @@ -24,9 +24,7 @@ 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); +typedef void irq_keyhandler_fn_t(unsigned char key); /* Initialize keytable with default handlers. */ void initialize_keytable(void); @@ -46,6 +44,7 @@ void register_irq_keyhandler(unsigned ch bool diagnostic); /* Inject a keypress into the key-handling subsystem. */ +struct cpu_user_regs; extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs); enum crash_reason { From patchwork Thu Jan 11 07:32:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13516847 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 80D1BC4707B for ; Thu, 11 Jan 2024 07:32:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665936.1036273 (Exim 4.92) (envelope-from ) id 1rNpYL-0007KS-6J; Thu, 11 Jan 2024 07:32:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665936.1036273; Thu, 11 Jan 2024 07:32:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNpYL-0007KL-28; Thu, 11 Jan 2024 07:32:37 +0000 Received: by outflank-mailman (input) for mailman id 665936; Thu, 11 Jan 2024 07:32:36 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNpYK-0006km-78 for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:32:36 +0000 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [2a00:1450:4864:20::433]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 96d048ed-b053-11ee-98f0-6d05b1d4d9a1; Thu, 11 Jan 2024 08:32:35 +0100 (CET) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-336c5b5c163so2976199f8f.1 for ; Wed, 10 Jan 2024 23:32:35 -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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.32.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:32:34 -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: 96d048ed-b053-11ee-98f0-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958355; x=1705563155; 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=wA+BZrWdWKLSqnO5cn9IF1o10HKUmp9PaScVUp+oxcs=; b=GWHihiTglGv0/HCNKtwjOULUdNmcLNt1HROFvWHzZgz61z3eobUFE6pkx42TvC/Ixb Bj+WLsNeVlkUxhf1wdbHbuGEMFJN0miAnjDc0xgjYanmVbTnRhf8e2jrMzscBcdzFUr/ BVhjzYcJ0BV7PIB1owtHDAo+e1zVj/KyL8qC0cuHJP1gE/lJnr47YfHkMG/JyaecUnCT swyw+vkEggCIQW5I9q8NdnKiwYy5/Zl/26RCVDfi60Kgl7Ft2W9q6fC5Xv/3jMTIZvcW LSSnOaIwqboExZjqvtKZKcYEn/PS7EW2Sv/hBx1crnUQzS3sEH+r3/V4xpRlerwkYq25 UJSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958355; x=1705563155; 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=wA+BZrWdWKLSqnO5cn9IF1o10HKUmp9PaScVUp+oxcs=; b=bfddBHLwF0o4K68/PglgnQGDk/s+JLz/a4zKDuQ/+EAMBJ00AwlJZxlQBSiSyhoPNn jJ6i+adAGi+b2CYWhDIiArdeM4kBYSFS3xK/0aMwj6qysegm1CJTmmUO1dmGw237laHz VjVO262Wh7YhZPlETv85v1XBgAHudgPF7y30CoKRsGLIRR3JVN/3CJoC7dYZLvPzpoJK fpY55Y4ky9a2tbEpmFNgtLQ+M47VXvvEeL4KyIo50F7fJDcACm67MIuNvEJLWp9/jOON Lss72Nu9RGv4/qlWnMo8PWfYF/hRANT1zMt7q9cqIfy6AFvQs2Vz+0S8aFjrGSgGhi/W fVdQ== X-Gm-Message-State: AOJu0Yw1Ey4BOEBacZApr/f1WyjeeurtGsHABmuuwm7uWASAMuNpoujR I+PBXgpbFKryA94U5gaspHmH5sn6qHxzkjjIgAy4fBkblA== X-Google-Smtp-Source: AGHT+IFtYbsBF5PPDoQ/YjTSVY769vqpu8ell/GA9dVTLANxBaEpgyWgzA0r2mIm0j986nNwl3zCpA== X-Received: by 2002:a5d:53cf:0:b0:336:61e1:a325 with SMTP id a15-20020a5d53cf000000b0033661e1a325mr160157wrw.35.1704958355022; Wed, 10 Jan 2024 23:32:35 -0800 (PST) Message-ID: <4c6d11b0-32dd-4ce3-a157-a848b6fc3154@suse.com> Date: Thu, 11 Jan 2024 08:32:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/8] IRQ: generalize [gs]et_irq_regs() Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Bertrand Marquis , Michal Orzel References: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaG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Reply-To: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> Move functions (and their data) to common code, and invoke the functions on Arm as well. This is in preparation of dropping the register parameters from handler functions. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper with one wording Reviewed-by: Julien Grall --- To limit visibility of the per-CPU data item, we may want to consider making the functions out-of-line ones (in common/irq.c). --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -221,6 +221,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); perfc_incr(irqs); @@ -288,6 +289,7 @@ out: out_no_end: spin_unlock(&desc->lock); irq_exit(); + set_irq_regs(old_regs); } void release_irq(unsigned int irq, const void *dev_id) --- a/xen/arch/x86/include/asm/irq.h +++ b/xen/arch/x86/include/asm/irq.h @@ -70,27 +70,6 @@ extern bool opt_noirqbalance; extern int opt_irq_vector_map; -/* - * Per-cpu current frame pointer - the location of the last exception frame on - * the stack - */ -DECLARE_PER_CPU(struct cpu_user_regs *, __irq_regs); - -static inline struct cpu_user_regs *get_irq_regs(void) -{ - return this_cpu(__irq_regs); -} - -static inline struct cpu_user_regs *set_irq_regs(struct cpu_user_regs *new_regs) -{ - struct cpu_user_regs *old_regs, **pp_regs = &this_cpu(__irq_regs); - - old_regs = *pp_regs; - *pp_regs = new_regs; - return old_regs; -} - - #define platform_legacy_irq(irq) ((irq) < 16) void cf_check event_check_interrupt(struct cpu_user_regs *regs); --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -53,8 +53,6 @@ static DEFINE_SPINLOCK(vector_lock); DEFINE_PER_CPU(vector_irq_t, vector_irq); -DEFINE_PER_CPU(struct cpu_user_regs *, __irq_regs); - static LIST_HEAD(irq_ratelimit_list); static DEFINE_SPINLOCK(irq_ratelimit_lock); static struct timer irq_ratelimit_timer; --- a/xen/common/irq.c +++ b/xen/common/irq.c @@ -1,6 +1,8 @@ #include #include +DEFINE_PER_CPU(struct cpu_user_regs *, irq_regs); + int init_one_irq_desc(struct irq_desc *desc) { int err; --- a/xen/include/xen/irq.h +++ b/xen/include/xen/irq.h @@ -131,6 +131,26 @@ void cf_check irq_actor_none(struct irq_ #define irq_disable_none irq_actor_none #define irq_enable_none irq_actor_none +/* + * Per-cpu interrupted context register state - the top-most interrupt frame + * on the stack. + */ +DECLARE_PER_CPU(struct cpu_user_regs *, irq_regs); + +static inline struct cpu_user_regs *get_irq_regs(void) +{ + return this_cpu(irq_regs); +} + +static inline struct cpu_user_regs *set_irq_regs(struct cpu_user_regs *new_regs) +{ + struct cpu_user_regs *old_regs, **pp_regs = &this_cpu(irq_regs); + + old_regs = *pp_regs; + *pp_regs = new_regs; + return old_regs; +} + struct domain; struct vcpu; From patchwork Thu Jan 11 07:33:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13516848 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 CB984C4707B for ; Thu, 11 Jan 2024 07:33:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665939.1036283 (Exim 4.92) (envelope-from ) id 1rNpYn-0007qi-DW; Thu, 11 Jan 2024 07:33:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665939.1036283; Thu, 11 Jan 2024 07:33:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNpYn-0007qb-9t; Thu, 11 Jan 2024 07:33:05 +0000 Received: by outflank-mailman (input) for mailman id 665939; Thu, 11 Jan 2024 07:33:04 +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 1rNpYm-0007qR-JI for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:33:04 +0000 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [2a00:1450:4864:20::231]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a6dc1c08-b053-11ee-9b0f-b553b5be7939; Thu, 11 Jan 2024 08:33:02 +0100 (CET) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ccbc328744so60196421fa.3 for ; Wed, 10 Jan 2024 23:33:02 -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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.33.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:33:01 -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: a6dc1c08-b053-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958382; x=1705563182; 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=2kKucQeG9hzCGGVi5VOoQwoW+K7wlDclKUZkgMvdu4E=; b=DAyc2LdCGcXPFuiKikfOwaS1lUkyNgmGyLP+t+iwK8P39JIC/U0KnWLd4W3nRgoMBJ AuLMnVt0Vv/fbmxFmpZSCjAKh34D6KkpJFu3EFpWHDRRIWhFxVFvyiyqT2oa+oZexEiH mxfJaiIv6AkgacfCma2AItwwc/QYdsKeazoiPDV0uDDsT8Z7rCvzFbWcAgcpVSrVhDcX 479l/EqwoS+8nstZvBx90dFzYKJw6+8YrXMNMhitzAXZFW/12MPiGWbM30DFBHHLzzQn EE4a81jFdIlp9yjVrpIvO1v2+0HIC+RGg801Ltm5PRgHbIeRXlY7NNd2Z6EFzyIZOI/p KPVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958382; x=1705563182; 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=2kKucQeG9hzCGGVi5VOoQwoW+K7wlDclKUZkgMvdu4E=; b=kNQUnIC02UuPBsFATpzP9/0P8HNyJOWtjQ+J8rmKr5UKrAUWscuUKSbu7et3MbvOZJ 9Go5FllLmvpyo0RgF2f9kFa4FjWJJFZwn8wQR3OXG04CFIO3daVOKQ52sbXcLxkhTnDm j5iec0Ra8nbE6TJ2cG077IOEd0btNpCJRxoYsfSOOIupywCKaERQ2n/I+Yvfe04kST5E JMrIFqK/pHzss1pFPc/xlbLInw/wSabHjIcFiciupDvgvC3IJgYHgkxOa2h7XbY2th8d 2yf2ymlql2dAf559PvVNJm6QHOFolneLQzkh7Vz8Ug7NZSx5dJ5d9DXBU8Lks6w41LuE WiNg== X-Gm-Message-State: AOJu0YyksScqybK7sQKGq3ucmv+TCJuCD4VK1X3nlmKn4xkj+uPW6epa HWcUKVwTCMXkqX8BqYRppYm29JlrQWzxz+pPwIqMaik6Vw== X-Google-Smtp-Source: AGHT+IFQekxv9tUuiagrg5drhbJERoq26nkI56qXh+ZK1ZGc/hJ3bsOKg5LcG6KpV2NCbTOAozTDLQ== X-Received: by 2002:a2e:91cb:0:b0:2cc:d7a7:8ecb with SMTP id u11-20020a2e91cb000000b002ccd7a78ecbmr153085ljg.16.1704958381888; Wed, 10 Jan 2024 23:33:01 -0800 (PST) Message-ID: <0087ad97-d315-4891-ab35-7a41e62d2f23@suse.com> Date: Thu, 11 Jan 2024 08:33:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 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: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> 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: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> In the one place where it's needed, get_irq_regs() can be used instead. This is in preparation of dropping the register parameters from IRQ handler functions. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -527,12 +527,12 @@ 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 ) { case 0: - return handle_keypress(c, regs); + return handle_keypress(c, get_irq_regs()); case 1: /* @@ -579,7 +579,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; @@ -595,10 +595,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 Thu Jan 11 07:33:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13516855 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 082FAC47077 for ; Thu, 11 Jan 2024 07:33:39 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665944.1036293 (Exim 4.92) (envelope-from ) id 1rNpZD-0008N3-K6; Thu, 11 Jan 2024 07:33:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665944.1036293; Thu, 11 Jan 2024 07:33:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNpZD-0008Mu-HK; Thu, 11 Jan 2024 07:33:31 +0000 Received: by outflank-mailman (input) for mailman id 665944; Thu, 11 Jan 2024 07:33:30 +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 1rNpZC-0008BU-F0 for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:33:30 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b721da82-b053-11ee-98f0-6d05b1d4d9a1; Thu, 11 Jan 2024 08:33:29 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e60e13581so1644855e9.1 for ; Wed, 10 Jan 2024 23:33:29 -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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.33.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:33:29 -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: b721da82-b053-11ee-98f0-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958409; x=1705563209; 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=zoKC8ochUFPTshQ5L/IkWmgj0imM/XqiSRmWYZZF9pU=; b=b8cIvKacQ6v3ddGkl7jW7lW/Hf6aABTV9kBdI3Fuxg0r3GGRkpDykFYWjiAYdiYUXV cbxxFc3/FMP0utm9kS/Z8F5F+usw7T+z5EaTA43AvKvF6bvgFsbCi+yG0r+hIiEE2e/y xcfwA14pJjMRc2ZoSfWSOvk+UZRrQkdSfUqGtAUJgeBppEnd6jhpuDfg9dUu9KU6axFX 4/VExv32NTZwtpqofvGnummRpn+YFHuTq1d9eVgiuKjsYlPuktce163932CD3XZUigPx 1lceiaaOI82RiA72UsKNBrJvtXXQrmbVPcJ8DMdh/fJ4RwA2plz8n6yyZ81vvamDMnGo m+lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958409; x=1705563209; 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=zoKC8ochUFPTshQ5L/IkWmgj0imM/XqiSRmWYZZF9pU=; b=Yndq0IIeE7Vb09cbfQ82tlE7VdmSsOMrlKsGt8cCY2r4/g7/zB3UvjI3XRfvHpt2+a PYXn+j/eWL+GFXtwnnVaRiy9q9jal/aWsmVZbyo1/6wOhNL4Bagqm4zL073UY7JAUfgr 4cAWMi7QpNonhiYJwp6/wZ0IqHBbpe0dSN4hHDNZcznahE/3ZYPWkWUkBYzmGPaErtig WTMQxwmdUrSiA1mhMpM+Kdj+cUPnE7zwKlO/NGN7mXPJU7o6noG5Cc35X7TC87D3vbFF q/Puw+tdV5yT4tDI3TCERRPbJw+2X/UStTQs2eiktgA67GtoMlRVTnrDMJGr5bzbNcGk 44Eg== X-Gm-Message-State: AOJu0YwWAYAuHQLd8tLFTHtHHCUn6ZD8NFYW4piLWfmJ2t0xKCLf8ygd YEabZ3kMXjtJDxUfa9MC+O91wr63Rufq4pL8YLTAAI1auw== X-Google-Smtp-Source: AGHT+IHyTbTJlMfyu1Skg6ua3LsV/wsiVNoYjRHuZms4oBZQdS7LsfVCbB1nUCObOrSCjMPgo+R/ZA== X-Received: by 2002:a05:600c:a002:b0:40d:3e8b:855e with SMTP id jg2-20020a05600ca00200b0040d3e8b855emr90591wmb.142.1704958409333; Wed, 10 Jan 2024 23:33:29 -0800 (PST) Message-ID: Date: Thu, 11 Jan 2024 08:33:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 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 , =?utf-8?q?Roger_Pau_Monn=C3=A9?= References: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4H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Fkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> 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 Thu Jan 11 07:34: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: 13516856 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 8EB19C4707B for ; Thu, 11 Jan 2024 07:34:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665949.1036302 (Exim 4.92) (envelope-from ) id 1rNpaE-0000XS-TM; Thu, 11 Jan 2024 07:34:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665949.1036302; Thu, 11 Jan 2024 07:34:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNpaE-0000XL-QL; Thu, 11 Jan 2024 07:34:34 +0000 Received: by outflank-mailman (input) for mailman id 665949; Thu, 11 Jan 2024 07:34:33 +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 1rNpaD-0000XC-OO for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:34:33 +0000 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [2a00:1450:4864:20::336]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id dc9aadaf-b053-11ee-98f0-6d05b1d4d9a1; Thu, 11 Jan 2024 08:34:32 +0100 (CET) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e60e13581so1653715e9.1 for ; Wed, 10 Jan 2024 23:34: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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.34.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:34:31 -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: dc9aadaf-b053-11ee-98f0-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958472; x=1705563272; 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=oZKCYOY6gg3N8LW61PDUiaDApFPPurPi/J2T7sVSPdg=; b=N2j4rO7/S+XmTPoGdFpAWuiF5LOKyPQeVsXICi3HUfxGYNjC8qYx2rtTQeSntGB83i 4n+MLfolAdp4ddeDqhWHJDILkOvU4rr6vkH1yUo/l5NMoD/v8kAqettQaSWlXcdmKwXi qybgOFjsmCtERMZol5MaIN21eaji3GfQDxOyJJKT0tz6sKZAZSuAk8dlBmwrzSOWdh/Q OMlVHYqGWIJuDtdYHi8CsJlY8vwonSn3OvUSbTUEQocNgDMbK6UrkY9Zp52ocr+uipWN ctrQziUZuYwEn6DDSdazGMp2VHrMWwL9ASMxD7rw2D7fIyZl0/h9S1Zk16f3pg0ObclS aGgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958472; x=1705563272; 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=oZKCYOY6gg3N8LW61PDUiaDApFPPurPi/J2T7sVSPdg=; b=EKWn6BWSQFGTniCcbYOmQiCEwZGi9Ny2c995Omcq4o7GOV1SgFCzRFAmlXU9iBr0QY 8GyA+1w/3455rRbIct6yt+Bj4ILhJVJS5Pij1Qi8PYEDcGUAW+CMcgyqXFditZ/9NdEc wd1dJPnv2auJC3zWDJfZsUnut5Zp+YKqHphqNUAmSnSVt8BfzCeyBghIoDg6ADJkhSCo pSTUSaGhIGNscxhkPNEEZdeOfB44If8dIw6YQgYHRVj5CK2TfVXcbZF+gsthHvMAPR/I Eo1qTjvAWsS6hlR91WXi4JQb7kUQy3UPiYoy2ykXNNnQeQcJPai2BK9+QyScEeQ+k1yn VMWA== X-Gm-Message-State: AOJu0YzXwqqYcDj0v09+D/xu9Qnzx6DYSU+9yDMFflYWgPbn7CjW6Hf/ 0xPofrACCtYXhNAlcUZmpVRda0+St+N1U2aDioXSUFruYg== X-Google-Smtp-Source: AGHT+IHLJlz2c/qbYVyOLjZctY3pLI6OSnMk/W+Ulnl4UM8Mb2lIMCrBge74IAUwiV/oUu+Fgj+CmQ== X-Received: by 2002:a05:600c:314f:b0:40e:49ac:e4a6 with SMTP id h15-20020a05600c314f00b0040e49ace4a6mr107078wmo.171.1704958472053; Wed, 10 Jan 2024 23:34:32 -0800 (PST) Message-ID: <05b1284a-988c-4f91-9cde-4751332aaa96@suse.com> Date: Thu, 11 Jan 2024 08:34:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 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 , Bertrand Marquis , Michal Orzel References: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZ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SpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> In the the polling functions (ab)using set_irq_regs() is necessary to balance the change. This is in preparation of dropping the register parameters from IRQ handler functions. Signed-off-by: Jan Beulich --- 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 @@ -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,11 +1269,16 @@ 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); + serial_rx_interrupt(port); if ( empty ) - serial_tx_interrupt(port, regs); + serial_tx_interrupt(port); + + set_irq_regs(old_regs); if ( spin_trylock_irqsave(&port->tx_lock, flags) ) { --- 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 @@ -211,22 +211,27 @@ 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) ) 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); set_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms)); } --- 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 @@ -1164,6 +1164,7 @@ static void cf_check dbc_uart_poll(void struct dbc_uart *uart = port->uart; struct dbc *dbc = &uart->dbc; unsigned long flags = 0; + struct cpu_user_regs *old_regs; if ( spin_trylock_irqsave(&port->tx_lock, flags) ) { @@ -1175,10 +1176,15 @@ static void cf_check dbc_uart_poll(void spin_unlock_irqrestore(&port->tx_lock, flags); } + /* Mimic interrupt context. */ + old_regs = set_irq_regs(guest_cpu_user_regs()); + 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_irq_regs(old_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); @@ -155,8 +153,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 Thu Jan 11 07:35:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13516857 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 00E4AC47077 for ; Thu, 11 Jan 2024 07:35:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665955.1036313 (Exim 4.92) (envelope-from ) id 1rNpb5-00018n-Ay; Thu, 11 Jan 2024 07:35:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665955.1036313; Thu, 11 Jan 2024 07:35:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNpb5-00018g-8J; Thu, 11 Jan 2024 07:35:27 +0000 Received: by outflank-mailman (input) for mailman id 665955; Thu, 11 Jan 2024 07:35:26 +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 1rNpb4-00018Y-PB for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:35:26 +0000 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [2a00:1450:4864:20::42e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fc2a3a49-b053-11ee-98f0-6d05b1d4d9a1; Thu, 11 Jan 2024 08:35:25 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-336755f1688so4272290f8f.0 for ; Wed, 10 Jan 2024 23:35:25 -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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.35.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:35:24 -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: fc2a3a49-b053-11ee-98f0-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958525; x=1705563325; 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=TMrbBvkZhskVDNFDVa776VDzvxg6i1Meo4j2L0PFpIY=; b=Ka9lgTFDG9SrMk16tJKPHQIDGylIVs1SfFFFHNdG1s55miL2E9asJCyQSskcL5kUjn GbDzflDaGE2UzXEzT96SOHoeXnbX5ijireGrDtkpXy9hskQ55eD1anddNAelOE5tQV2q Iz8Qbw3/EHt+AwCYS0KlwirEsIIH98cl0jC8iNITHW7Dwx0Ctb7BWpzz0h/HNIr1192j es576RCLuZRmUMEtQb4irLw/rpDxn2fNueP5pojLqB2kQsTPUraDwI4Q3xhxQ9+mWpIy glcTJ08WnRzMjxbZ0EVuuQrbfByuRMPvO0v1MnDZFFQYR/KhD0QIMpZcQ86UofMSODXf gsdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958525; x=1705563325; 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=TMrbBvkZhskVDNFDVa776VDzvxg6i1Meo4j2L0PFpIY=; b=tRI64Z/tFgDiqRLX4hT6ZiediXAfd12I++zd5w/gt+F5nHuNNSSVDx0/lfXNmsTlEh 6hsv7XM8OaG6iU5RDQMBAdlmL6hVp8YHcxWVLgiZuoIRpHE2nvYIi1UxERqO87xy86VY nb3Tp9D4bH3Sj9mEb4vVUdzBbpdaPVvR4A9W+ePH6z1+gE50LVQHGaSRna5uzIJrmBsV /xctGBh5nR1h0aPO4khNazyPkamCJMS+xcmYAPl5/MhPEOVX5SfsZJ8sXJ0BWp+92fj9 qtmcnrXAKCl1woRbT37hxNPdNSrYViflLrG712kB1NLr777bG+ZYUT7KIgQSiQeKuL1g 7D3w== X-Gm-Message-State: AOJu0YyfTRzdePQ4ldgktcfQyZIAv03yZCn0GAOhHRvjsddSCYWKA7EQ 0UOhwA32l++RKBzE+qDsLaqtMXycM1W3ETXo0B5dcTiaZg== X-Google-Smtp-Source: AGHT+IGvxnj4i0FkUHie6I9iC/M+vw+/zXVrk6qxwayAQIhoCucG+Q4PXg7/4v+ZtPGxmp/Qn/crhA== X-Received: by 2002:a5d:440e:0:b0:336:779b:97a1 with SMTP id z14-20020a5d440e000000b00336779b97a1mr298049wrq.74.1704958525128; Wed, 10 Jan 2024 23:35:25 -0800 (PST) Message-ID: Date: Thu, 11 Jan 2024 08:35:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 6/8] IRQ: drop register 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 , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Bertrand Marquis , Michal Orzel , Kevin Tian References: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> 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: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> 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 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=7d12e780e003f93433d49ce78cfedf4b4c52adc5 Reviewed-by: Andrew Cooper Acked-by: Julien Grall --- 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/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,8 +925,7 @@ 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; @@ -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 @@ -1119,8 +1119,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 Thu Jan 11 07:36:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13516858 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 4DFF4C47077 for ; Thu, 11 Jan 2024 07:36:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665958.1036322 (Exim 4.92) (envelope-from ) id 1rNpbn-0001eG-JZ; Thu, 11 Jan 2024 07:36:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665958.1036322; Thu, 11 Jan 2024 07:36: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 1rNpbn-0001e9-Gu; Thu, 11 Jan 2024 07:36:11 +0000 Received: by outflank-mailman (input) for mailman id 665958; Thu, 11 Jan 2024 07:36:10 +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 1rNpbm-00018Y-GC for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:36:10 +0000 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [2a00:1450:4864:20::42e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 167aee1a-b054-11ee-98f0-6d05b1d4d9a1; Thu, 11 Jan 2024 08:36:09 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33761e291c1so2929717f8f.0 for ; Wed, 10 Jan 2024 23:36:09 -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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.36.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:36:09 -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: 167aee1a-b054-11ee-98f0-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958569; x=1705563369; 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=wsJ7I3Jk/zIngfzbN4LmAFxnYbDQ+MHJGcXuNQpvhR0=; b=RlGdGYBIY3n2TtmHTQuesvPhoFS0+uPksPAUd2mqCJeBc7vpfAXK6txTjPuhBapKWN GzCfFNeuFGnf8b9buECKLPSEN003zpuJX8KWZBgRmUwj5KjMAhD1aXPcIRnU0NDUZPRb lLevMxIsSCUcnaFQHunK5BK4KxWxiDoelOchK+omRRRmD8DBqYAZ8u45dtbl4ZAurxqk WY2Udahagp4/cseKCaK4jDu/ZI++qg5pfU/ZJ/HGeyxzeZqXT8gEiOavqa9JZY6Hw9FU mFbTnMa2TimDQs74HYDTZlfDkmXpdZ4rj52rK9UMNHtLN86Zl0TCRxmt3dTxcvyg8OnT KF2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958569; x=1705563369; 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=wsJ7I3Jk/zIngfzbN4LmAFxnYbDQ+MHJGcXuNQpvhR0=; b=fpJyPOXYlpU670dmkm2091ej2vknp3sJb8GUfbjkiti5f73XT4TVsDU9LLl6YduDvy Tx86lClXByNXZk7H05xuglFDyMgGg3L/SoWGEz4d/F0X8SlUYFODPwZviQbwkMXF2Bt7 CtNDE4jcTD96wv34DirvxWDB/6ou7tP6aXgMDQlR8FtVHRbU5nUaIptsfuBgFwQWDN3m o9aF+tQf0GmpmN64GPpRB+mH4lTNUFqM3XN6UmVRQvEE/JNg4Mbcat7Iz9CRk7V6Pzxf OfiD8w8H9cphvywyXArIyRf2ujZ3ThYnIVnneKypjdtA5788FSgAJhsmhMoLob4uFkSL Xzmw== X-Gm-Message-State: AOJu0YxtmNdOJCBuPaVme0B1YHp28o/Ncq52bftplSwgwQBV5C7iIcb3 oUT/4sSWxbAdRPwPS3J9fp8gJn8vfEGlhViCqSFu8tNDUA== X-Google-Smtp-Source: AGHT+IE3hOSLi7u6eZsceZeT2j0xRdDCG/3bXrXJZVUUgBtflr46yVh4GcwSgLEbkryx8nxxJNW/8A== X-Received: by 2002:a05:600c:354a:b0:40d:891e:a0f1 with SMTP id i10-20020a05600c354a00b0040d891ea0f1mr119263wmq.7.1704958569288; Wed, 10 Jan 2024 23:36:09 -0800 (PST) Message-ID: Date: Thu, 11 Jan 2024 08:36:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 7/8] x86/vPMU: drop regs parameter from interrupt 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: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvU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cpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> The vendor functions don't use the respective parameters at all. In vpmu_do_interrupt() there's only a very limited area where the outer context's state would be needed, retrievable by get_irq_regs(). This is in preparation of dropping the register parameters from direct APIC vector handler functions. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -1412,7 +1412,7 @@ static void cf_check error_interrupt(str static void cf_check pmu_interrupt(struct cpu_user_regs *regs) { ack_APIC_irq(); - vpmu_do_interrupt(regs); + vpmu_do_interrupt(); } void __init apic_intr_init(void) --- a/xen/arch/x86/cpu/vpmu.c +++ b/xen/arch/x86/cpu/vpmu.c @@ -158,7 +158,7 @@ static inline struct vcpu *choose_hwdom_ return hardware_domain->vcpu[idx]; } -void vpmu_do_interrupt(struct cpu_user_regs *regs) +void vpmu_do_interrupt(void) { struct vcpu *sampled = current, *sampling; struct vpmu_struct *vpmu; @@ -239,6 +239,7 @@ void vpmu_do_interrupt(struct cpu_user_r else #endif { + const struct cpu_user_regs *regs = get_irq_regs(); struct xen_pmu_regs *r = &vpmu->xenpmu_data->pmu.r.regs; if ( (vpmu_mode & XENPMU_MODE_SELF) ) @@ -301,7 +302,7 @@ void vpmu_do_interrupt(struct cpu_user_r /* We don't support (yet) HVM dom0 */ ASSERT(sampling == sampled); - if ( !alternative_call(vpmu_ops.do_interrupt, regs) || + if ( !alternative_call(vpmu_ops.do_interrupt) || !is_vlapic_lvtpc_enabled(vlapic) ) return; --- a/xen/arch/x86/cpu/vpmu_amd.c +++ b/xen/arch/x86/cpu/vpmu_amd.c @@ -175,7 +175,7 @@ static void amd_vpmu_unset_msr_bitmap(st msr_bitmap_off(vpmu); } -static int cf_check amd_vpmu_do_interrupt(struct cpu_user_regs *regs) +static int cf_check amd_vpmu_do_interrupt(void) { return 1; } --- a/xen/arch/x86/cpu/vpmu_intel.c +++ b/xen/arch/x86/cpu/vpmu_intel.c @@ -772,7 +772,7 @@ static void cf_check core2_vpmu_dump(con } } -static int cf_check core2_vpmu_do_interrupt(struct cpu_user_regs *regs) +static int cf_check core2_vpmu_do_interrupt(void) { struct vcpu *v = current; u64 msr_content; --- a/xen/arch/x86/include/asm/vpmu.h +++ b/xen/arch/x86/include/asm/vpmu.h @@ -31,7 +31,7 @@ struct arch_vpmu_ops { int (*initialise)(struct vcpu *v); int (*do_wrmsr)(unsigned int msr, uint64_t msr_content); int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content); - int (*do_interrupt)(struct cpu_user_regs *regs); + int (*do_interrupt)(void); void (*arch_vpmu_destroy)(struct vcpu *v); int (*arch_vpmu_save)(struct vcpu *v, bool to_guest); int (*arch_vpmu_load)(struct vcpu *v, bool from_guest); @@ -99,7 +99,7 @@ static inline bool vpmu_are_all_set(cons void vpmu_lvtpc_update(uint32_t val); int vpmu_do_msr(unsigned int msr, uint64_t *msr_content, bool is_write); -void vpmu_do_interrupt(struct cpu_user_regs *regs); +void vpmu_do_interrupt(void); void vpmu_initialise(struct vcpu *v); void vpmu_destroy(struct vcpu *v); void vpmu_save(struct vcpu *v); From patchwork Thu Jan 11 07:36:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13516859 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 6B4C8C47077 for ; Thu, 11 Jan 2024 07:37:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.665968.1036332 (Exim 4.92) (envelope-from ) id 1rNpcU-0002Bi-S4; Thu, 11 Jan 2024 07:36:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 665968.1036332; Thu, 11 Jan 2024 07:36:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rNpcU-0002BZ-PE; Thu, 11 Jan 2024 07:36:54 +0000 Received: by outflank-mailman (input) for mailman id 665968; Thu, 11 Jan 2024 07:36:53 +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 1rNpcT-000203-Df for xen-devel@lists.xenproject.org; Thu, 11 Jan 2024 07:36:53 +0000 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [2a00:1450:4864:20::32d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2f7f94bc-b054-11ee-9b0f-b553b5be7939; Thu, 11 Jan 2024 08:36:51 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e5bfa260bso6194715e9.3 for ; Wed, 10 Jan 2024 23:36:51 -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 d6-20020a056000114600b003366a9cb0d1sm444087wrx.92.2024.01.10.23.36.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jan 2024 23:36:51 -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: 2f7f94bc-b054-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1704958611; x=1705563411; 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=GfRv3gongelxjdY816blQolB01Qj493E2xtw5+iJNEY=; b=ZZURtIiCjV5cM4DLpCWgATUShi9sa+8B0p199ITGP4lDFvamkDetwn2o/8Y/z4KB5b WQglwyX6smtoAtbrhV/L7R3wpdk5mZwoaS25SEAtw6OPQZwJ4/8QoEqIRvZG700RXpls mno1bql8Zekf1H5bPg5lluViLIY4hktp23U57/9BpKsEa9bhJNKrDImeJyT41tzycUeN z3TUaNLMxmpqGXcXAPkuXhTrp+Bgf4YI/rDJZXQXhxAS/PFfFwP/iapyFEkvKDF2WFSR OCwVC9d8hn2mcsKEZtxsgIJVGpwMFAyNB+ny/YgjSTLFjBgCTDsUxbx3sswJ/mjQEEal DjHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704958611; x=1705563411; 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=GfRv3gongelxjdY816blQolB01Qj493E2xtw5+iJNEY=; b=MhGBp0Is1iegFQ/Q/7Z2BkdI0B9PlHBbN9zT+2ByIclhrOg3UePOzt30iSBiNWjRtj jb4CxxhJYvzjbX6tn3jJAGkDexrlMv4dDIIxfcHjAgt1Ffm4vt6ni35bXtq2i1mBJKYG QoGqY/YA7ssSjO8271W5MMfZkz8BRZd8C8lX3mzS1tfJaYcExTy1XToer3u5dcLtLxuB vmL4uSfG9E31odJIf2TDIRJS4oeBI9Juwi2qn/ilE/KclFHolJnXvxmgRMn7LiClbk06 CfGLQjrXS3TaSpu39X2vnMklYBprMHjN60f5ut7n4CoXjM+Ru7DPZKwenluR8C5yoYSP OdVA== X-Gm-Message-State: AOJu0YyJumr+hqB5XPFwqhbwSY69y+U/Q13hlJEshLIMZDYdDbl2ZRwU eN/diDYkndyHTqTW+77LueLT8GzUJUFjmQFImQzJnbADmQ== X-Google-Smtp-Source: AGHT+IG3tnoyxIZ9O3Bq7VsN87C/tYpYyQ1jZygtip84+LEZW3cYmflTHGa0hbvjQW32umKq7BSsLg== X-Received: by 2002:a7b:c44d:0:b0:40d:9534:d214 with SMTP id l13-20020a7bc44d000000b0040d9534d214mr66929wmi.223.1704958611319; Wed, 10 Jan 2024 23:36:51 -0800 (PST) Message-ID: <0afca177-4dce-4d73-8790-82256a620ec3@suse.com> Date: Thu, 11 Jan 2024 08:36:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 8/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?= , Kevin Tian , Jun Nakajima References: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUr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FhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <1ab231ec-5e3c-4662-8530-2213bc52bb7c@suse.com> 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 @@ -1324,7 +1324,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); @@ -1343,7 +1343,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 @@ -1357,7 +1357,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; } @@ -1374,7 +1374,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", @@ -1409,7 +1409,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 @@ -2773,7 +2773,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; @@ -2805,7 +2805,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);