From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6D542C433F5 for ; Thu, 5 May 2022 13:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dijU9Aqt8d5DXW2xvhWh8VbdZ4xnNNhV0C/p+LCN7wE=; b=C5VeORlXkpkfcB hnUDDATumqPIL3fUlPBVkIFMtBzQMDF8xnC/ZLNYlhpUDIbD9MFY8Qd4YVvf4qsJp6gZoPSf4rnCY 7n4KHOMZOlOwLCU6a9zHC/P1eZOdlNHQuU8l7LG0UGKvzGPXTSh+gfiBoPz2UgMgxqJjAMe05kV0O qZqJ4tO321JPuIzFTOyVDg/07UTQafIpm1prjyy5eO91rXKMD9YIFBGa0ZNKr8Uh+U/AP8GHCDP7O mblZ0T42I5odMEE4YOZd7B0Z5Ox4n1c2fjUAHLSAogiFGxekW7SSMS4chnLS/pidMYaXvIij4SJlG orkjEnIDqLW7hpYhMVMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmbvu-00GC3K-9a; Thu, 05 May 2022 13:54:19 +0000 Received: from us-smtp-delivery-74.mimecast.com ([170.10.133.74]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmbvo-00GC1J-2b for linux-arm-kernel@lists.infradead.org; Thu, 05 May 2022 13:54:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651758849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tg+1N9l4/UGQjj1ui3wLc+7zUF5Zg5FliDgij7q2A5E=; b=MiYscfTz1Y62vaDEyRgXd7ThyrQpIeTN37XoyEiy+7woW7CiWZ1ycCAAQkx4Jy+CmOs3Mi AyTrgnWEgZid+8QF1fl+FWqKAh/kUzZrfEPWeBNqGb//HwKAZ54qx2n52SppC2+XIf0snC pkiBhkPdQ6rT8vIxqHDd10z1bP9nHeU= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-402-ILa6AWxOMum79etIwrn8QA-1; Thu, 05 May 2022 09:52:27 -0400 X-MC-Unique: ILa6AWxOMum79etIwrn8QA-1 Received: by mail-wm1-f72.google.com with SMTP id k35-20020a05600c1ca300b003946a9764baso676058wms.1 for ; Thu, 05 May 2022 06:52:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=tg+1N9l4/UGQjj1ui3wLc+7zUF5Zg5FliDgij7q2A5E=; b=F8aKwfFXXZ9kFCYuG7kPs7kW8orpK6yVch0nSw4McPhLJmT53VAUD1o4TkS+qoNJyA tVSxXjaI0zMDzkjzmqAPNtFaKLWH+JO4KUg0pOCJG1TjJ0aEuxXJpZjc/NK9k6zIDs0t iYNRMqUZkGWFULdx+cDmUTBCvB5WBn8YFTEmCL1IOcIMUZr3bHiu57CU4qTtCrR8fmCh fORVfMTpJmhf9rSAv4e2xf5o+X748vxldK52Sqkwb3+SHhW/+vR2E8aokV3nFBqovnZw EbZpbDTMyhV6f1+qZbymIbpSSyagkmYJMgs7d64zodMO6ti0HKR4k0PBOp80kdUCIUhm u7yg== X-Gm-Message-State: AOAM530AFOvp1/Us7uyafSZxIUySD0WoGIcF8RM8aXinUSOW4X9qpJ+t /n065RK2u3VLe8pJZayRhw8ZyljG/Bxh5kTWYMkyY9cmC0VE6koa/dYHjfuEGYi3Id+U43R5J2K NFsJpLxUU32ddFZVubhjRjMDOgRYqwcLmAxc= X-Received: by 2002:a05:6000:136b:b0:20a:c416:e914 with SMTP id q11-20020a056000136b00b0020ac416e914mr21083132wrz.167.1651758745996; Thu, 05 May 2022 06:52:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1N1cypAPDCQRCuIrBe7oEloHiYyuU7KVpyywETK6PeLOX9U0Cef0xV1mmkI0idV7FnO+yfQ== X-Received: by 2002:a05:6000:136b:b0:20a:c416:e914 with SMTP id q11-20020a056000136b00b0020ac416e914mr21083107wrz.167.1651758745771; Thu, 05 May 2022 06:52:25 -0700 (PDT) Received: from fedora (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id s22-20020a1cf216000000b003942a244ee9sm1410841wmc.46.2022.05.05.06.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 06:52:25 -0700 (PDT) From: Vitaly Kuznetsov To: "Guilherme G. Piccoli" , Mark Rutland , "Michael Kelley (LINUX)" Cc: Marc Zyngier , Catalin Marinas , will Deacon , Russell King , Ard Biesheuvel , broonie@kernel.org, "linux-arm-kernel@lists.infradead.org" , linux-kernel , "linux-hyperv@vger.kernel.org" Subject: Re: Should arm64 have a custom crash shutdown handler? In-Reply-To: <3bee47db-f771-b502-82a3-d6fac388aa89@igalia.com> References: <427a8277-49f0-4317-d6c3-4a15d7070e55@igalia.com> <874k24igjf.wl-maz@kernel.org> <92645c41-96fd-2755-552f-133675721a24@igalia.com> <3bee47db-f771-b502-82a3-d6fac388aa89@igalia.com> Date: Thu, 05 May 2022 15:52:24 +0200 Message-ID: <878rrg13zb.fsf@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vkuznets@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220505_065412_242056_3AEACCDD X-CRM114-Status: GOOD ( 24.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org "Guilherme G. Piccoli" writes: > On 05/05/2022 09:53, Mark Rutland wrote: >> [...] >> Looking at those, the cleanup work is all arch-specific. What exactly would we >> need to do on arm64, and why does it need to happen at that point specifically? >> On arm64 we don't expect as much paravirtualization as on x86, so it's not >> clear to me whether we need anything at all. >> >>> Anyway, the idea here was to gather a feedback on how "receptive" arm64 >>> community would be to allow such customization, appreciated your feedback =) >> >> ... and are you trying to do this for Hyper-V or just using that as an example? >> >> I think we're not going to be very receptive without a more concrete example of >> what you want. >> >> What exactly do *you* need, and *why*? Is that for Hyper-V or another hypervisor? >> >> Thanks >> Mark. > > Hi Mark, my plan would be doing that for Hyper-V - kind of the same > code, almost. For example, in hv_crash_handler() there is a stimer > clean-up and the vmbus unload - my understanding is that this same code > would need to run in arm64. Michael Kelley is CCed, he was discussing > with me in the panic notifiers thread and may elaborate more on the needs. > > But also (not related with my specific plan), I've seen KVM quiesce code > on x86 as well [see kvm_crash_shutdown() on arch/x86] , I'm not sure if > this is necessary for arm64 or if this already executing in some > abstracted form, I didn't dig deep - probably Vitaly is aware of that, > hence I've CCed him here. Speaking about the difference between reboot notifiers call chain and machine_ops.crash_shutdown for KVM/x86, the main difference is that reboot notifier is called on some CPU while the VM is fully functional, this way we may e.g. still use IPIs (see kvm_pv_reboot_notify() doing on_each_cpu()). When we're in a crash situation, machine_ops.crash_shutdown is called on the CPU which crashed. We can't count on IPIs still being functional so we do the very basic minimum so *this* CPU can boot kdump kernel. There's no guarantee other CPUs can still boot but normally we do kdump with 'nprocs=1'. For Hyper-V, the situation is similar: hv_crash_handler() intitiates VMbus unload on the crashing CPU only, there's no mechanism to do 'global' unload so other CPUs will likely not be able to connect Vmbus devices in kdump kernel but this should not be necessary. There's a crash_kexec_post_notifiers mechanism which can be used instead but it's disabled by default so using machine_ops.crash_shutdown is better. -- Vitaly _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel