From mboxrd@z Thu Jan 1 00:00:00 1970 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 9BCB5C433EF for ; Thu, 23 Dec 2021 17:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lf5D3a5l951KXiuBfDkVxZOH9yusbxnqiSHazpEVhkg=; b=GeRK2TXN4vdItM j33MfYhFmpLWT2HGSE9XzypQUQLD23YKTaRO1GtELwknIKBTERfaYdadA9KmFpFWvKWjwSN4nNJuX /JKo7tb1f4QFFjrEHCe3m6HP/aiydY0qpk6laCVZUhRQGqQRvIk+C2vzL2DyIYJEQBVZEGUFXh55K /jJG4923uMF7dBLxT3Vk3q26ng6S9xo+3OWZcDa17CCY7w48aEJznwFdS8reSx7UprCRFpzG3uzXo m7IymLMDTBuDDoLMGACsmvg8jGKHOjIDhzdMfy9B9GfmDtkgffyePwvgarhtM8xiKQc4Sn5fBxvE7 sdYxNYVrfYt1Bds0Qp9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0RS1-00D7aj-DE; Thu, 23 Dec 2021 17:00:21 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0RRx-00D7aF-7l for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 17:00:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640278815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QbDlCNO8BeLEzEuY1o/Yj/OOV9u7i5H7i/UVWO5+jqU=; b=E+juW0NfEhQ/HUnFY9Y9n2q+mWzWYwtTQmz/+NFkQ8rBIKM/5nzfIFr76X2lYLaWIBdU+Q T8HDxqoWQxLlp1efsdBklnr6Q+H2bcCk1U617gRJDK9EIUVOIHN5t5ldxfVo0hWIwd2Uhb Q8PLKTeI1OSpi2UXCn2c0BK4xsJQUHA= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-658-m0Ld06sGPy6Zr6m929fEkg-1; Thu, 23 Dec 2021 12:00:14 -0500 X-MC-Unique: m0Ld06sGPy6Zr6m929fEkg-1 Received: by mail-ed1-f70.google.com with SMTP id c19-20020a05640227d300b003f81c7154fbso4948954ede.7 for ; Thu, 23 Dec 2021 09:00:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QbDlCNO8BeLEzEuY1o/Yj/OOV9u7i5H7i/UVWO5+jqU=; b=hkBxroWwztuYW+VmBhFhQ08eryCJ3PHmGEt7FOrzlhlA+VZDQuyuX/ZUbfDoGfTeFv KyfqixwYM3SUVqfXjaMAr9Fw7ih83w3MtgNOi863S3tXcGT4sNomDBcfUYGh+jClg2iG Sz81NwhlWAi33FGUqBHkm6AioKU5QeXCiUScWBVEIr2bwBSuchXO/gra7SL1GhfB9ntA IQ+0WDXyibhNxSMpnXum0R7Q0Lek6YRmUaxVS2MuFCwWPAk+hkK2nkDdGjBwdeQyN8IC hPwm2vuq9rbn+1nJ1mV9YmJ0EExvrgOwxOVB76m776vzG3vsn+fWpmRgyVECldw0ouSB NTZA== X-Gm-Message-State: AOAM532caDl6EI6T++oIEz3Lt+EQ4McpmBjG9wts8Tb8BDssNwFEbicF t/Izg7cFb0pFDix2U/oc85eyOUrRDWFxQqtTaJnRjSlrX1Kimj4RBLqWuR4mK92uum96hKY2E4C 6XGV8hEv1eQv3Z/P6lQKuRMZizaTObKBomhM= X-Received: by 2002:a17:906:478a:: with SMTP id cw10mr2509589ejc.693.1640278812810; Thu, 23 Dec 2021 09:00:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOXau0JYojDMrB4uhQtijnQf3uwLfJ8/1WFDQKJxoqhmtXGvyUBxdGs2J03ArKxDWe2arRKw== X-Received: by 2002:a17:906:478a:: with SMTP id cw10mr2509570ejc.693.1640278812612; Thu, 23 Dec 2021 09:00:12 -0800 (PST) Received: from gator.home (cst2-173-70.cust.vodafone.cz. [31.30.173.70]) by smtp.gmail.com with ESMTPSA id t9sm2203094edd.94.2021.12.23.09.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 09:00:12 -0800 (PST) Date: Thu, 23 Dec 2021 18:00:10 +0100 From: Andrew Jones To: Marc Zyngier Cc: Paolo Bonzini , James Morse , Suzuki K Poulose , Alexandru Elisei , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com Subject: Re: [PATCH 2/5] KVM: selftests: Initialise default mode in each test Message-ID: <20211223170010.pekdezsyn75iuxqb@gator.home> References: <20211216123135.754114-1-maz@kernel.org> <20211216123135.754114-3-maz@kernel.org> MIME-Version: 1.0 In-Reply-To: <20211216123135.754114-3-maz@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_090017_385369_870D4734 X-CRM114-Status: GOOD ( 17.86 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 16, 2021 at 12:31:32PM +0000, Marc Zyngier wrote: > As we are going to add support for a variable default mode on arm64, > let's make sure it is setup first by sprinkling a number of calls > to get_modes_append_default() when the test starts. > > Signed-off-by: Marc Zyngier > --- > tools/testing/selftests/kvm/aarch64/arch_timer.c | 3 +++ > tools/testing/selftests/kvm/aarch64/debug-exceptions.c | 3 +++ > tools/testing/selftests/kvm/aarch64/get-reg-list.c | 3 +++ > tools/testing/selftests/kvm/aarch64/psci_cpu_on_test.c | 3 +++ > tools/testing/selftests/kvm/aarch64/vgic_init.c | 3 +++ > tools/testing/selftests/kvm/kvm_binary_stats_test.c | 3 +++ > tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 3 +++ > tools/testing/selftests/kvm/memslot_perf_test.c | 4 ++++ > tools/testing/selftests/kvm/rseq_test.c | 3 +++ > tools/testing/selftests/kvm/set_memory_region_test.c | 4 ++++ > tools/testing/selftests/kvm/steal_time.c | 3 +++ I wish there was a better way to set the defaults for each test without requiring a function call to be put at the beginning of each test. Maybe we should create a constructor function? I.e. diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index f307c9f61981..603e09be12ae 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -148,7 +148,7 @@ LDFLAGS += -pthread $(no-pie-option) $(pgste-option) # $(TEST_GEN_PROGS) starts with $(OUTPUT)/ include ../lib.mk -STATIC_LIBS := $(OUTPUT)/libkvm.a +STATIC_LIBS := lib/init.o $(OUTPUT)/libkvm.a LIBKVM_C := $(filter %.c,$(LIBKVM)) LIBKVM_S := $(filter %.S,$(LIBKVM)) LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C)) diff --git a/tools/testing/selftests/kvm/lib/init.c b/tools/testing/selftests/kvm/lib/init.c new file mode 100644 index 000000000000..6f92a85aa263 --- /dev/null +++ b/tools/testing/selftests/kvm/lib/init.c @@ -0,0 +1,6 @@ +#include "guest_modes.h" + +void __attribute__((constructor)) main_init(void) +{ +#ifdef __aarch64__ + guest_modes_set_default(); +#endif +} Thanks, drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel