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 X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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 CA32FC4361B for ; Sat, 12 Dec 2020 00:04:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DCE22065D for ; Sat, 12 Dec 2020 00:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407227AbgLKXzj (ORCPT ); Fri, 11 Dec 2020 18:55:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404297AbgLKXzb (ORCPT ); Fri, 11 Dec 2020 18:55:31 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AB3BC0613CF for ; Fri, 11 Dec 2020 15:54:51 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id i3so7988719pfd.6 for ; Fri, 11 Dec 2020 15:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dgacDrS0riydujVAJCVqJGSgZiFbA+7xuih1JNG67KA=; b=ogJjeDtFdyKbay4CVyxPAK1DClalm9TQ3pZvATeoyQBL4yVCa/NtNJVKV3LOrREjDm eaCteR0knx/MB1jbJ1YVOFj4HPuoCzJzTIgHsd4IEljnXekDVnM/7HODNplhiaDX0Wd0 V/rDpKmHP9E0VFrhIHigP81ITLtUzn1Vf15m+WENzyhyQsgx3011qDNSzZnr4gekRkkn C0gVWBDKJSc8tFtUtrRyIjRzVeOV6VeyGxRTaJ2nmliqLvnI5W1knpMlbNNw3pdTFOhV jLLNdRM4wrixerfhFzwxXyxUVTUJuEQTbu3w6s3gNnM+QATkCe9xpRHsTdCT1RGjjdBg Z/YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=dgacDrS0riydujVAJCVqJGSgZiFbA+7xuih1JNG67KA=; b=eBIK0Il2AadcdxBhL16qfAqbGQk8xPEsyHpahQFRb84PScXB8342OYCdlyiUF4qfu+ qWy9GPSYY28xe1GrST2CD6+TZHfy0wFty7WHJdvLffvaNumJY+CwMIGCACquYXT9S6sg ZpK3iL5NuwIpWvja2kbNTv6CCk8IS4oNcS8lu4PfY973dIN6zMihp9gVlCcvc83Ir5qe kGkWhFYi6cSDpj1tt8kVRdCW9/feYTKxlq4pKYYNpPf6KFmBmCwLffACBq5L+lxqa5bV 0BUQRurmz1Cl2Y8dvhUn5bz49gP+TUihVPW17Xu9I78JxJkOQZZFDOaQ2IyxeptXu0c6 pQ+A== X-Gm-Message-State: AOAM531AQjeyQM2DoTOGkteWrav7VIFi43hgB618w3bPAy8zzhgmtfsm mwR/pHwhh09kjAKTZD84x7WeAw== X-Google-Smtp-Source: ABdhPJy/fiexxBBx/YBRcBfudE/6zZgOs9/EoqjkH/B6NjG9OXsA47gcwRhp6LNiYZonAaxHPGvSLQ== X-Received: by 2002:a65:468d:: with SMTP id h13mr13277740pgr.55.1607730890470; Fri, 11 Dec 2020 15:54:50 -0800 (PST) Received: from google.com ([2620:15c:f:10:1ea0:b8ff:fe73:50f5]) by smtp.gmail.com with ESMTPSA id z9sm11393330pji.48.2020.12.11.15.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Dec 2020 15:54:49 -0800 (PST) Date: Fri, 11 Dec 2020 15:54:43 -0800 From: Sean Christopherson To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Maciej S. Szmigiero" , stable@nongnu.org Subject: Re: [PATCH v3] KVM: mmu: Fix SPTE encoding of MMIO generation upper half Message-ID: References: <20201211234532.686593-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201211234532.686593-1-pbonzini@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 11, 2020, Paolo Bonzini wrote: > From: "Maciej S. Szmigiero" > > Commit cae7ed3c2cb0 ("KVM: x86: Refactor the MMIO SPTE generation handling") > cleaned up the computation of MMIO generation SPTE masks, however it > introduced a bug how the upper part was encoded: > SPTE bits 52-61 were supposed to contain bits 10-19 of the current > generation number, however a missing shift encoded bits 1-10 there instead > (mostly duplicating the lower part of the encoded generation number that > then consisted of bits 1-9). > > In the meantime, the upper part was shrunk by one bit and moved by > subsequent commits to become an upper half of the encoded generation number > (bits 9-17 of bits 0-17 encoded in a SPTE). > > In addition to the above, commit 56871d444bc4 ("KVM: x86: fix overlap between SPTE_MMIO_MASK and generation") > has changed the SPTE bit range assigned to encode the generation number and > the total number of bits encoded but did not update them in the comment > attached to their defines, nor in the KVM MMU doc. > Let's do it here, too, since it is too trivial thing to warrant a separate > commit. > > Fixes: cae7ed3c2cb0 ("KVM: x86: Refactor the MMIO SPTE generation handling") > Signed-off-by: Maciej S. Szmigiero > Message-Id: <156700708db2a5296c5ed7a8b9ac71f1e9765c85.1607129096.git.maciej.szmigiero@oracle.com> > Cc: stable@nongnu.org I assume you want stable@vger.kernel.org? > [Reorganize macros so that everything is computed from the bit ranges. - Paolo] > Signed-off-by: Paolo Bonzini > --- > Compared to v2 by Maciej, I chose to keep GEN_MASK's argument calculated, Booooo. :-D Reviewed-by: Sean Christopherson > but assert on the number of bits in the low and high parts. This is > because any change on those numbers will have to be reflected in the > comment, and essentially we're asserting that the comment is up-to-date.