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 875A9C6379F for ; Wed, 22 Feb 2023 21:25:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232713AbjBVVZ0 (ORCPT ); Wed, 22 Feb 2023 16:25:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbjBVVZY (ORCPT ); Wed, 22 Feb 2023 16:25:24 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 495414391F for ; Wed, 22 Feb 2023 13:25:22 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-536c6ce8d74so84375487b3.9 for ; Wed, 22 Feb 2023 13:25:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=VCAEO323b86BbB7XtvnH+rG3EP2w0C3Dqq7NI+H9LE0=; b=rzW4oiBSJ63i/anFjhOay2GibzgaSIcPlhs4icaZXWt5tih/osT60UF5e1mwSVULhr JA10nXn/Y6ES/XMfobF3rXA0+xT8tqci00AYfMRUEKHVUxG6JbSqI9dpiBOiOKsrLbee bYfLIVa2BYR+spMxhwdoUyja2LlL+Mut0U/wnb3uo6zTUNO+QbmpWgddUexwhQjv1HXV zoLD7Nt5c/165lbrdfRGyO8N0FXIlW/zx8x2Ec3Omk9D8TqW3ZfghlgsWa2lUSnTeGOM 9sxnd67n4MCSx7otekA5PPlVXRqMI+iWtlHIKZrBzcfZ3JxTRhsjCjR6AQ6bjByIMLKG /Vnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=VCAEO323b86BbB7XtvnH+rG3EP2w0C3Dqq7NI+H9LE0=; b=Yb0rIG7abI4I0B64bZu8AYkf2NIzxTcoX41JfzVDmVszQ429l5uHlA4l6K4Hvv5pVM TusxDUZG/ey6AA3FzppiIJ4IcLctLsHkLvWQUlvUy3mhWSq51+WDUirQ6Nehj8EDzSHU e9zWrWyDwnVxl+YtX52jrOpYTzrr5PGdxz2q3fv2t2Y3Kbvmkt+qEoYEihM2mXq860i4 2IFPSYeJXpnIgnePq+GiV8bk0pYZSob1PVXJRXfaqC0a5T1ZhRcqnRUh+cN59M9/T0Sb hOV2lSE14z08TV1pC4uVxFdZalVk8CTr3i6kn6Syqh+AoG2NOoRONcO4+LuIP5d5qUdn TMtA== X-Gm-Message-State: AO0yUKUaYl3i6qrxNV7fGE+cuLKxpJP+w60504iiHW8dMIyVFEIayrqA mu8Fp4rrXpkfl5GDgB2b5RFN8Z3/0WI= X-Google-Smtp-Source: AK7set9wDZXbRc6wLa992mDcUcum92VMWfB8kgedycpfygyX7MXQMXDLL4D76H3UAiAg1sC8Z7wuyTwxayc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:1028:b0:a27:3ecd:6 with SMTP id x8-20020a056902102800b00a273ecd0006mr438895ybt.1.1677101121372; Wed, 22 Feb 2023 13:25:21 -0800 (PST) Date: Wed, 22 Feb 2023 13:25:19 -0800 In-Reply-To: <2dfae61c-6ac7-7686-ebd1-6ad4448b2bf8@maciej.szmigiero.name> Mime-Version: 1.0 References: <20230217225449.811957-1-seanjc@google.com> <20230217225449.811957-3-seanjc@google.com> <2dfae61c-6ac7-7686-ebd1-6ad4448b2bf8@maciej.szmigiero.name> Message-ID: Subject: Re: [PATCH 2/2] Documentation/process: Add a maintainer handbook for KVM x86 From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Sagi Shahar , Erdem Aktas , Peter Shier , Anish Ghulati , Oliver Upton , James Houghton , Anish Moorthy , Ben Gardon , David Matlack , Ricardo Koller , Axel Rasmussen , Aaron Lewis , Ashish Kalra , Babu Moger , Chao Gao , Chao Peng , Chenyi Qiang , David Woodhouse , Emanuele Giuseppe Esposito , Gavin Shan , Guang Zeng , Hou Wenlong , Jiaxi Chen , Jim Mattson , Jing Liu , Junaid Shahid , Kai Huang , Leonardo Bras , Like Xu , Li RongQing , Maxim Levitsky , Michael Roth , Michal Luczaj , Mingwei Zhang , Nikunj A Dadhania , Paul Durrant , Peng Hao , Peter Gonda , Peter Xu , Robert Hoo , Suravee Suthikulpanit , Tom Lendacky , Vipin Sharma , Vitaly Kuznetsov , Wanpeng Li , Wei Wang , Xiaoyao Li , Yu Zhang , Zhenzhong Duan , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 22, 2023, Maciej S. Szmigiero wrote: > On 17.02.2023 23:54, Sean Christopherson wrote: > > +SDM and APM References > > +~~~~~~~~~~~~~~~~~~~~~~ > > +Much of KVM's code base is directly tied to architectural behavior def= ined in > > +Intel's Software Development Manual (SDM) and AMD's Architecture Progr= ammer=E2=80=99s > > +Manual (APM). Use of "Intel's SDM" and "AMD's APM", or even just "SDM= " or > > +"APM", without additional context is a-ok. > > + > > +Do not reference specific sections, tables, figures, etc. by number, e= specially > > +not in comments. Instead, copy-paste the relevant snippet (if warrant= ed), and > > +reference sections/tables/figures by name. >=20 > This says do "copy-paste the relevant snippet"... >=20 > > The layouts of the SDM and APM are > > +constantly changing, and so the numbers/labels aren't stable/consisten= t. > > + > > +Generally speaking, do not copy-paste SDM or APM snippets into > > comments. >=20 > ...but this seems to say "don't do that". Yeah, that didn't come out right. > More specific guidance would probably help here. Is this better? Do not reference specific sections, tables, figures, etc. by number, espe= cially not in comments. Instead, if necessary (see below), copy-paste the relev= ant snippet and reference sections/tables/figures by name. The layouts of th= e SDM and APM are constantly changing, and so the numbers/labels aren't stable. =20 Generally speaking, do not explicitly reference or copy-paste from the SD= M or APM in comments. With few exceptions, KVM *must* honor architectural beh= avior, therefore it's implied that KVM behavior is emulating SDM and/or APM beha= vior. Note, referencing the SDM/APM in changelogs to justify the change and pro= vide context is perfectly ok and encouraged. > > +If a patch touches multiple topics, traverse up the conceptual tree to= find the > > +first common parent (which is often simply ``x86``). When in doubt, > > +``git log path/to/file`` should provide a reasonable hint. > > + > > +New topics do occasionally pop up, but please start an on-list discuss= ion if > > +you want to propose introducing a new topic, i.e. don't go rogue. > > + > > +Do not use file names or complete file paths as the subject/shortlog p= refix. >=20 > Do we strictly obey the "75 characters max" rule for the subject/shortlog > or do we prefer to be more flexible here if it results in a more > descriptive patch subject? I prefer to be a little flexible, I'll expand this section to clarify that. > (...) > > +Testing > > +------- > > +At a bare minimum, *all* patches in a series must build cleanly for KV= M_INTEL=3Dm > > +KVM_AMD=3Dm, and KVM_WERROR=3Dy. Building every possible combination = of Kconfigs > > +isn't feasible, but the more the merrier. KVM_SMM, KVM_XEN, PROVE_LOC= KING, and > > +X86_64 are particularly interesting knobs to turn. > > + > > +Running KVM selftests and KVM-unit-tests is also mandatory (and statin= g the > > +obvious, the tests need to pass). >=20 > I would add an exception here from mandatory testing for changes that > obviously have negligible probability of affecting runtime behavior. >=20 > For example: patches that modify just code comments or documentation. Agreed, will add. Regarding documentation, I think I'll also add a requirement of 'make htmld= ocs' without warnings for non-trivial docs changes. It's all too easy to write = buggy ReST "code" that looks correct as raw text, e.g. the whole double-colon thi= ng. > > When possible and relevant, testing on both > > +Intel and AMD is strongly preferred. Booting an actual VM is encourag= ed, but > > +not mandatory. > > + > > +For changes that touch KVM's shadow paging code, running with TDP (EPT= /NPT) > > +disabled is mandatory. For changes that affect common KVM MMU code, r= unning > > +with TDP disabled is strongly encouraged. For all other changes, if t= he code > > +being modified depends on and/or interacts with a module param, testin= g with > > +the relevant settings is mandatory. > > + > > +Note, KVM selftests and KVM-unit-tests do have known failures. If you= suspect > > +a failure is not due to your changes, verify that the *exact same* fai= lure > > +occurs with and without your changes. > > + > > +If you can't fully test a change, e.g. due to lack of hardware, clearl= y state > > +what level of testing you were able to do, e.g. in the cover letter. > > + > (...) >=20 > Thanks for preparing such a detailed handbook Sean. >=20 > However, having so many rules might seem intimidating for newcomers, and > deter them from contributing out of fear that they'll be screamed at for > accidentally breaking some obscure rule. >=20 > That's especially true for unpaid volunteers that might become > professional kernel developers one day if their learning curve isn't > made too steep. >=20 > Maybe have a paragraph or two that, despite all these rules, KVM x86 > strives to be a welcome community, encouraging newcomers and understandin= g > their beginner mistakes (or so)? I like that idea a lot, I'll add a section at the very top. Thanks much!