Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1054320ybl; Fri, 10 Jan 2020 11:14:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzwdqrlLxz2iZ5w3ADbXPIP5Iav2vTwvC1NmfNaV8n/jtOej9y2cuObIDQeXzeFtniw0Mpw X-Received: by 2002:aca:ea46:: with SMTP id i67mr3254512oih.149.1578683699837; Fri, 10 Jan 2020 11:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578683699; cv=none; d=google.com; s=arc-20160816; b=Uoc49Z8N7UpT9RbzswigVHRqlxfQJBeebl+ayWORQ+sqw3WjkA3D7dmNwQCNeNjebo C9Mt2AQStxvDFXgR7dcAW/XtXY3dp42PDv3UtFUn3Bgv5cHqoAjScbHCJqdeF8SGVD0+ NHc4NiFcVGDqY+5Du5zCHtge2EIeyAi0Bg0fqac+AzmEDmn/FSLswddg1eJRoVSvCf2d mpV03a+cVH+N1a0O0AZLMRxWfk09hJW5SAdZradf/fTU2axL+U5/1OCR3RvQnLFjetOj uE95vGGM6JU9PQX6Xh2+JjOelc03c4seVj1yawdsOJ+86w2X9lzyKYd78OWjhOydWIHP l7Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from; bh=97JO82qVl2fakLEYDmtdAXkJ5ukJHWnRt4jwPPa/+k8=; b=IuV6YbwMO7tPIzJyFwckWBWAUKPwNj5VRnHESdnSmMD6Xn2RZNYomfSLq9Bvkly536 5BD9q7T7l7XN64SH5EQ9lbluyyT8IIBfT7Q4NA2MIEQ7fJLTh4BH20SIwccd4FIoN5i1 mzUA0Uaan5CpN8AU0fyxjlDqgr4pawJbqbWvu/XH5RDPXPXBAineHDSKwgr8T/HTH2eH MTfK78vocArkUjeXjEVWUCh30knYnkhnuY0HDj9sivXJasGp3txQvaRE4hMbY5qccUHX vLmvT5085CthCj84HHCUI9FOWpiDFpH+uy/etohTufeB/xAN3w8TQQtgXMDtpNnzFouh 4nmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e63si1969276ote.166.2020.01.10.11.14.47; Fri, 10 Jan 2020 11:14:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728585AbgAJTNt (ORCPT + 99 others); Fri, 10 Jan 2020 14:13:49 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:59519 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727831AbgAJTNt (ORCPT ); Fri, 10 Jan 2020 14:13:49 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ipzif-0003It-LL; Fri, 10 Jan 2020 20:13:17 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 067A6105BDB; Fri, 10 Jan 2020 20:13:16 +0100 (CET) From: Thomas Gleixner To: Anchal Agarwal Cc: mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, linux-pm@vger.kernel.org, linux-mm@kvack.org, kamatam@amazon.com, sstabellini@kernel.org, konrad.wilk@oracle.co, roger.pau@citrix.com, axboe@kernel.dk, davem@davemloft.net, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, peterz@infradead.org, eduval@amazon.com, sblbir@amazon.com, xen-devel@lists.xenproject.org, vkuznets@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk, fllinden@amazon.com, anchalag@amazon.com Subject: Re: [RFC PATCH V2 09/11] xen: Clear IRQD_IRQ_STARTED flag during shutdown PIRQs In-Reply-To: <20200109234050.GA26381@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> Date: Fri, 10 Jan 2020 20:13:16 +0100 Message-ID: <87zhevrupf.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Anchal, Anchal Agarwal writes: > On Thu, Jan 09, 2020 at 01:07:27PM +0100, Thomas Gleixner wrote: >> Anchal Agarwal writes: >> So either you can handle it purely on the XEN side without touching any >> core state or you need to come up with some way of letting the core code >> know that it should invoke shutdown instead of disable. >> >> Something like the completely untested patch below. > > Understandable. Really appreciate the patch suggestion below and i will test it > for sure and see if things can be fixed properly in irq core if thats the only > option. In the meanwhile, I tried to fix it on xen side unless it gives you the > same feeling as above? MSI-x are just fine, just ioapic ones don't get any event > channel asssigned hence enable_dynirq does nothing. Those needs to be restarted. > > diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c > index 1bb0b522d004..2ed152f35816 100644 > --- a/drivers/xen/events/events_base.c > +++ b/drivers/xen/events/events_base.c > @@ -575,6 +575,11 @@ static void shutdown_pirq(struct irq_data *data) > > static void enable_pirq(struct irq_data *data) > { > +/*ioapic interrupts don't get event channel assigned > + * after being explicitly shutdown during guest > + * hibernation. They need to be restarted*/ > + if(!evtchn_from_irq(data->irq)) > + startup_pirq(data); > enable_dynirq(data); > } Interesting patch format :) Doing the shutdown from syscore_ops and the startup conditionally in a totaly unrelated function is not really intuitive. So either you do it symmetrically in XEN via syscore_ops callbacks or you let the irq core code help you out with the patch I provided Thanks, tglx