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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 062BAC19F2D for ; Wed, 3 Aug 2022 22:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237165AbiHCWt2 (ORCPT ); Wed, 3 Aug 2022 18:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiHCWtZ (ORCPT ); Wed, 3 Aug 2022 18:49:25 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBB3C205E3 for ; Wed, 3 Aug 2022 15:49:24 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id i71so10834253pge.9 for ; Wed, 03 Aug 2022 15:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=1BxpsamUUhc+oDoAp2dc++aXjCc5DZvHk2oG33loPcU=; b=JBoHWU2120zTexjAsT7PmeWUqmxQ02GyiAnAppkYJ4nq4lJO3pgP4vDtVbztybQ9Vi timpynQe4PJTFgh2kzC88KJHuwQ26mJ/nDcgF4QYvJ1NHNCFBrudswCIt45PrWF7OtvQ dMwWESRQyM303XbXBDUoTlBwUcOy2hWaVnFgjEi0gzOOUohkSPu95oa9VG/jtq+NrCLh sfm1Jb64hJLcSl+AemAmXy7xs1NWS02+evHn/Zd/ZeSxsu5cTKxLZiEGOoNBp5IlRUQd hX+HFTqn84lJ9jVDojLqJ+UNGAb38zxa6Cs7lYOCCZ5ReQ2DNFjdJpNVt2ilW+eEWmIT FHQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=1BxpsamUUhc+oDoAp2dc++aXjCc5DZvHk2oG33loPcU=; b=lDzNozD2+dw0vfvzUOlV6AKaAJgABBdzlb4NeoGlxG+/A/Xp3IahGTZvNopSfz7PLW z3dQNGebGL3ebWbrx++WaHx4xj82/m93JvdcCPOgv5rn0mg4APJnJWx0w+T0mVGjOwY0 sqHXiaKkOQhyQJcTPz/4cfGd5d0eItXkR5NsmXITNlbkGx7I8vEC1Z4kovVvAjZsrBfb cNqO3bJGf57l/oJEHc0VIXIpTTN+C2tmG0+gs4nF0pP9fnKc8p+z23NBdmIZjwnVYjze hBcA2HoBEl56gSY1uRacvX1Jt06GUwaKl9j2qLTN7Q/7hsn41hq53o0S73NSs5lE7W0I nF0A== X-Gm-Message-State: ACgBeo0Lv8tt2fOD2JP2TTedzyrdArMJZrDDPvozD95EBLIB61pWmCH/ hlSwAfWwqbZdxUh7jH4iuhj4IQ== X-Google-Smtp-Source: AA6agR43o51+/1qGwupcZlAEZg68WvjfmprQ123VTOtSyp8ZmdbU4+ohLj2PnVXHV+s9B91Tk+G6nw== X-Received: by 2002:a63:ec04:0:b0:41c:1149:4523 with SMTP id j4-20020a63ec04000000b0041c11494523mr13383085pgh.62.1659566964272; Wed, 03 Aug 2022 15:49:24 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id p2-20020a625b02000000b0052d63fb109asm7762271pfb.20.2022.08.03.15.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 15:49:23 -0700 (PDT) Date: Wed, 3 Aug 2022 22:49:20 +0000 From: Sean Christopherson To: Kai Huang Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: x86/mmu: Add sanity check that MMIO SPTE mask doesn't overlap gen Message-ID: References: <20220803213354.951376-1-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 04, 2022, Kai Huang wrote: > On Wed, 2022-08-03 at 21:33 +0000, Sean Christopherson wrote: > > Add compile-time and init-time sanity checks to ensure that the MMIO SPTE > > mask doesn't overlap the MMIO SPTE generation. The generation currently > > avoids using bit 63, but that's as much coincidence as it is strictly > > necessarly. That will change in the future, as TDX support will require > > setting bit 63 (SUPPRESS_VE) in the mask. Explicitly carve out the bits > > that are allowed in the mask so that any future shuffling of SPTE MMIO > > bits doesn't silently break MMIO caching. > > Reviwed-by: Kai Huang > > Btw, should you also check SPTE_MMU_PRESENT_MASK (or in another patch)? Rats, I thought we already checked that, but it's only the MMIO generation that checks for overlap. I'll send a v2.