From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82896C433EF for ; Mon, 8 Nov 2021 20:15:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 628C361360 for ; Mon, 8 Nov 2021 20:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238719AbhKHUSk (ORCPT ); Mon, 8 Nov 2021 15:18:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238799AbhKHUS3 (ORCPT ); Mon, 8 Nov 2021 15:18:29 -0500 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBD37C061570 for ; Mon, 8 Nov 2021 12:15:43 -0800 (PST) Received: by mail-il1-x12d.google.com with SMTP id s14so18261371ilv.10 for ; Mon, 08 Nov 2021 12:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lCTOidaZajv7DxRrGkK5E30Y+aKj9uf2F6iDIjFDoo0=; b=IPRxyCY6FnjvRfUORiItGiJ4keTVi1pv2WDaoiPx/gK+OBR1SAVKKVStpo6uhsg+t8 zG+kmCC882BYG68WqLF0dCmVnvcxWo82KQuZDKGLb5cwx/FIyHkESmXAPJnuM4vkd6k1 Mqvnwc5LaIDtNj8kAV/qzoRmHGkhnOaCDWDksvUFeSQBVa+7chFeZlB06S+9b1V1r+gx iQAziNWdh1b6vLaCJtQSn3GDDZBMlFPMZdKHUe2JG9VUg2FAzLX/IDXr5/0SoEfH64LP K8rWi7XkgrRx7XhTq5T0L1C3gMfP6HuqWXuKPFIbWaxidaUXwCclfWk9nnEKeXJ9SDxd DHZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lCTOidaZajv7DxRrGkK5E30Y+aKj9uf2F6iDIjFDoo0=; b=YmUb+TpfddhgX16Hr91ws1+JQlcEnr0IQa4vOZsJxBPjozOHfqLsAsKrFOCxPTfmMl 8eTkr2FNSEsQDKSFyaHbrhnhlkAAuPnxTQEWH30vvfEEnAwhxBLxRg14lSQMO1q9K0vv MY9tpqGOSDJcw7hxy7Pg25iZI2GJ7EiO5j72jzhjaPF4zKa7Tuv+AQtLgRrpSZkDKuFp ui/iB2RlXpw8T0xQUXCNRxsd+tU4mx/igRVG0H3Ti83mK1D3cV7GqXP6RrEF252iNdvP esakdzY0T4kgqLIbKhBMrdjVRMRv0MlprKQUijO+vNEphQiNGlRSNmrWqFWb7FjqWN+D Encw== X-Gm-Message-State: AOAM533uqKSGzjmPBJRUdNwstPPGg9W7i6IkF+sbLoPEHymq4LfZ4V60 LTpd5S5Mp7D4cznU8iduQ5yY5K6jeKA7HDFx87hNgA== X-Google-Smtp-Source: ABdhPJxm5ew/EklYukdHTfmEkmMrj87CAR5uYqp8lbP8/DfE75V4ejatD3BTFf5i4NgLR9gqVLt7Jl9xXi1ZHopbDso= X-Received: by 2002:a05:6e02:604:: with SMTP id t4mr1240795ils.129.1636402543150; Mon, 08 Nov 2021 12:15:43 -0800 (PST) MIME-Version: 1.0 References: <20210913135745.13944-1-jgross@suse.com> <20210913135745.13944-2-jgross@suse.com> In-Reply-To: From: Ben Gardon Date: Mon, 8 Nov 2021 12:15:32 -0800 Message-ID: Subject: Re: [PATCH 1/2] x86/kvm: revert commit 76b4f357d0e7d8f6f00 To: Juergen Gross Cc: kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Eduardo Habkost Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 8, 2021 at 12:14 PM Ben Gardon wrote: > > On Mon, Sep 13, 2021 at 7:51 AM Juergen Gross wrote: > > > > 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 > > The original commit 76b4f357d0e7d8f6f00 CC'ed Stable but this revert > does not. Looking at the stable branches, I see the original has been > reverted but this hasn't. Should this be added to Stable as well? *the original has been incorporated into the stable branches but this hasn't. > > > --- > > 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 > >