From patchwork Wed Sep 11 20:41:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13801098 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 2D701EE57CF for ; Wed, 11 Sep 2024 20:54:50 +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=5I/tJcOHFIa65Wz9gc3TwU6W0/w2a3V6j4MGXxqQ3K8=; b=OQuolRlcv1uuBeRI7IqdVsmTkA AOEJQSWKS1Jdw8kMEcMcR+05ca44gnNL9hjw+oQD9LuReORH7UnqyYHBCL3kYCH/2EbB3I4SokNL5 6Bh2QJonvuztDlhUP9uaHIfJ0+wRUIVFNTvn+dfR/wTEkNKk8pgsMUl8fiF55aVVZ+NdsjF9nibFC gJ6GeBLw1lFXhPgYwjsyQMMCWKtL77W7NyJsey2T7QW8RQ6jGMN4JaLVy1IB36529DLUfeYbOgM8M 7NPIsvoxw6t1yYlze5Kt7afZEykNQecbS3Es/mbiVMvjIrgNZN2qsvSKJoMur9f/zU7Dry1dDNB5q DzZ5wEIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1soUMK-0000000B0Eg-0xV6; Wed, 11 Sep 2024 20:54:40 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soUAl-0000000Ax7D-1deW for linux-arm-kernel@lists.infradead.org; Wed, 11 Sep 2024 20:42:44 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-2d8dd20d0ddso1431975a91.1 for ; Wed, 11 Sep 2024 13:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1726087361; x=1726692161; 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=5I/tJcOHFIa65Wz9gc3TwU6W0/w2a3V6j4MGXxqQ3K8=; b=RNHWyLGn+//AwFVbSasBWWgl4sMJzlpBreVZKPgwyuCiJlWOabAAVF5idNU+nMbdlz ffKwCCX3YQQWkO3WNxGSC2glyEvS8YZ60Mo0lpHtAKPCjJmu1dKOu77acAIdEgN9XGNd zRGlqEAkW2VAjHCSkuiXgUDdf0dZ9tRtI922d89qxzoiYfiUxXgiijN66KY6YTFm3ykO ndRu+qtQ1PKEuoaesfa+HqSuodwTmXMfIHUSzPQr/ZMW1iwOo6FihT4K1L99zHZTEk9o m9Zf85AzIXEf4fdUHWrY1QwCVge2761b+Zv6dpvC9aJxF5zPllaShMNyHw2ibrh16Qh/ MroQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726087361; x=1726692161; 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=5I/tJcOHFIa65Wz9gc3TwU6W0/w2a3V6j4MGXxqQ3K8=; b=sf3pi/vKJiBC71mA8THbCR3I7fAKqC/sGjYFPBxwDzmas36J2+5fw9zAkwN13UuL9O u5U8LUMZt9J1BYOBVM4NoYP+yJGs2+axAX8rJtLC98JckhxX6rUr+iVWqO6b/jVOxvXm 0Q6JL1A3AbkpayUNj70kTQdlR6432UnHjfYCeSzZjP+qNj4BNyYE+7eVeskrMWw9mr+d 1GGs6Jurojpqkq/RBgODHNgOagkWiuyon7wUC+NDJB0weO4BG0ys+JQjJSrGgkNXDBlF t+sy+AS6Us9PrtfofE1bBrsSVkkDrGAae2eoJROjsK7RDkjTn243u5mncY20Cu1MgkYI 1i+Q== X-Gm-Message-State: AOJu0YygCHAN0X5FyzfPHRjIPewg5MrGas7eRTjGMfT7/ozUA+zXTiDN XUvjxfR0Ve8LtTqkLWAou6nx2FANH8wSCAJZrJdw97KIzVNLoFAtA//4Fhyrj8gyeAcrqcjbNKx uuA== X-Google-Smtp-Source: AGHT+IFOw2zNAqVhdCkeZdNi5IKOGHn5wgnynX/KErJqxVULBd4txDltmiT4cacd3crmvx8FKohy/M+nAhA= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90a:6fa6:b0:2d3:b1af:ae48 with SMTP id 98e67ed59e1d1-2db9fcb47f3mr17342a91.2.1726087361313; Wed, 11 Sep 2024 13:42:41 -0700 (PDT) Date: Wed, 11 Sep 2024 13:41:55 -0700 In-Reply-To: <20240911204158.2034295-1-seanjc@google.com> Mime-Version: 1.0 References: <20240911204158.2034295-1-seanjc@google.com> X-Mailer: git-send-email 2.46.0.598.g6f2099f65c-goog Message-ID: <20240911204158.2034295-11-seanjc@google.com> Subject: [PATCH v2 10/13] KVM: selftests: Use vcpu_arch_put_guest() in mmu_stress_test From: Sean Christopherson To: Marc Zyngier , Oliver Upton , Anup Patel , 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 , James Houghton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240911_134243_451254_E3E43BEE X-CRM114-Status: GOOD ( 11.38 ) 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. 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 5467b12f5903..80863e8290db 100644 --- a/tools/testing/selftests/kvm/mmu_stress_test.c +++ b/tools/testing/selftests/kvm/mmu_stress_test.c @@ -22,7 +22,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); } }