Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2262821rdb; Tue, 3 Oct 2023 16:00:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1tKWn4aI9uCM4o6obYntTYJ2N1C6aEpFwTUqypThRk3/lUXohlaiNwE7uFwPU02ETMj2b X-Received: by 2002:aa7:88c2:0:b0:68e:36bc:194a with SMTP id k2-20020aa788c2000000b0068e36bc194amr1120031pff.15.1696374043720; Tue, 03 Oct 2023 16:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696374043; cv=none; d=google.com; s=arc-20160816; b=f/O+L44+sD/EMaZkOiu1f/QPSKuHIlHYhYUb9KPqYg/bco6X6EVujh2Usb3l/EjtNf hPRrGiUgqxnXkELYfVkLQo8ej0wE+Q7GybxOmvj/4aWNmu/qK4ZyBEfnP78yl+kHTxlX zr+Sv01Wf5fdH5NtGfPXZjefQv0quZA89zrp4IMB8KLyT+bY3L1WlZywNHgsOdD0xZ1S bjyHQFOmpvvnPnGxHCK0g5wXKYBzPuU9Bec6eHCIWpBvktYkGcow72njKq8BfYehAln8 vqPy9gA5rnXwhvYi37vK/hfg1leTgPsqmfMj3obxsqcz/SAEOCHKh+e+/p1t5iJ/bTn+ jKyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=VuLZmgaV89lzOHymPqsmAC6abj1UTBHkava0gPj509c=; fh=TS0XqLZzmd+6T3cYCi4ykRQbZPqlHPYf9YHyhgUFHRg=; b=jQ0yIZVnIc6Mm5J97+YAvVSHLabSBb6wr3/ssEUpKy0CrW+PbH5Nzu92tpSmxiS6q2 Lc4D8ma4Ue2DkyMo+OSPoXsEN8SstDpQEM5+/vaqsur/3WplhkVoOowzMhqDrGH18GvU JBXgMGHDEbP5IFgnY7UYUjHVhEUu7Rqgh1Oc9RkqXHsbcAvWiOt/LPSNU+6uJGkd3Bhk aehqfe3dYESbVC5p0TXnqcj4MGAXR59pHKOXxeZuyteBX9TDBWh9A/mFqZFD8rFp8qR/ YB0KzsgtSIJkdsY/vDfcgvM0AgviBFeyEaQUs2WGzZxqckdp3vsahdDn77vPWdSFuMwB QJiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HZR93xxM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id w18-20020a056a0014d200b0069024c6a9a8si2511217pfu.389.2023.10.03.16.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 16:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HZR93xxM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D21BF80740E2; Tue, 3 Oct 2023 16:00:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231651AbjJCW75 (ORCPT + 99 others); Tue, 3 Oct 2023 18:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbjJCW74 (ORCPT ); Tue, 3 Oct 2023 18:59:56 -0400 Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C11EEAF for ; Tue, 3 Oct 2023 15:59:52 -0700 (PDT) Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-49d9ef118a5so520905e0c.1 for ; Tue, 03 Oct 2023 15:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696373992; x=1696978792; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VuLZmgaV89lzOHymPqsmAC6abj1UTBHkava0gPj509c=; b=HZR93xxM84qxgnwPHXx6vfV7FbLovXh3ObYwd6DPcFpbCDM/szoGzBJ44pL9r43+RY OOwmkuJW1GtTBmNvIQLF3XueStHUjnTfMq/mGKiPbcIWsQmYXB7wM076qWq4opVVVojR XtwDRJhBAN7y6kvUTgM0H3ou+TjLaGVM7Xf7N4u8XcP/ex3qZh810Kmb5H1j5tkaSs2L WUW+Sy1eAdwO7tf8rSmpQibVIxxyHKn4481i6iwdTJG2nVzUys181GtHpse7V26oRdMp X/dablmoxRFxp5JoUDo3SR8+jC3DyATo+QX7RXNkDBFK8c5LjCdAaoe8mPTLzwR5ubo1 gpyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696373992; x=1696978792; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VuLZmgaV89lzOHymPqsmAC6abj1UTBHkava0gPj509c=; b=ZcVbyUT7Pn8QXXknDTtxqFZTzsNVXHV3mN35k56ZeS2J+RgeUITGzsrq76anjUKMM0 pkiz8+isuqAzKRiH1SAmXNbOj2d8xwf7CbU4KW/fnNadH/dKxUR0PDI3+6tlnqYzoWxo 9l4ZRHMZRlmNNPtzS77cot/YqrpaiEGUmmx77WC4Nrn0X6kZ/0bscUaT2mILmUSfUjYR BZ4NOHlfLgoerdYICUoUpUOa+ctT+H5WWITU9jznk0WQPqY/8KH3E9K7pYtEtSzmrO6d r76hH55iHb1v03nfxQpZdDDVd0uoUeSbFj+3VzoM3l9LQYo5/BY/e8TmnHU4hYT22teA I9Lw== X-Gm-Message-State: AOJu0YzANcys0LCKoY/Yh/pR04iy5X3AmV1AyvnmvQ0rQG4Y6hqJnYO4 KPSnfFafoh1eWTz/2aFPheagnTYEEWkVxKzmMVSGhA== X-Received: by 2002:a1f:4887:0:b0:493:3491:ce89 with SMTP id v129-20020a1f4887000000b004933491ce89mr587565vka.14.1696373991201; Tue, 03 Oct 2023 15:59:51 -0700 (PDT) MIME-Version: 1.0 References: <20230914015531.1419405-1-seanjc@google.com> <20230914015531.1419405-8-seanjc@google.com> <117db856-9aec-e91c-b1d4-db2b90ae563d@intel.com> In-Reply-To: From: Anish Moorthy Date: Tue, 3 Oct 2023 15:59:15 -0700 Message-ID: Subject: Re: [RFC PATCH v12 07/33] KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace To: Sean Christopherson Cc: Xiaoyao Li , Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Isaku Yamahata , Xu Yilun , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 03 Oct 2023 16:00:11 -0700 (PDT) On Mon, Oct 2, 2023 at 6:43=E2=80=AFPM Sean Christopherson wrote: > > > - I should go drop the patches annotating kvm_vcpu_read/write_page > > from my series > > Hold up on that. I'd prefer to keep them as there's still value in givin= g userspace > debug information. All I'm proposing is that we would firmly state in th= e > documentation that those paths must be treated as informational-only. Userspace would then need to know whether annotations were performed from reliable/unreliable paths though, right? That'd imply another flag bit beyond the current R/W/E bits. > > - The helper function [a] for filling the memory_fault field > > (downgraded back into the current union) can drop the "has the field > > already been filled?" check/WARN. > > That would need to be dropped regardless because it's user-triggered (sad= ly). Well the current v5 of the series uses a non-userspace visible canary- it seems like there'd still be value in that if we were to keep the annotations in potentially unreliable spots. Although perhaps that test failure you noticed [1] is a good counter-argument, since it shows a known case where a current flow does multiple writes to the memory_fault member. [1] https://lore.kernel.org/all/202309141107.30863e9d-oliver.sang@intel.com > Anyways, don't do anything just yet. :salutes: