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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 997EFC433FE for ; Wed, 20 Oct 2021 12:04:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 834E460EE5 for ; Wed, 20 Oct 2021 12:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbhJTMHJ (ORCPT ); Wed, 20 Oct 2021 08:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbhJTMHD (ORCPT ); Wed, 20 Oct 2021 08:07:03 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DE95C061749 for ; Wed, 20 Oct 2021 05:04:48 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id t21so7932276plr.6 for ; Wed, 20 Oct 2021 05:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BCKWEoi8FeeBRDvl5EymVEm69MjyykXFzH9HAs/kyO4=; b=cuiutl2QAAxfwD56hLItqR8kvhCEQ7NLO3pkxhfHS9+G/fMLr1/t8rKVJEqmHJiNpb CZ21EE6qwrk20h7kpm27tNC/c4jVdseWv2S9gIsftsOTHCsJLoVZJc0mJkI8+oObIRwY pMNdJZGPHl1m5HRFt9dwroghBaTQXLkVX66aE= 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=BCKWEoi8FeeBRDvl5EymVEm69MjyykXFzH9HAs/kyO4=; b=U1S1/SNhENlmdWe8/sQKlOSyaRZmUYIIoOJ7u9yYu0je84RtUbWTKu/e7ASGS+6FbB CJ2XfYnwzuNl9ooW1ni4GtWw9d07PQ3YQkFrbB6VdrYbcd8gu9wxlz7b38Fl0xzhPzdW j2Cu40VHC0maybpwBreFyyt78z/ckpHrN5vcTS7Hg+Lw/0cTCIgKyzQAbkFu5DKCEkt5 ZjCvW6/t11ED8gv+NSIwi3NmHGCBE6Xx0YkD8vusEt4lYbw8ISKgy1GXiyeYcDgJOeJu KYKSfK1/N3vkLZ9wV4a8oY0hSksw0VwIYCXQpdJZa/Zlhcr6AUf+HOPJJbVsXLiQX2bm W0vg== X-Gm-Message-State: AOAM530a5FH/ohVqYXu2VopHX/+z3mYvAE8l2g7kAtfW4avYPJzD9Ytr Rat4vGyl5R7fHQNQH0PYEME23SUjJRIdvA== X-Google-Smtp-Source: ABdhPJzr2LjWMqwdO+RhWupttHiFUwdUh98FJ2jVhkMKr665jMBIQfRoeEZuFCiB3w1/PLoDsOA18Q== X-Received: by 2002:a17:90a:c206:: with SMTP id e6mr6827339pjt.193.1634731487726; Wed, 20 Oct 2021 05:04:47 -0700 (PDT) Received: from localhost ([2401:fa00:8f:203:e516:d575:e6f:a526]) by smtp.gmail.com with UTF8SMTPSA id fh3sm5721784pjb.8.2021.10.20.05.04.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Oct 2021 05:04:47 -0700 (PDT) From: Hikaru Nishida To: linux-kernel@vger.kernel.org, dme@dme.org, tglx@linutronix.de, mlevitsk@redhat.com, linux@roeck-us.net, pbonzini@redhat.com, vkuznets@redhat.com, maz@kernel.org, will@kernel.org Cc: suleiman@google.com, senozhatsky@google.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Hikaru Nishida , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Dave Hansen , Geert Uytterhoeven , "H. Peter Anvin" , Ingo Molnar , Ingo Molnar , Jim Mattson , Joerg Roedel , John Stultz , Jonathan Corbet , Juergen Gross , Kees Cook , Lai Jiangshan , Linus Walleij , Peter Zijlstra , Sean Christopherson , Stephen Boyd , Wanpeng Li , kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org Subject: [RFC PATCH v3 0/5] x86/kvm: Virtual suspend time injection support Date: Wed, 20 Oct 2021 21:04:25 +0900 Message-Id: <20211020120431.776494-1-hikalium@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This patch series adds virtual suspend time injection support to KVM. It is an updated version of the following series: v2: https://lore.kernel.org/kvm/20210806100710.2425336-1-hikalium@chromium.org/ v1: https://lore.kernel.org/kvm/20210426090644.2218834-1-hikalium@chromium.org/ Please take a look again. To kvm/arm64 folks: I'm going to implement this mechanism to ARM64 as well but not sure which function should be used to make an IRQ (like kvm_apic_set_irq in x86) and if it is okay to use kvm_gfn_to_hva_cache / kvm_write_guest_cached for sharing the suspend duration. Please let me know if there is other suitable way or any suggestions. Thanks, Hikaru Nishida Changes in v3: - Used PM notifier instead of modifying timekeeping_resume() - This avoids holding kvm_lock under interrupt disabled context. - Used KVM_REQ_* to make a request for vcpus. - Reused HYPERVISOR_CALLBACK_VECTOR IRQ instead of adding a new one. - Extracted arch-independent parts. - Fixed other reviewed points. Hikaru Nishida (5): timekeeping: Expose tk->offs_boot via ktime_get_offs_boot_ns kvm/x86: Include asm/pvclock.h in asm/kvmclock.h kvm/x86: virtual suspend time injection: Add common definitions kvm/x86: virtual suspend time injection: Implement host side kvm/x86: virtual suspend time injection: Implement guest side Documentation/virt/kvm/cpuid.rst | 3 + Documentation/virt/kvm/msr.rst | 30 ++++++++ arch/x86/Kconfig | 13 ++++ arch/x86/include/asm/idtentry.h | 2 +- arch/x86/include/asm/kvm_host.h | 2 + arch/x86/include/asm/kvmclock.h | 11 +++ arch/x86/include/uapi/asm/kvm_para.h | 6 ++ arch/x86/kernel/kvm.c | 14 +++- arch/x86/kernel/kvmclock.c | 26 +++++++ arch/x86/kvm/Kconfig | 13 ++++ arch/x86/kvm/cpuid.c | 4 + arch/x86/kvm/x86.c | 109 +++++++++++++++++++++++++++ arch/x86/mm/fault.c | 2 +- include/linux/kvm_host.h | 48 ++++++++++++ include/linux/timekeeper_internal.h | 5 ++ include/linux/timekeeping.h | 6 ++ kernel/time/timekeeping.c | 56 ++++++++++++++ virt/kvm/kvm_main.c | 88 +++++++++++++++++++++ 18 files changed, 432 insertions(+), 6 deletions(-) -- 2.33.0.1079.g6e70778dc9-goog 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A13A2C433F5 for ; Wed, 20 Oct 2021 12:06:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6EC25610FF for ; Wed, 20 Oct 2021 12:06:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6EC25610FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cpV4kx8orRyGWl8wZ75lCT8eAcr21qA9XLmNV1y2JTQ=; b=Hejooj0NnRw93m YNHrl4xyHORqYGGHlyB3rZisSCKFTVEXxmTpU/FoPalSJ2gLCdq3carZO8GX7nzk4o21SFt3aJS4D leFNU9TqEzm0gjQPKbz3fqg8cCJatfIJmB+qX4ry8qjQANlIMMIf2j3HOD3OgK9RPl/q2X8/5aRmf L7zzMFQN1LOAIKkYp9l2OiL0lC/PgE9P0XWhcvKTpKLh1zjJXJ2SdbanUi9eDRbzY1LYEP748VNtD 8ZgdcqRuqZMbRl0VNLDeqZHtf4r7gokr1CD3X4B3CHotuwxzIUjxFfsEqbaEHiwVm3Ncsc6cOjAK1 3niLqsueYsJMtHBQZj8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdALN-004Pio-BY; Wed, 20 Oct 2021 12:05:17 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdAKv-004PXf-LD for linux-arm-kernel@lists.infradead.org; Wed, 20 Oct 2021 12:04:52 +0000 Received: by mail-pl1-x62a.google.com with SMTP id v20so15966449plo.7 for ; Wed, 20 Oct 2021 05:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BCKWEoi8FeeBRDvl5EymVEm69MjyykXFzH9HAs/kyO4=; b=cuiutl2QAAxfwD56hLItqR8kvhCEQ7NLO3pkxhfHS9+G/fMLr1/t8rKVJEqmHJiNpb CZ21EE6qwrk20h7kpm27tNC/c4jVdseWv2S9gIsftsOTHCsJLoVZJc0mJkI8+oObIRwY pMNdJZGPHl1m5HRFt9dwroghBaTQXLkVX66aE= 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=BCKWEoi8FeeBRDvl5EymVEm69MjyykXFzH9HAs/kyO4=; b=DzHGNoJGsSVAfJiXaBlaCrKcEWw1TzE+LgVPmgYj3J4QOE7FlI5HX4AYvvE6ktFr4T W35qdf05u0K8aBRE/mR4o6XEuNS7jn2fCccrDiPISFLRCYlWDFK0Lsycss52tO1fLOQR ELHF+lFuxG0QkEm2Tdlwt9Vq9kk/xDaBVLa2KykZzHi8xPKgW9lgesbBwparmLGpOUjI sm+l+zMmYBIJE64OlLXJPkvLlvBrmgKsyMC0qwr+hlJx4DvY8l2aPV4Ye+tUXwyBbJn3 XO4Lb0+6kyfksqDQ7s/oIRvNJIplfA7sER7SlcY37eqBGrKXftptzSNBpjv+gf5HZLhP wUQQ== X-Gm-Message-State: AOAM530TlgUPg4HzGY0fAC/m0LXO5jHNYiqcekG+k0hTHv8QeghLyqP+ zBGAdGBBYRTmSOdX+9HwdAI+Xw== X-Google-Smtp-Source: ABdhPJzr2LjWMqwdO+RhWupttHiFUwdUh98FJ2jVhkMKr665jMBIQfRoeEZuFCiB3w1/PLoDsOA18Q== X-Received: by 2002:a17:90a:c206:: with SMTP id e6mr6827339pjt.193.1634731487726; Wed, 20 Oct 2021 05:04:47 -0700 (PDT) Received: from localhost ([2401:fa00:8f:203:e516:d575:e6f:a526]) by smtp.gmail.com with UTF8SMTPSA id fh3sm5721784pjb.8.2021.10.20.05.04.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Oct 2021 05:04:47 -0700 (PDT) From: Hikaru Nishida To: linux-kernel@vger.kernel.org, dme@dme.org, tglx@linutronix.de, mlevitsk@redhat.com, linux@roeck-us.net, pbonzini@redhat.com, vkuznets@redhat.com, maz@kernel.org, will@kernel.org Cc: suleiman@google.com, senozhatsky@google.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Hikaru Nishida , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Dave Hansen , Geert Uytterhoeven , "H. Peter Anvin" , Ingo Molnar , Ingo Molnar , Jim Mattson , Joerg Roedel , John Stultz , Jonathan Corbet , Juergen Gross , Kees Cook , Lai Jiangshan , Linus Walleij , Peter Zijlstra , Sean Christopherson , Stephen Boyd , Wanpeng Li , kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org Subject: [RFC PATCH v3 0/5] x86/kvm: Virtual suspend time injection support Date: Wed, 20 Oct 2021 21:04:25 +0900 Message-Id: <20211020120431.776494-1-hikalium@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211020_050449_779861_ADC5BE3E X-CRM114-Status: GOOD ( 16.98 ) 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 Hi, This patch series adds virtual suspend time injection support to KVM. It is an updated version of the following series: v2: https://lore.kernel.org/kvm/20210806100710.2425336-1-hikalium@chromium.org/ v1: https://lore.kernel.org/kvm/20210426090644.2218834-1-hikalium@chromium.org/ Please take a look again. To kvm/arm64 folks: I'm going to implement this mechanism to ARM64 as well but not sure which function should be used to make an IRQ (like kvm_apic_set_irq in x86) and if it is okay to use kvm_gfn_to_hva_cache / kvm_write_guest_cached for sharing the suspend duration. Please let me know if there is other suitable way or any suggestions. Thanks, Hikaru Nishida Changes in v3: - Used PM notifier instead of modifying timekeeping_resume() - This avoids holding kvm_lock under interrupt disabled context. - Used KVM_REQ_* to make a request for vcpus. - Reused HYPERVISOR_CALLBACK_VECTOR IRQ instead of adding a new one. - Extracted arch-independent parts. - Fixed other reviewed points. Hikaru Nishida (5): timekeeping: Expose tk->offs_boot via ktime_get_offs_boot_ns kvm/x86: Include asm/pvclock.h in asm/kvmclock.h kvm/x86: virtual suspend time injection: Add common definitions kvm/x86: virtual suspend time injection: Implement host side kvm/x86: virtual suspend time injection: Implement guest side Documentation/virt/kvm/cpuid.rst | 3 + Documentation/virt/kvm/msr.rst | 30 ++++++++ arch/x86/Kconfig | 13 ++++ arch/x86/include/asm/idtentry.h | 2 +- arch/x86/include/asm/kvm_host.h | 2 + arch/x86/include/asm/kvmclock.h | 11 +++ arch/x86/include/uapi/asm/kvm_para.h | 6 ++ arch/x86/kernel/kvm.c | 14 +++- arch/x86/kernel/kvmclock.c | 26 +++++++ arch/x86/kvm/Kconfig | 13 ++++ arch/x86/kvm/cpuid.c | 4 + arch/x86/kvm/x86.c | 109 +++++++++++++++++++++++++++ arch/x86/mm/fault.c | 2 +- include/linux/kvm_host.h | 48 ++++++++++++ include/linux/timekeeper_internal.h | 5 ++ include/linux/timekeeping.h | 6 ++ kernel/time/timekeeping.c | 56 ++++++++++++++ virt/kvm/kvm_main.c | 88 +++++++++++++++++++++ 18 files changed, 432 insertions(+), 6 deletions(-) -- 2.33.0.1079.g6e70778dc9-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C982C433F5 for ; Wed, 20 Oct 2021 14:27:50 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 0CA816135E for ; Wed, 20 Oct 2021 14:27:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0CA816135E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 5A6FD4B101; Wed, 20 Oct 2021 10:27:49 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@chromium.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dp7XT6LLxF8X; Wed, 20 Oct 2021 10:27:48 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0D9734B11A; Wed, 20 Oct 2021 10:27:48 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id CFC214B0A3 for ; Wed, 20 Oct 2021 08:04:49 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LdnfYb1Hc4mw for ; Wed, 20 Oct 2021 08:04:48 -0400 (EDT) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8BB4D4B0A0 for ; Wed, 20 Oct 2021 08:04:48 -0400 (EDT) Received: by mail-pj1-f47.google.com with SMTP id e5-20020a17090a804500b001a116ad95caso2293827pjw.2 for ; Wed, 20 Oct 2021 05:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BCKWEoi8FeeBRDvl5EymVEm69MjyykXFzH9HAs/kyO4=; b=cuiutl2QAAxfwD56hLItqR8kvhCEQ7NLO3pkxhfHS9+G/fMLr1/t8rKVJEqmHJiNpb CZ21EE6qwrk20h7kpm27tNC/c4jVdseWv2S9gIsftsOTHCsJLoVZJc0mJkI8+oObIRwY pMNdJZGPHl1m5HRFt9dwroghBaTQXLkVX66aE= 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=BCKWEoi8FeeBRDvl5EymVEm69MjyykXFzH9HAs/kyO4=; b=GEM2o5Ulo61ZyIERKDz7tfimFmm5ixeE7sSKccrB/OhjvoHwBFSYS0CPaXEJEIp62b P8Ln0fTloyHuS7jBI3gDbkajvpd29eGWf6Hv9jJ3scDt1DwRvTIv9sphhyTSipYZ8IrQ XYviSAGrCj5NJRClTM7NqbScjmpeVOV11IianyJsYXuMLIHr6BJBQAHR3XEsqkrZCoQo CNa4PUv/cGC7MDTqiENUA0a64niOYUruiVyd62wqG9bKGx4rqnHKYQ1UXQuk+PpQNPM5 ygyqwKgBacvFA12VM30Sfen7gCyfQUEjnHkbLQqWxz29xWc35Skmq7OqyZOHDxQO3xUu 0gvg== X-Gm-Message-State: AOAM530yo8rI0L8zGNDBCW9yzReyElPglXHHkroLLRCqqcGIhukEZVxK wLarKQCwzkV8B7qBDLHyJ0pCAQ== X-Google-Smtp-Source: ABdhPJzr2LjWMqwdO+RhWupttHiFUwdUh98FJ2jVhkMKr665jMBIQfRoeEZuFCiB3w1/PLoDsOA18Q== X-Received: by 2002:a17:90a:c206:: with SMTP id e6mr6827339pjt.193.1634731487726; Wed, 20 Oct 2021 05:04:47 -0700 (PDT) Received: from localhost ([2401:fa00:8f:203:e516:d575:e6f:a526]) by smtp.gmail.com with UTF8SMTPSA id fh3sm5721784pjb.8.2021.10.20.05.04.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Oct 2021 05:04:47 -0700 (PDT) From: Hikaru Nishida To: linux-kernel@vger.kernel.org, dme@dme.org, tglx@linutronix.de, mlevitsk@redhat.com, linux@roeck-us.net, pbonzini@redhat.com, vkuznets@redhat.com, maz@kernel.org, will@kernel.org Subject: [RFC PATCH v3 0/5] x86/kvm: Virtual suspend time injection support Date: Wed, 20 Oct 2021 21:04:25 +0900 Message-Id: <20211020120431.776494-1-hikalium@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 20 Oct 2021 10:27:47 -0400 Cc: Wanpeng Li , kvm@vger.kernel.org, linux-doc@vger.kernel.org, Peter Zijlstra , Linus Walleij , Dave Hansen , "H. Peter Anvin" , senozhatsky@google.com, Ingo Molnar , kvmarm@lists.cs.columbia.edu, Jonathan Corbet , Joerg Roedel , x86@kernel.org, Hikaru Nishida , Ingo Molnar , Geert Uytterhoeven , suleiman@google.com, Kees Cook , Arnd Bergmann , Lai Jiangshan , John Stultz , Andy Lutomirski , linux-arm-kernel@lists.infradead.org, Jim Mattson , Juergen Gross , Stephen Boyd , Borislav Petkov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi, This patch series adds virtual suspend time injection support to KVM. It is an updated version of the following series: v2: https://lore.kernel.org/kvm/20210806100710.2425336-1-hikalium@chromium.org/ v1: https://lore.kernel.org/kvm/20210426090644.2218834-1-hikalium@chromium.org/ Please take a look again. To kvm/arm64 folks: I'm going to implement this mechanism to ARM64 as well but not sure which function should be used to make an IRQ (like kvm_apic_set_irq in x86) and if it is okay to use kvm_gfn_to_hva_cache / kvm_write_guest_cached for sharing the suspend duration. Please let me know if there is other suitable way or any suggestions. Thanks, Hikaru Nishida Changes in v3: - Used PM notifier instead of modifying timekeeping_resume() - This avoids holding kvm_lock under interrupt disabled context. - Used KVM_REQ_* to make a request for vcpus. - Reused HYPERVISOR_CALLBACK_VECTOR IRQ instead of adding a new one. - Extracted arch-independent parts. - Fixed other reviewed points. Hikaru Nishida (5): timekeeping: Expose tk->offs_boot via ktime_get_offs_boot_ns kvm/x86: Include asm/pvclock.h in asm/kvmclock.h kvm/x86: virtual suspend time injection: Add common definitions kvm/x86: virtual suspend time injection: Implement host side kvm/x86: virtual suspend time injection: Implement guest side Documentation/virt/kvm/cpuid.rst | 3 + Documentation/virt/kvm/msr.rst | 30 ++++++++ arch/x86/Kconfig | 13 ++++ arch/x86/include/asm/idtentry.h | 2 +- arch/x86/include/asm/kvm_host.h | 2 + arch/x86/include/asm/kvmclock.h | 11 +++ arch/x86/include/uapi/asm/kvm_para.h | 6 ++ arch/x86/kernel/kvm.c | 14 +++- arch/x86/kernel/kvmclock.c | 26 +++++++ arch/x86/kvm/Kconfig | 13 ++++ arch/x86/kvm/cpuid.c | 4 + arch/x86/kvm/x86.c | 109 +++++++++++++++++++++++++++ arch/x86/mm/fault.c | 2 +- include/linux/kvm_host.h | 48 ++++++++++++ include/linux/timekeeper_internal.h | 5 ++ include/linux/timekeeping.h | 6 ++ kernel/time/timekeeping.c | 56 ++++++++++++++ virt/kvm/kvm_main.c | 88 +++++++++++++++++++++ 18 files changed, 432 insertions(+), 6 deletions(-) -- 2.33.0.1079.g6e70778dc9-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm