Message ID | 20230412213510.1220557-11-amoorthy@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kvm-owner@vger.kernel.org> 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 3A4ECC77B76 for <kvm@archiver.kernel.org>; Wed, 12 Apr 2023 21:35:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbjDLVfe (ORCPT <rfc822;kvm@archiver.kernel.org>); Wed, 12 Apr 2023 17:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbjDLVf0 (ORCPT <rfc822;kvm@vger.kernel.org>); Wed, 12 Apr 2023 17:35:26 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CEBA83C0 for <kvm@vger.kernel.org>; Wed, 12 Apr 2023 14:35:25 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 132-20020a250c8a000000b00b8f4e12dd57so1884659ybm.1 for <kvm@vger.kernel.org>; Wed, 12 Apr 2023 14:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681335324; x=1683927324; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=fXIZH8fY83vgfwH8POrr//89XoSgOMitG1Dp++mIiPs=; b=YisQpRnBOeAwg9ZX219UZQMhQxuyDfMdNDGwIM7kYemLzsSfZ/SGeZjelJTvKZTX01 h+3Mva+AsoeDLPkEZfXti0QYJCd0Gnxtx2iPS46KcZYJMbtNIpccXd1nkV7JjclKAgOT ZZgzQxYVQewWug5Hu/GM9rA5g0xIWgk9PTD6gv8RLkgLSKnFdVu0S2i0SZwpYwJwRWHr M4RMrS3cKuQowbs4mv/G49o/rXgk/U+bWQ1jnOSm37UF5tkUkoqwpaqgy25/jiVwm4S5 dK6aGhjypYDdse2/jDhX7vXjaJhm5k+2X10ISVVE0X24dQw/ZwqzdXc93uctIAQ/wiBy t+PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681335324; x=1683927324; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fXIZH8fY83vgfwH8POrr//89XoSgOMitG1Dp++mIiPs=; b=aTO9V1orO3vKZuCIig4wTgLj5J9WhrhaEteUG0IrNOKz4U+yTi+/ItE3R9nyxYfYW5 qnCT+RacP1WHgOK2p4esDxiPOhUerGd5rxvyzwikOa5aCWfQn7Q3b41sv6WhmDcuL2gs G2H2+YDCEO2bJ8QAElB7KPTsAxSRAVaLfZ4moSSKfX90Y2sHYCMX0D7DItXcXAdCe82q QN+RlDUYk9CvLb3jB77stjuRSHqVUcVEN2iUT7Vg6Ec8BcN78ll5ZO1jfL6NgNXlTgHE W+Oe0uRTu1X9M9p8bMkEZJZj229CDCE7UyPX6x+hTIwUtwjbPA/CcQmIv7keAkYZPEXH HTtQ== X-Gm-Message-State: AAQBX9cmQB00v6xlJ4N85pfbF/SgN5Qj1NwqWTuJkFY/DR/XonZt1JV6 J+epPxnDe97NAlC3R3SVq42rWGyHE6lhqg== X-Google-Smtp-Source: AKy350bhXrkwYHL2oiwHoVZPq1a1kZqsww17x6UiZcbBFdt3mgWFNOOcT1fYEgc+pglz1McVDcJD24DYEi1ceQ== X-Received: from laogai.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:2c9]) (user=amoorthy job=sendgmr) by 2002:a0d:ec02:0:b0:54c:2723:560d with SMTP id q2-20020a0dec02000000b0054c2723560dmr8663ywn.3.1681335324351; Wed, 12 Apr 2023 14:35:24 -0700 (PDT) Date: Wed, 12 Apr 2023 21:34:58 +0000 In-Reply-To: <20230412213510.1220557-1-amoorthy@google.com> Mime-Version: 1.0 References: <20230412213510.1220557-1-amoorthy@google.com> X-Mailer: git-send-email 2.40.0.577.gac1e443424-goog Message-ID: <20230412213510.1220557-11-amoorthy@google.com> Subject: [PATCH v3 10/22] KVM: x86: Annotate -EFAULTs from kvm_mmu_page_fault() From: Anish Moorthy <amoorthy@google.com> To: pbonzini@redhat.com, maz@kernel.org Cc: oliver.upton@linux.dev, seanjc@google.com, jthoughton@google.com, amoorthy@google.com, bgardon@google.com, dmatlack@google.com, ricarkol@google.com, axelrasmussen@google.com, peterx@redhat.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: <kvm.vger.kernel.org> X-Mailing-List: kvm@vger.kernel.org |
Series |
Improve scalability of KVM + userfaultfd live migration via annotated memory faults.
|
expand
|
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 144c5a01cd778..7391d1f75149d 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -5670,6 +5670,9 @@ int noinline kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u64 err return -EIO; } + if (r == -EFAULT) + kvm_populate_efault_info(vcpu, round_down(cr2_or_gpa, PAGE_SIZE), + PAGE_SIZE); if (r < 0) return r; if (r != RET_PF_EMULATE)
Implement KVM_CAP_MEMORY_FAULT_INFO for efaults generated by kvm_mmu_page_fault(). Signed-off-by: Anish Moorthy <amoorthy@google.com> --- arch/x86/kvm/mmu/mmu.c | 3 +++ 1 file changed, 3 insertions(+)