From patchwork Fri Jan 27 23:51:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 49725 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1106363wrn; Fri, 27 Jan 2023 15:58:00 -0800 (PST) X-Google-Smtp-Source: AK7set8MbRgX2X58KIqbakQMgVRoDuu0+6VwPReuMsdB9Y+jOU+0Gfpv0UbugQLqOQlDG+Nr9XSv X-Received: by 2002:a17:902:ea0d:b0:196:266d:6a82 with SMTP id s13-20020a170902ea0d00b00196266d6a82mr16164379plg.2.1674863880397; Fri, 27 Jan 2023 15:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674863880; cv=none; d=google.com; s=arc-20160816; b=wE1gREEhXmTGGEFMRiBqZxFsau5rntBhoyglZJeUwGj7LNEp+xAncvwNR2ng94S7Do mwI/N/caK1pBeNGEdrNmzsJ26NfJgLeVZ365A3mYeyJpF/fTaGGg5hlRtLFGVRy5HNrt 3oSfdFIUGyrn7M/ZZff4q5diYBpfHhoEOJZKrCLKaqYITfJxJdCbOaSrGTU+KhPbN70A iEqmM6OYcjWx2DALf5TzBioM6I5Cydl0DF2BRjrMGupy56Q5Wly6ImAWQvtVbzTPV/FM CIkdxvneWJMuLgedi6MseAgwTKC/bhpFBXXBMpY0b86ZV5StmJAfzefmKxlkuxxHFrKn eYCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kli5sE9lIHwCvZbbt0ccDIlIdit3t3RFH2I2s6WRBok=; b=bxtmkHoLE59wsgx5xq/PVQJzLxJe7VgznDG5lg+Y2VZ+9oFxrr+Mg87T3Rq1wuzQxG KbwlZx3G2E3bVXU69eUw1e0lFUd4pawXva0X4B2Vx1A2n7DkkrR+KblYCZXPXVOl9QQm dLDIdRSw40KSvsmL5jNCkVYftGpl5t5GLJgPSTFbVKKiLKLUlWUtLDObPbvJPdvsOtka LVcxLxQmcdqDtU7Q3MfBopfHzHiv7SdnrNCe573GSvPRJCukQWd/pORK8Xo3wBAXmm2l T+Zzc4O1yWpjhpl0Q0CrAlxW23er7XKqp5hfrscnxN7YmSm5LImxiyyed50BehOT9RYI /4Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Vwk2AyR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a170902854200b001898aa48d1asi5379510plo.444.2023.01.27.15.57.48; Fri, 27 Jan 2023 15:58:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Vwk2AyR4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229619AbjA0Xxb (ORCPT + 99 others); Fri, 27 Jan 2023 18:53:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232254AbjA0Xx0 (ORCPT ); Fri, 27 Jan 2023 18:53:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 435CB84FB5 for ; Fri, 27 Jan 2023 15:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674863559; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kli5sE9lIHwCvZbbt0ccDIlIdit3t3RFH2I2s6WRBok=; b=Vwk2AyR47b9ZhpRRCAaoT4VmqT2dfeQ8FQ6Lqzyz+usTCBXnff0ma2jhDCtyQgcx0e9Uuh BpLxbjoqjazWmIkkCejh4Ue9WaMUbU/MnPINnsYp8a9XXBgoXA2y1spULq2ix3JXfDxFt7 SE3Vcze4n+T2xhejaVJEGCEm6f9opUE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-Q5XBn_UUMMCmDKAq2A9obQ-1; Fri, 27 Jan 2023 18:52:36 -0500 X-MC-Unique: Q5XBn_UUMMCmDKAq2A9obQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 836E23804067; Fri, 27 Jan 2023 23:52:35 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-64.bne.redhat.com [10.64.54.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC4F240ED413; Fri, 27 Jan 2023 23:52:27 +0000 (UTC) From: Gavin Shan To: kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu Cc: pbonzini@redhat.com, corbet@lwn.net, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org, yuzhe@nfschina.com, gshan@redhat.com, seanjc@google.com, isaku.yamahata@intel.com, ricarkol@google.com, eric.auger@redhat.com, renzhengeek@gmail.com, reijiw@google.com, shan.gavin@gmail.com Subject: [PATCH v4 1/4] KVM: arm64: Include kvm_mmu.h from vgic.h Date: Sat, 28 Jan 2023 07:51:47 +0800 Message-Id: <20230127235150.17025-2-gshan@redhat.com> In-Reply-To: <20230127235150.17025-1-gshan@redhat.com> References: <20230127235150.17025-1-gshan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756222068190982323?= X-GMAIL-MSGID: =?utf-8?q?1756222068190982323?= We need a unified helper in 'kvm/vgic/vgic.h' to write guest memory. In the helper, the check of no-running-vcpu context for dirty ring will be applied. kvm_write_guest_lock(), defined in 'include/asm/kvm_mmu.h', is going to be dereferenced by the unified helper. Include 'include/asm/kvm_mmu.h' to 'kvm/vgic/vgic.h' to avoid including the former header file when the later one is needed. With the change, the duplicate inclusions of 'include/asm/kvm_mmu.h' are removed. No functional change intended. Suggested-by: Oliver Upton Signed-off-by: Gavin Shan --- arch/arm64/kvm/vgic/vgic-debug.c | 1 - arch/arm64/kvm/vgic/vgic-init.c | 1 - arch/arm64/kvm/vgic/vgic-its.c | 1 - arch/arm64/kvm/vgic/vgic-kvm-device.c | 1 - arch/arm64/kvm/vgic/vgic-mmio-v3.c | 1 - arch/arm64/kvm/vgic/vgic-v2.c | 1 - arch/arm64/kvm/vgic/vgic-v3.c | 1 - arch/arm64/kvm/vgic/vgic.h | 1 + 8 files changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index 78cde687383c..69201c2dfc6c 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "vgic.h" /* diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index f6d4f4052555..de389a5bec45 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -9,7 +9,6 @@ #include #include #include -#include #include "vgic.h" /* diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c index 94a666dd1443..ad4bb69ab83e 100644 --- a/arch/arm64/kvm/vgic/vgic-its.c +++ b/arch/arm64/kvm/vgic/vgic-its.c @@ -18,7 +18,6 @@ #include #include -#include #include "vgic.h" #include "vgic-mmio.h" diff --git a/arch/arm64/kvm/vgic/vgic-kvm-device.c b/arch/arm64/kvm/vgic/vgic-kvm-device.c index edeac2380591..552668a91bd9 100644 --- a/arch/arm64/kvm/vgic/vgic-kvm-device.c +++ b/arch/arm64/kvm/vgic/vgic-kvm-device.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include "vgic.h" diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c index 91201f743033..8ba04f4fa63d 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c +++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c @@ -13,7 +13,6 @@ #include #include -#include #include "vgic.h" #include "vgic-mmio.h" diff --git a/arch/arm64/kvm/vgic/vgic-v2.c b/arch/arm64/kvm/vgic/vgic-v2.c index 645648349c99..d8604fdfdfcd 100644 --- a/arch/arm64/kvm/vgic/vgic-v2.c +++ b/arch/arm64/kvm/vgic/vgic-v2.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "vgic.h" diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c index 2074521d4a8c..5dfbd03e5e1a 100644 --- a/arch/arm64/kvm/vgic/vgic-v3.c +++ b/arch/arm64/kvm/vgic/vgic-v3.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include "vgic.h" diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h index 0c8da72953f0..056425e3a490 100644 --- a/arch/arm64/kvm/vgic/vgic.h +++ b/arch/arm64/kvm/vgic/vgic.h @@ -6,6 +6,7 @@ #define __KVM_ARM_VGIC_NEW_H__ #include +#include #define PRODUCT_ID_KVM 0x4b /* ASCII code K */ #define IMPLEMENTER_ARM 0x43b