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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AAF3D18153 for ; Mon, 14 Oct 2024 21:38:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9Mf2eoBzQNoQVgZvqWYA1GulBOYq8ED7ogP6FPDfmi0=; b=wzhumNw2eQci/fxXPuHldbZU6J shJeotRZ/RH5HJWsctFXdcdR7xLy2jtmmGmmnUjaS9uwq4FhGRkdO8HPB12vdsTx4Cf7TrlkqxLed xSsErzc7BuDeEn+QX2OuFXhwV/jzhmfKdrlx38zrVoF4lXr9WD4SoSHeKUNcL92njYdgOp/cNMrzj zsJhGAVYPfqs5X9l4Sz8wGpzfrFeTmEyJuR+RKIINZ5LWoAamCDODhqO4VeKKS9YeLmkg/EBtalqX azER9HMKhw3r+O99d+YKo62lhn95vJaTFVskRWyZ7T3RNxkYwxOM/6t+hR4H/WaIqvynrCBSqC261 FWvDPvgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Sm0-00000006VAp-17bl; Mon, 14 Oct 2024 21:38:40 +0000 Received: from mail-pg1-x54a.google.com ([2607:f8b0:4864:20::54a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0Ska-00000006Uxm-2vzs for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 21:37:14 +0000 Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-5e4df21f22dso3899700a12.0 for ; Mon, 14 Oct 2024 14:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728941830; x=1729546630; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9Mf2eoBzQNoQVgZvqWYA1GulBOYq8ED7ogP6FPDfmi0=; b=qfHBOoB307B+pTCuEMmy8aiWcPZN9Cbnu83Th8/RrJgebNnaLqxV2PPh7KNIfUoHtq FJ30TR14ayrsFr4VA/FgnK0DCnBqf/JJu1ltA1z/e0YD5cXnyjZ9ntA3aTPp9zgHmvA3 P1pYHXY6ZUCVYNi4LOjQETOeVgN1IkC/ajdV3ErQdavH+Li8G7A7L1AvYneIS20NuqnB UjJtlW028jIlSVjbTq7N8z/gBgBxbi2oLMFYfWo93sLNa4iLrFMzcaByZBhGHNlTYG9r t8WKHO0RIiJasPF2Dx5Nb/2TRGWbL0/3r8m4GtoxMJuBazen9SxlNbwqjl5L/zWkb0Nf ApzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728941830; x=1729546630; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9Mf2eoBzQNoQVgZvqWYA1GulBOYq8ED7ogP6FPDfmi0=; b=mVCseYSzVFJscJgbD6is/vHMq+H+DNMtA+Q9KqoodUR9039vXL6oRuTcHAY1lr7CjE ExbDAsIxI0K0SdDcIJkjufbciDl5Tnd5REQGXMDMMCTjHoLgwFCMGpeJeUfqujVqVsAn bODdxbqnl5E8Lg3lhJhd2Tb53Uomd2rLXSd2djUnjNEPo5vfqSO8FyrHUCHI6npoW1Hc eOB3qUG86WyyqV34IBsP/BeYgdoCmaUQNLt4n4ByDbVOgXusyusXKOzBbaoLeXvXNsJr MRCIiXPOWALIODMiQ0Y0aRuuc9fP8cwR5yVEOnSNF0D+L/MpK5PewL3Q46HTuST+Ic5n wjtA== X-Forwarded-Encrypted: i=1; AJvYcCUOZBnoP2+yoEYceWqFvJPS97rdc3NGxJJ/Rf2iuwhT8QUu2r96qmSYu7iKaprwTCJ/wW63YLTMMsSK++TeXrPA@lists.infradead.org X-Gm-Message-State: AOJu0YzI1fE5+GC012edLpphko1NBU8SOsZEuFEHVOJDIHjDuhn8BvTQ d4H2mdGjkzxLg9ZgTBAPzwwKscKtZwnJqEHBNKYwCEjKFNJS0zbRFVparoGzlZGMPUF1NWXVSWz 7Ug== X-Google-Smtp-Source: AGHT+IFTc+rIqSRjWJcaRw8kndrZyrrco4sjKuLnct+lf6dsqkIx8K6CIKBvF3FvIoSW3fNH38TrodlWkBQ= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a63:2306:0:b0:7e6:c505:689e with SMTP id 41be03b00d2f7-7ea3f903460mr21417a12.4.1728941830059; Mon, 14 Oct 2024 14:37:10 -0700 (PDT) Date: Mon, 14 Oct 2024 14:37:08 -0700 In-Reply-To: <20241014105912.3207374-17-ryan.roberts@arm.com> Mime-Version: 1.0 References: <20241014105514.3206191-1-ryan.roberts@arm.com> <20241014105912.3207374-1-ryan.roberts@arm.com> <20241014105912.3207374-17-ryan.roberts@arm.com> Message-ID: Subject: Re: [RFC PATCH v1 17/57] kvm: Remove PAGE_SIZE compile-time constant assumption From: Sean Christopherson To: Ryan Roberts Cc: Andrew Morton , Anshuman Khandual , Ard Biesheuvel , Catalin Marinas , David Hildenbrand , Greg Marsden , Ivan Ivanov , Kalesh Singh , Marc Zyngier , Mark Rutland , Matthias Brugger , Miroslav Benes , Will Deacon , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="us-ascii" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_143712_763000_978C7D6D X-CRM114-Status: GOOD ( 13.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Nit, "KVM:" for the scope. On Mon, Oct 14, 2024, Ryan Roberts wrote: > To prepare for supporting boot-time page size selection, refactor code > to remove assumptions about PAGE_SIZE being compile-time constant. Code > intended to be equivalent when compile-time page size is active. > > Modify BUILD_BUG_ON() to compare with page size limit. > > Signed-off-by: Ryan Roberts > --- > > ***NOTE*** > Any confused maintainers may want to read the cover note here for context: > https://lore.kernel.org/all/20241014105514.3206191-1-ryan.roberts@arm.com/ The patch should still stand on its own. Most people can probably suss out what PAGE_SIZE_MIN is, but at the same time, it's quite easy to provide a more verbose changelog that's tailored to the actual patch. E.g. To prepare for supporting boot-time page size selection, refactor KVM's check on the size of the kvm_run structure to assert that the size is less than the smallest possible page size, i.e. that kvm_run won't overflow its page regardless of what page size is chosen at boot time. With something like the above, Reviewed-by: Sean Christopherson