Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2566024rdb; Fri, 22 Sep 2023 02:19:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmFA2nbNX8prad7rwSrfV7XhJIvx9cKszPHd1l1HtmefsWszT+aylAgy0yKtgjBnTo4aRP X-Received: by 2002:a17:902:7202:b0:1bc:671d:6d31 with SMTP id ba2-20020a170902720200b001bc671d6d31mr5812367plb.3.1695374386780; Fri, 22 Sep 2023 02:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695374386; cv=none; d=google.com; s=arc-20160816; b=b+lq4m3o+MSupmZPKxLpc4n/Co36HALrbAYwxyTszNmRveqov8mSDKESgaHGLdOKuf RI5U6b/3iDsIDIMRkJX6Gz/8QSEgxEshzivasdCadsJc6QT5ijdQBhIXo3YrLLHYOGsu Ztx+tjS8vaZH9SS4BC+NYa/b8kYeyCdfTiSJ/saNRQlwHAbr8Q+6DwUsy+7vkyLPwW8q 3zIG6qdSfvcQlQOpRccy2cv+5UqvC964gPgQRXpZdz4V89psVn+MVltCiuBhiJMZ35zJ t41+QAzyti5RjD3cpOsL2o0Abyx2omDvxFO/fYGV4hXWBGuK8rCwf/QmpNbnDtaYPpSs D50A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=YKedUbEi3B4plTooYCB0IKgIV3PycN404RmnO3IuMFM=; fh=4zSMCzNb7rJrUGZtbNPceVM+tszI9ngqwF5WBZpI8NM=; b=X+yKedx8bC8kRoUwq90eanoQ4Dp6ptn+LWOy0NCDUpu0co+uOYXOSe5uSppxvhOECS n85rATkqrZAXqwGsMBfQQCKYQzCcwAYkmx/Tihd8wOKy1ANvMrtJhwPH0wWS5VqtbQGG U++x/9EjYfv8pBt3a0Me5kLQTSouIJxBu7lxLGs/ZmQ7pWg7LdHp0WcxFpV9haURebDw dqUFMX3KPXIUzsHDtKYyRiS/SKmUGdWNiokUENdFB9Jy6SySIjGqay3eL3sXhdv8hnVS dsykeDdyN8x3HMHglpHFwZGBj5oNy5z0oSEL68rfFXojEYysd0K3q9xoeE3UQETHn8HA qzgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FlFywrXN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id cp6-20020a170902e78600b001a6f0eab385si3425542plb.55.2023.09.22.02.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:19:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FlFywrXN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 6051281829CF; Thu, 21 Sep 2023 14:56:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232465AbjIUVz4 (ORCPT + 99 others); Thu, 21 Sep 2023 17:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233117AbjIUVzk (ORCPT ); Thu, 21 Sep 2023 17:55:40 -0400 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B779008 for ; Thu, 21 Sep 2023 14:53:19 -0700 (PDT) Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1c577fea3dcso12002135ad.2 for ; Thu, 21 Sep 2023 14:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695333199; x=1695937999; darn=vger.kernel.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=YKedUbEi3B4plTooYCB0IKgIV3PycN404RmnO3IuMFM=; b=FlFywrXNo8pt0M7BkGTPu/YBFaZ8cFrCflUdyIS2JhrANUQAlS+fVmKFc0oynyRuNu gik6QINZKtrEhc56ySwdyIrnhj5DQchxj01WAhtasJTBrOUd+N/RaE4ucbUDwEgLMJ0m 64gZbhblWUB4KtbnrNOLsQZQ+6t3Op6YnfOMoNHV2b2iLCxNlaDlz9NPOcriowvduXgC J641nC9uCd0O1GdN/U7d1l2TpVR8m1uvuP155XW4/qUWaKNepoHZewQryUdCCSYj2BG2 2Ixe2sE6APsJHiL1UXambg5driKpj5apowXUcy5q2owoNNvBLp5atZLuQILlINnOl26h EyMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695333199; x=1695937999; 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=YKedUbEi3B4plTooYCB0IKgIV3PycN404RmnO3IuMFM=; b=iKn95RH1jStdG0ikCWIb6jTZ2qSoeksaJgLJdoyVsHFKkxhbVKjvmw+zEvSyIEp8d2 619sUmGRIlrL1dJMBJ23oIfDPfUEKdsW+BzMPjSGus/xov8sZJW/4wxLbGlNkSveKWnA ioib+GLrtmn3vZkDXi/XG5JHOOqLSpdHLB4jTQsm/ubEOOu6+4p611Id8q4+lxOeJ8Gh L4IXSm4VNhO7/PUUjxIv8LME4e5mvnVUPs6vIA7XjbG0CtDxV5evDJnLdGoCM88+/16b 8fskRX81mEgsF5lltFcXDh4R9sgJzWhusZjtPSH08d8eHeLY7qiVTe+OwKnU2FHbyS2b 0CCg== X-Gm-Message-State: AOJu0Yx5z75dmUAx7J3Eja3r4wRpoqA3bbMmSYwmusxCfXenkYdTfcvS p/37uP3XCSBPyyJfQVyL5vz2sAuXL/c= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:facd:b0:1c5:746f:efb3 with SMTP id ld13-20020a170902facd00b001c5746fefb3mr67381plb.9.1695333199087; Thu, 21 Sep 2023 14:53:19 -0700 (PDT) Date: Thu, 21 Sep 2023 14:53:17 -0700 In-Reply-To: <363c4ac28af93aa96a52f897d2fe5c7ec013f746.1695327124.git.isaku.yamahata@intel.com> Mime-Version: 1.0 References: <363c4ac28af93aa96a52f897d2fe5c7ec013f746.1695327124.git.isaku.yamahata@intel.com> Message-ID: Subject: Re: [RFC PATCH v2 4/6] KVM: gmem: Add ioctl to inject memory failure on guest memfd From: Sean Christopherson To: isaku.yamahata@intel.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Michael Roth , Paolo Bonzini , erdemaktas@google.com, Sagi Shahar , David Matlack , Kai Huang , Zhi Wang , chen.bo@intel.com, linux-coco@lists.linux.dev, Chao Peng , Ackerley Tng , Vishal Annapurve , Yuan Yao , Jarkko Sakkinen , Xu Yilun , Quentin Perret , wei.w.wang@intel.com, Fuad Tabba Content-Type: text/plain; charset="us-ascii" 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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:56:51 -0700 (PDT) On Thu, Sep 21, 2023, isaku.yamahata@intel.com wrote: > + if (!pfn_valid(pfn)) > + return -ENXIO; > + return memory_failure(pfn, MF_SW_SIMULATED); memory_failure is defined iff CONFIG_MEMORY_FAILURE=y. All of this code would need to be conditioned on that (in addition to the injection configs). address_space_operations.error_remove_page() arguably should be conditioned on that as well, but that's a much bigger change and not a problem that needs to be solved anytime soon.