Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp759330pxb; Tue, 5 Apr 2022 22:05:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWOAKPojgVJdgoA8XuAUQZvfKNAx37TYE2aMaxiQcs0ZVK+/SMSUidqpAHBZVUjqDTuxb6 X-Received: by 2002:a62:14cb:0:b0:4fb:7eea:523a with SMTP id 194-20020a6214cb000000b004fb7eea523amr7272624pfu.2.1649221527240; Tue, 05 Apr 2022 22:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649221527; cv=none; d=google.com; s=arc-20160816; b=RhyhOg/eQejyXUON5bOvS7RHhcyoE5w3JOOS/me+2DVqNgURmtX6TaZrv93t2NosiM HjchVLoF9i+YRA59sQ+1dkLamH7xOYXyYDA7H/H+a/FGcvOutwpLHiEhWOlVsqibfGeQ zixNqzhcZPZLmwXnkFSA/O2OM+KZ3DfrasyYRKN9DfGincudaVtotjINpALbNxtGXRoo W6CpIypN9oqWkGE1sSkXOaX9u/ofegk1w760iaJoRIDtnzu4zPh/xbxGZvNWfvGpwASR HETWh7APpU5YgRISuhdgCoBHTEexd9UuCXNl4awzOoLetpR2Rwg5j32PPLORdisxdKca Iq9Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MOwMDLUD4Ipb6T6tKE8WuO6OCEUsGLRShJ+DVnssMD0=; b=ZCpMar13wzRInZE/cA+6ii070wDUGYh2ExJdSMuHnF05o3InCQGKKUceZbjD1THrot xPAwbJkaNhcHDTQglIgAcpzWthPUDk41RBJBgh1+KNjaX1gxkLaBsH0zuYOOWJOZ3vXR n/0F6fIQfZFg8fKUt8HDPT822oYJ8o5zdzglcAsDvQb69Cp9CJq+ZbUKzgA1AVmfpjBn DOjimJfkZQk5iaHMcR5RjiyfHabb+4MFGEXCypqg2Fl71kAtuyABP1S4LfrEWXnkpPPk rlZRL/4KVUWcUCUl6CKa/cIsiECmHJ3oMF14GQGqOvlKksjlx+v3219AWzNAst0LOERU jhbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fSYQWCwI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h13-20020a056a00230d00b004fa7c4d3815si16042283pfh.73.2022.04.05.22.05.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:05:27 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fSYQWCwI; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B09410075E; Tue, 5 Apr 2022 20:22:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346603AbiDEKnh (ORCPT + 99 others); Tue, 5 Apr 2022 06:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241130AbiDEIcv (ORCPT ); Tue, 5 Apr 2022 04:32:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33DE816587; Tue, 5 Apr 2022 01:28:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D6EE1B81BC6; Tue, 5 Apr 2022 08:28:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2516DC385A2; Tue, 5 Apr 2022 08:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147299; bh=Ce799mPfELJEVGE36aiBW8M/isovkz8cDcyTunmgCYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSYQWCwIu4zAyP2CLKXqXqOT028etxufeVa/SPRra7uwUIcKXxo2m2fKSmHTLTv6e chwdUooQArXWlQaMOFICxYXAwhutczrPgdiVEQSA0S3aVfOQjJXa0dT4PcA0O1G29G aDF7+dCdH5Nwh/7+9lY8YZ2C0/9qwbQFdSl5POYo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Levitsky , Paolo Bonzini Subject: [PATCH 5.17 1073/1126] KVM: x86: SVM: fix avic spec based definitions again Date: Tue, 5 Apr 2022 09:30:20 +0200 Message-Id: <20220405070438.950343009@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Maxim Levitsky commit 0dacc3df898e219fa774f39e5e10d686364e0a27 upstream. Due to wrong rebase, commit 4a204f7895878 ("KVM: SVM: Allow AVIC support on system w/ physical APIC ID > 255") moved avic spec #defines back to avic.c. Move them back, and while at it extend AVIC_DOORBELL_PHYSICAL_ID_MASK to 12 bits as well (it will be used in nested avic) Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/svm.h | 8 +++++--- arch/x86/kvm/svm/svm.h | 11 ----------- 2 files changed, 5 insertions(+), 14 deletions(-) --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -222,7 +222,7 @@ struct __attribute__ ((__packed__)) vmcb /* AVIC */ -#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFF) +#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFFULL) #define AVIC_LOGICAL_ID_ENTRY_VALID_BIT 31 #define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1 << 31) @@ -230,9 +230,11 @@ struct __attribute__ ((__packed__)) vmcb #define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK (0xFFFFFFFFFFULL << 12) #define AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK (1ULL << 62) #define AVIC_PHYSICAL_ID_ENTRY_VALID_MASK (1ULL << 63) -#define AVIC_PHYSICAL_ID_TABLE_SIZE_MASK (0xFF) +#define AVIC_PHYSICAL_ID_TABLE_SIZE_MASK (0xFFULL) -#define AVIC_DOORBELL_PHYSICAL_ID_MASK (0xFF) +#define AVIC_DOORBELL_PHYSICAL_ID_MASK GENMASK_ULL(11, 0) + +#define VMCB_AVIC_APIC_BAR_MASK 0xFFFFFFFFFF000ULL #define AVIC_UNACCEL_ACCESS_WRITE_MASK 1 #define AVIC_UNACCEL_ACCESS_OFFSET_MASK 0xFF0 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -558,17 +558,6 @@ extern struct kvm_x86_nested_ops svm_nes /* avic.c */ -#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFF) -#define AVIC_LOGICAL_ID_ENTRY_VALID_BIT 31 -#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1 << 31) - -#define AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK GENMASK_ULL(11, 0) -#define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK (0xFFFFFFFFFFULL << 12) -#define AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK (1ULL << 62) -#define AVIC_PHYSICAL_ID_ENTRY_VALID_MASK (1ULL << 63) - -#define VMCB_AVIC_APIC_BAR_MASK 0xFFFFFFFFFF000ULL - int avic_ga_log_notifier(u32 ga_tag); void avic_vm_destroy(struct kvm *kvm); int avic_vm_init(struct kvm *kvm);