Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1856704pxb; Mon, 13 Sep 2021 07:02:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKquDJZ5QpaDAzBixPegT1PypZgHgnL2WEY3dJssRT5OBgoQjZxcFEXihZxhJ5xXwg7pDU X-Received: by 2002:a02:630f:: with SMTP id j15mr9905712jac.62.1631541766905; Mon, 13 Sep 2021 07:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631541766; cv=none; d=google.com; s=arc-20160816; b=Kcc/3BlxOJrojqa1vjrFUg5UE4SL312kAqa4xmVda2v3lxfV9T1gM7tfpCD+5GQt8C pRgf4MEB5XMsvIBjTiVd0wv3VbNDEqEViWarlHhWu4UbbuS/c8CHu7qDir/ce2baQvEi sH0pyXPBayUMyQP5thCzoRfumtHVqCjerJWjsEMWbVuPMRW1dJZ5iSH2iG6z5LSyhZV7 9yph7nTDzXNcUMgkrzw55QNct4zUzq4OgTC3gbo34yQxj6luFM0T82jMI9tiV3QeaxKN fI8qMnlQajXdvfvFQ+8zhBh+6l/rl5T9Mb34VOaOgJdTI5UCco58XQGgfI7fbsLoGqRv j+EA== 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=kMNxl3ROgcUS4F7pKtP67mA1glR29ldcpqto1Jdyazk=; b=PlF3VaGvYw7Yebmz6ym2oDIpZYHrG6SjhILFr6+rjXTLwcCnHNPjF1AUJsH9zGQnAo S2jIwJmtIlvMFALbXK462bx1qTCljWKCG9Pf0K2IVTXDagzw3UnfV+4rXNkhZwJnaeHV YA5MSXRawZ+6OlbO18tsrLYkLKB2CK3zsHFeeuVSEridbYGCVGKyZOcvk3HHiywinLKT HVbPd57ErTizO1M+s0cZf29oG6N6S3dkO9mgOLf4BqiLUqTDwkbm3keZXRAattsfpGj2 w4Z3pR9sd6Xh2cRFMiXAMWFZD2OfPDKZggnZyo6swRTB9tFXdTHaNAosvicOM+VHa+Bu +fkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rPaWfAfM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i185si1979865iof.61.2021.09.13.07.02.31; Mon, 13 Sep 2021 07:02:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rPaWfAfM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238822AbhIMOCJ (ORCPT + 99 others); Mon, 13 Sep 2021 10:02:09 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:58110 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245108AbhIMN7H (ORCPT ); Mon, 13 Sep 2021 09:59:07 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6FFA01FFE4; Mon, 13 Sep 2021 13:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631541469; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kMNxl3ROgcUS4F7pKtP67mA1glR29ldcpqto1Jdyazk=; b=rPaWfAfMYVL+BM/X+k2P3bUmJh1U9tCsNR63GI8x2DEc94HCtgtlZIzIL16fc2ArDHG7Lp lz75VBmInPm+LUyhQU6y+oZhBejKreTzXoDcy0AGUQR8McRw8s91+CF6xlpRc0RfjFdzMK 7lnHwloRG7TlYQUGdIq05dMfbYB9D8U= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F3B3413F16; Mon, 13 Sep 2021 13:57:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WEHrOdxYP2FMUwAAMHmgww (envelope-from ); Mon, 13 Sep 2021 13:57:48 +0000 From: Juergen Gross To: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Eduardo Habkost Subject: [PATCH 1/2] x86/kvm: revert commit 76b4f357d0e7d8f6f00 Date: Mon, 13 Sep 2021 15:57:43 +0200 Message-Id: <20210913135745.13944-2-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210913135745.13944-1-jgross@suse.com> References: <20210913135745.13944-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 76b4f357d0e7d8f6f00 ("x86/kvm: fix vcpu-id indexed array sizes") has wrong reasoning, as KVM_MAX_VCPU_ID is not defining the maximum allowed vcpu-id as its name suggests, but the number of vcpu-ids. So revert this patch again. Suggested-by: Eduardo Habkost Signed-off-by: Juergen Gross --- arch/x86/kvm/ioapic.c | 2 +- arch/x86/kvm/ioapic.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index ff005fe738a4..698969e18fe3 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c @@ -96,7 +96,7 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic, static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic) { ioapic->rtc_status.pending_eoi = 0; - bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID + 1); + bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPU_ID); } static void kvm_rtc_eoi_tracking_restore_all(struct kvm_ioapic *ioapic); diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h index bbd4a5d18b5d..27e61ff3ac3e 100644 --- a/arch/x86/kvm/ioapic.h +++ b/arch/x86/kvm/ioapic.h @@ -39,13 +39,13 @@ struct kvm_vcpu; struct dest_map { /* vcpu bitmap where IRQ has been sent */ - DECLARE_BITMAP(map, KVM_MAX_VCPU_ID + 1); + DECLARE_BITMAP(map, KVM_MAX_VCPU_ID); /* * Vector sent to a given vcpu, only valid when * the vcpu's bit in map is set */ - u8 vectors[KVM_MAX_VCPU_ID + 1]; + u8 vectors[KVM_MAX_VCPU_ID]; }; -- 2.26.2