From patchwork Wed Oct 9 15:49:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13828732 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 04F26CEE32A for ; Wed, 9 Oct 2024 16:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To: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: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IpGlLPpdKIlhRCfJQtftwzWlWOxZ3g0ZRZhoTsEcT4I=; b=wehSpCXlOM5c4Q2U4eSTUUyK9Z +KEfrmnecSyADyljW9y4nvz5XPHpZauK3py/suAAepxehCMrZaXzV3uXWyd52fY2c4UC73CZknHH3 zM7f++Y25VqKEH7YGgDAmsJTF4M8TvyIanBiCZdZTVLVVM05EM2wCHPYejRyfPK16wu6mHdwKY43v lVAABtDjjddJJMDVWXN4IiYoeOm/BwqiKOq9Qmegq5VcdmOp1HILf7h+2gtS4F2owIThYoZdqMhBa 6VeZykz++rHXh8jEYJtOU0wbD6g2+R4r6SWuKFYZr4hMqizvncuImNo70Z8/lCNGLffZ+Oa34E1U0 6Y4NvHCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syZF1-00000009sar-3e90; Wed, 09 Oct 2024 16:08:47 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syYxA-00000009oDK-1k6E for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2024 15:50:21 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e2903a1cfe3so877515276.1 for ; Wed, 09 Oct 2024 08:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1728489019; x=1729093819; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=IpGlLPpdKIlhRCfJQtftwzWlWOxZ3g0ZRZhoTsEcT4I=; b=CcJumS7W20HiHRkWlWvivwDUuP8/dyuHCoCsrxJC+R4SWEHSHfjVKz/gQIeW2TP8GR 5DAuNjfhNM23laQWeFswiDAuDgo8X85L+YzcB4vRU+mQzCO9uE+hGspWTZ9SOvBMeppO pKc+wd7Tsi14iQxKv2xsZX0tyMmPjGNOkTpuc+uLgLFK1vEzPgbX644BI2SFH6BG61q4 6m++mGAVACMbFO1jDZWvREeaSY1blfyeZr8y0yDGlQa+uu9AOqOFyziGy+sCpOEGJ5fb Cb33cP+iNrHDQ1u0wIujCMU4/URQZt+lN+Y1aXMGQtvqH6LuGl5CAxgZCBBpAg7bqifY fopA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728489019; x=1729093819; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IpGlLPpdKIlhRCfJQtftwzWlWOxZ3g0ZRZhoTsEcT4I=; b=G9eI7YN+BlBooHokoviGFU6hPIL0+YLeJfJmCJV9W/8d++sJzwBv2mdJf6QFEWq7TY Q8Tb4umu4y7J5OoWBWpE21Fvf5C83Gn7q5HfiNylSSEpbwX4MfRsKWKbCgttBz85Ix8F qZpZHV8pmS+nsDbcWJt38dVlzRJgZwY0/cLc0MmcSS1nyRjphsrSJTkC/Xfl/SZZuSZY 07DHLm26QJ9PUb7SKjdUUVu159A7ww8VGIsqej8m2uamXR/KrSyGyJJWNTymQEyz4uzp i29l+Bw96V0mcqXSSZUWRJHAIhVq9yrngA7I72QfU9fzp1K9xPGYjWf49qdhDQnU3bQl XmtA== X-Gm-Message-State: AOJu0Yy88be0HvEtuibwbZiJiiVBPlCU3Dw97nYB2YKlKs/v9fZNPRs+ U7PU0Z+qXM86SrIk1mX/ufEH1w98TxU/YUn9IGO4BkDBCIKtf55iUbiYXOBMFzsyW3RbmLSIx4u jYw== X-Google-Smtp-Source: AGHT+IHJrTSljEGX+w+vGWljsF6J67uTWXS92qMmyHsTMzVm3HG9JVjkOOVhTNIgejhJpa5nZzlmmTlBPQo= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:9d:3983:ac13:c240]) (user=seanjc job=sendgmr) by 2002:a25:8248:0:b0:e28:e97f:5397 with SMTP id 3f1490d57ef6-e290b7ec5bdmr51276.3.1728489018761; Wed, 09 Oct 2024 08:50:18 -0700 (PDT) Date: Wed, 9 Oct 2024 08:49:50 -0700 In-Reply-To: <20241009154953.1073471-1-seanjc@google.com> Mime-Version: 1.0 References: <20241009154953.1073471-1-seanjc@google.com> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog Message-ID: <20241009154953.1073471-12-seanjc@google.com> Subject: [PATCH v3 11/14] KVM: selftests: Use vcpu_arch_put_guest() in mmu_stress_test From: Sean Christopherson To: Marc Zyngier , Oliver Upton , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Christopherson , Andrew Jones , James Houghton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241009_085020_464784_26D19AD2 X-CRM114-Status: GOOD ( 11.63 ) 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: , Reply-To: Sean Christopherson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use vcpu_arch_put_guest() to write memory from the guest in mmu_stress_test as an easy way to provide a bit of extra coverage. Reviewed-by: James Houghton Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/mmu_stress_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/mmu_stress_test.c b/tools/testing/selftests/kvm/mmu_stress_test.c index fbb693428a82..656a837c7f49 100644 --- a/tools/testing/selftests/kvm/mmu_stress_test.c +++ b/tools/testing/selftests/kvm/mmu_stress_test.c @@ -23,7 +23,7 @@ static void guest_code(uint64_t start_gpa, uint64_t end_gpa, uint64_t stride) for (;;) { for (gpa = start_gpa; gpa < end_gpa; gpa += stride) - *((volatile uint64_t *)gpa) = gpa; + vcpu_arch_put_guest(*((volatile uint64_t *)gpa), gpa); GUEST_SYNC(0); } }