From patchwork Thu Jun 9 11:03:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 580496 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35C82C433EF for ; Thu, 9 Jun 2022 11:04:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243376AbiFILEA (ORCPT ); Thu, 9 Jun 2022 07:04:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243351AbiFILEA (ORCPT ); Thu, 9 Jun 2022 07:04:00 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4364B366BF for ; Thu, 9 Jun 2022 04:03:55 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id b12so14744247ljq.3 for ; Thu, 09 Jun 2022 04:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8uYu8lJiNuFARRdH3Dv0gK66JWjRf/8va0hEQMAWSVE=; b=EMsI0ApUkRgweNKPg6JQ59+57gorw/10/iLwDPMox+DFf4tFX79NVzId4ZnoYaSeIo ItBVH0yUXDl/dOKnowxrWthfkBO14pmFh/pObvY6R0XlN9RXXcUOJdXlciyD9tbNE/mb 7DoUyRDn5YzZDhSgtQYR+fraUF/bEIhS/QWB0o30u0oAZR49OSDY0FkV1Yg3zUxN0xoD BUuJbojVzCL4rxEeIqfAcpRmngggYe/yr0HDMluZjStSaKFZbviwIT3BhLa2OtxLMKlA 9HWXRq6Wg8xi1TBsjlw/rPqpLweQiO/oDugVTY7SsZXfCNHHWJ2N37A3QNlSw/qAG6QG F+wg== 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:date:message-id:mime-version :content-transfer-encoding; bh=8uYu8lJiNuFARRdH3Dv0gK66JWjRf/8va0hEQMAWSVE=; b=gkS/EOAkEdYW9sy6rwNlBeeh5m+e7rOSe+4tIU2cJ0oPYrnHcZil0oBcXXxe9Dwf36 EOGd6DTGSK1ClmcDmCUTHvRAKN6iUkJGhVIukhzG5DRm3cszjd2Rb8y6TUADJCAuNxxg Mh2SBY8D6wg2PkNi00hxb+uiK1lIAa8dBmNbny376mPl33xLvVuLYTU2Bor9RXEWrUxE 85IQUmpBCWpYgLFAYWFwbPQoN8l85mYCw8BlTBj4Fya9WLJaduMN74b/rn/1bV06KKYb 0OApl6Mu9nFhllOk5KH6opbvCpDMOub12yV37UjXfBkRDdx/m6c8MnonI1Zu51lYxHAp szWQ== X-Gm-Message-State: AOAM531ynWe1XLNkZNaMLNcwpYhkrNn+oM+oXwvsWPumYjFGXyKgZTKZ ZfPB9IXVKRFM4VIlk1w8z6ma0g== X-Google-Smtp-Source: ABdhPJzP9OHSzABmTycdeFyssS0y/yZjxyhfETt55oRQaQYmjEFctwgh5JRBToJgpzHJlNQ/K/jgqg== X-Received: by 2002:a2e:b5c5:0:b0:255:5ba4:4892 with SMTP id g5-20020a2eb5c5000000b002555ba44892mr26027566ljn.3.1654772633411; Thu, 09 Jun 2022 04:03:53 -0700 (PDT) Received: from jazctssd.c.googlers.com.com (138.58.228.35.bc.googleusercontent.com. [35.228.58.138]) by smtp.gmail.com with ESMTPSA id a10-20020a194f4a000000b004793605e59dsm2116674lfk.245.2022.06.09.04.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 04:03:52 -0700 (PDT) From: Grzegorz Jaszczyk To: linux-kernel@vger.kernel.org Cc: jaz@semihalf.com, dmy@semihalf.com, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Steve Rutherford , Zide Chen , Peter Fang , Ashish Kalra , Mario Limonciello , Pratik Vishwakarma , Hans de Goede , Alex Deucher , Sachi King , Arnaldo Carvalho de Melo , Wei Wang , Fabiano Rosas , David Dunn , Nicholas Piggin , kvm@vger.kernel.org (open list:KERNEL VIRTUAL MACHINE (KVM)), linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-acpi@vger.kernel.org (open list:ACPI), linux-pm@vger.kernel.org (open list:HIBERNATION (aka Software Suspend, aka swsusp)) Subject: [PATCH 0/2] x86: notify hypervisor/VMM about guest entering s2idle Date: Thu, 9 Jun 2022 11:03:26 +0000 Message-Id: <20220609110337.1238762-1-jaz@semihalf.com> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patchset introduces support which allows to notify first the hypervisor about guest entering the s2idle state (patch #1) and second propagate this notification to user-space so the VMM can take advantage of such notification (patch #2). Please see individual patches and commit logs for more verbose description. Zide Chen (2): x86: notify hypervisor about guest entering s2idle state KVM: x86: notify user space about guest entering s2idle Documentation/virt/kvm/api.rst | 21 +++++++++++++++++++++ Documentation/virt/kvm/x86/hypercalls.rst | 7 +++++++ arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/x86.c | 18 ++++++++++++++++++ drivers/acpi/x86/s2idle.c | 8 ++++++++ include/linux/suspend.h | 1 + include/uapi/linux/kvm.h | 2 ++ include/uapi/linux/kvm_para.h | 1 + kernel/power/suspend.c | 4 ++++ tools/include/uapi/linux/kvm.h | 1 + 10 files changed, 65 insertions(+)