From patchwork Thu Apr 22 06:31:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Rothwell X-Patchwork-Id: 12217723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B49B6C43460 for ; Thu, 22 Apr 2021 06:31:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 764186144D for ; Thu, 22 Apr 2021 06:31:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234909AbhDVGbu (ORCPT ); Thu, 22 Apr 2021 02:31:50 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:33561 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbhDVGbt (ORCPT ); Thu, 22 Apr 2021 02:31:49 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4FQncd5sz7z9sWD; Thu, 22 Apr 2021 16:31:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201702; t=1619073074; bh=il4ZXMNxnxf1r1lHcVDm4MNlaD/cBBNKZJyrLI7ywlA=; h=Date:From:To:Cc:Subject:From; b=BV8da9LS/ezueRAh5xIqL732gaQoWZoVPfSguGCz3vXlMNQf57/PSouIzZy6hQwtr kE7DRUg8pM/8pMpMzqutlvHqLB9Iv4mu70+nHZ17BX5vVdhFqfogedMyHasrqsdWH5 tEZuSZzpyIQ3Q9nso2dYrEHmp/3EcQ50EaejJ/sZqQ0/6vKWwr7Ezwhu5uHs4JNu+e iLo/T/Q0Zl34Kdcu/TYytvdDf66+X12h13WCu6c7YEadSFLs6rNvPBoIntnSLbXbnJ Ss4ac+3vCc3604D9sUJRS20mZOt/mJKFFbf4/ctj8+hrgRjOGGqFnVtZTUuUXue3n0 6Z1tvLoTRyViQ== Date: Thu, 22 Apr 2021 16:31:13 +1000 From: Stephen Rothwell To: Tejun Heo , Paolo Bonzini , KVM Cc: Sean Christopherson , Vipin Sharma , Linux Kernel Mailing List , Linux Next Mailing List Subject: linux-next: build failure after merge of the cgroup tree Message-ID: <20210422163113.31fdbc9b@canb.auug.org.au> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi all, After merging the cgroup tree, today's linux-next build (x86_64 allmodconfig) failed like this: arch/x86/kvm/svm/sev.c: In function 'sev_asid_new': arch/x86/kvm/svm/sev.c:118:12: error: invalid type argument of '->' (have 'int') 118 | type = sev->es_active ? MISC_CG_RES_SEV_ES : MISC_CG_RES_SEV; | ^~ In file included from arch/x86/include/asm/bug.h:93, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/percpu.h:5, from include/linux/context_tracking_state.h:5, from include/linux/hardirq.h:5, from include/linux/kvm_host.h:7, from arch/x86/kvm/svm/sev.c:11: arch/x86/kvm/svm/sev.c:119:13: error: invalid type argument of '->' (have 'int') 119 | WARN_ON(sev->misc_cg); | ^~ arch/x86/kvm/svm/sev.c:119:2: note: in expansion of macro 'WARN_ON' 119 | WARN_ON(sev->misc_cg); | ^~~~~~~ arch/x86/kvm/svm/sev.c:120:5: error: invalid type argument of '->' (have 'int') 120 | sev->misc_cg = get_current_misc_cg(); | ^~ arch/x86/kvm/svm/sev.c:121:36: error: invalid type argument of '->' (have 'int') 121 | ret = misc_cg_try_charge(type, sev->misc_cg, 1); | ^~ arch/x86/kvm/svm/sev.c:123:18: error: invalid type argument of '->' (have 'int') 123 | put_misc_cg(sev->misc_cg); | ^~ arch/x86/kvm/svm/sev.c:124:6: error: invalid type argument of '->' (have 'int') 124 | sev->misc_cg = NULL; | ^~ arch/x86/kvm/svm/sev.c:154:28: error: invalid type argument of '->' (have 'int') 154 | misc_cg_uncharge(type, sev->misc_cg, 1); | ^~ arch/x86/kvm/svm/sev.c:155:17: error: invalid type argument of '->' (have 'int') 155 | put_misc_cg(sev->misc_cg); | ^~ arch/x86/kvm/svm/sev.c:156:5: error: invalid type argument of '->' (have 'int') 156 | sev->misc_cg = NULL; | ^~ Caused by commit 7aef27f0b2a8 ("svm/sev: Register SEV and SEV-ES ASIDs to the misc controller") interacting with commit 9fa1521daafb ("KVM: SVM: Do not set sev->es_active until KVM_SEV_ES_INIT completes") from the kvm tree. I have applied the following for today, better suggestions welcome. From: Stephen Rothwell Date: Thu, 22 Apr 2021 16:13:34 +1000 Subject: [PATCH] fixup for "KVM: SVM: Do not set sev->es_active until KVM_SEV_ES_INIT completes" Signed-off-by: Stephen Rothwell --- arch/x86/kvm/svm/sev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 5ae091509bb0..3458710a9729 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -109,13 +109,13 @@ static bool __sev_recycle_asids(int min_asid, int max_asid) return true; } -static int sev_asid_new(bool es_active) +static int sev_asid_new(bool es_active, struct kvm_sev_info *sev) { int pos, min_asid, max_asid, ret; bool retry = true; enum misc_res_type type; - type = sev->es_active ? MISC_CG_RES_SEV_ES : MISC_CG_RES_SEV; + type = es_active ? MISC_CG_RES_SEV_ES : MISC_CG_RES_SEV; WARN_ON(sev->misc_cg); sev->misc_cg = get_current_misc_cg(); ret = misc_cg_try_charge(type, sev->misc_cg, 1); @@ -221,7 +221,7 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp) if (unlikely(sev->active)) return ret; - asid = sev_asid_new(es_active); + asid = sev_asid_new(es_active, sev); if (asid < 0) return ret; sev->asid = asid;