From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2609C18B18 for ; Mon, 31 Jul 2023 17:19:49 +0000 (UTC) Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-d10792c7582so3585266276.3 for ; Mon, 31 Jul 2023 10:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690823989; x=1691428789; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=gdb7QzlYcOc7UWmxcegrKrVqMfFsYHZFCwi2LL3my64=; b=zBusOqyPc9Ltaaqmju2VylABq68z3gA0yH658LtIHqnM7muXRoiPK7Z+lJWtWm/VN7 8whOaU6x9OiXazWcYr8fAVYmvIyO6TYz06QaVHcaE8EQS9KLvJWFds1kXHPR5gfyol/T hwExr3eIMCbASZqYoMXC5wv7UZF1Mp2U4BBszuz1saEchMHIrtLN7I0wmDOtomAyfGK4 Jb/4sUIrkAMy5yEhhybvRPtzSFoc+rBWIZvDZCJzlFd/cD+b3RLT1Lug7yCp0xC4QWhy NI1FLe1nSeay7t1G8coFkWiO2qxxWysi0sKSxyJbI8pSaEUs+h67fGOJLF0xb0FIQUeT 6ssw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690823989; x=1691428789; 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=gdb7QzlYcOc7UWmxcegrKrVqMfFsYHZFCwi2LL3my64=; b=gbVPwQKqBoXAiHiOsN0QTsYTdUnYS6TA8x71bFR12BdfamohovcDhWHmNf0ULs7u/q jMPaI1xF6rE1rCTXm9CwRdL6dH/mFC39SHeQupVyBz/yaP6Ny27ary/KXZIcfge1gms4 cV4FDyyfbhDGGo0zpBzs0cTGzbrlxAI6kEQJID6WaePY1gNZhDhBP5TfooSQksnZWAHL E5E8hl2V5UZZxcRhNjSWI7wIZBlwvF52hT6H9n/RoKmlPPAGSbZk0fcpjLKlFSQDzJi9 CRnvowGtcCMtXQu4rKg4Xegg3qPJIeF8v4hldgfNLO+oZxFACprKfJWk+nZ9I7IxTCle BxMw== X-Gm-Message-State: ABy/qLZoDGZYEPkoi4+n2qEUNFEAFEoktQCC0hAzETd8cesRT7yjru5r rTtlFzrd/Sa39xLHzkcBP2ofa4oXD2Q= X-Google-Smtp-Source: APBJJlGDPfFjSpxr1qlDSkpPLfZlx10bTCXz+EMu9wyIQgv1N0AgtgkGqemxSj6OVMzULEQvuuVcsCXfoZ4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:abe3:0:b0:d22:4059:b2bd with SMTP id v90-20020a25abe3000000b00d224059b2bdmr62850ybi.1.1690823989036; Mon, 31 Jul 2023 10:19:49 -0700 (PDT) Date: Mon, 31 Jul 2023 10:19:47 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20230729003643.1053367-1-seanjc@google.com> <20230729003643.1053367-10-seanjc@google.com> <20230731-91b64a6b787ba7e23b285785@orel> Message-ID: Subject: Re: [PATCH v4 09/34] KVM: selftests: Add a selftest for guest prints and formatted asserts From: Sean Christopherson To: Andrew Jones Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Thomas Huth , "Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?=" , Aaron Lewis Content-Type: text/plain; charset="us-ascii" On Mon, Jul 31, 2023, Sean Christopherson wrote: > On Mon, Jul 31, 2023, Andrew Jones wrote: > > diff --git a/tools/testing/selftests/kvm/include/ucall_common.h b/tools/testing/selftests/kvm/include/ucall_common.h > > index 4cf69fa8bfba..4adf526dc378 100644 > > --- a/tools/testing/selftests/kvm/include/ucall_common.h > > +++ b/tools/testing/selftests/kvm/include/ucall_common.h > > @@ -6,8 +6,19 @@ > > */ > > #ifndef SELFTEST_KVM_UCALL_COMMON_H > > #define SELFTEST_KVM_UCALL_COMMON_H > > +#include > > #include "test_util.h" > > > > +#if defined(__aarch64__) > > +#define UCALL_EXIT_REASON KVM_EXIT_MMIO > > +#elif defined(__x86_64__) > > +#define UCALL_EXIT_REASON KVM_EXIT_IO > > +#elif defined(__s390x__) > > +#define UCALL_EXIT_REASON KVM_EXIT_S390_SIEIC > > +#elif defined(__riscv) > > +#define UCALL_EXIT_REASON KVM_EXIT_RISCV_SBI > > +#endif > > + > > /* Common ucalls */ > > enum { > > UCALL_NONE, > > > > and then compiled the test for riscv and it passed. I also ran all other > > riscv tests successfully. > > Can I have your SoB for the ucall_common.h patch? I'll write a changelog and fold > in a separate prep patch for that change. On second thought, I take that back. I think it makes more sense to add a ucall.h for each arch and #define the exit type there. All then move all of the ucall_arch_do_ucall() implementations to ucall.h (except maybe x86 while it has the horrific save/restore GPRs hack...). That way the #define is colocated with the code that generates the exit reason. 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 B5B98C001DC for ; Mon, 31 Jul 2023 17:20:22 +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:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YappSHDFqUW/ab+s4gT8TlkrhUChSLyO44B58ADw7uY=; b=w+RsLzjkuYPwg15or7Gk60FzE3 Rr/UqHmZi2F0jjl6jePzfQtUQ+KeepT9RIIG1bEUOVPQoauxq/etiK418beJI00Gr0DGj4c7jKeKo 2iYObpvR8TCTDh+qM+06bu2xIbl5Gcb7AyiklUWpcTdXrLLsrO7tnRAmyY04+yDWTEVD6NiY7PyYI 0XS6rcSshoZKOycSrWsrsuiBTQ+r7RTX0lkOmFtZnjIS7atEXlyLEiV62b1p79x1CPtgbU45ybC78 Utp5V0hhZqHWNIwGJBrLNwCUIiGzbXpSNaUfZF9y9QESIp0XwBAEToo7GXBe9i0sP9hPUFUc5lHCs 0noiXgzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQWYk-00GqHQ-1u; Mon, 31 Jul 2023 17:19:54 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQWYg-00GqGk-2y for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 17:19:52 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-c8f360a07a2so3577121276.2 for ; Mon, 31 Jul 2023 10:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690823989; x=1691428789; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=gdb7QzlYcOc7UWmxcegrKrVqMfFsYHZFCwi2LL3my64=; b=zBusOqyPc9Ltaaqmju2VylABq68z3gA0yH658LtIHqnM7muXRoiPK7Z+lJWtWm/VN7 8whOaU6x9OiXazWcYr8fAVYmvIyO6TYz06QaVHcaE8EQS9KLvJWFds1kXHPR5gfyol/T hwExr3eIMCbASZqYoMXC5wv7UZF1Mp2U4BBszuz1saEchMHIrtLN7I0wmDOtomAyfGK4 Jb/4sUIrkAMy5yEhhybvRPtzSFoc+rBWIZvDZCJzlFd/cD+b3RLT1Lug7yCp0xC4QWhy NI1FLe1nSeay7t1G8coFkWiO2qxxWysi0sKSxyJbI8pSaEUs+h67fGOJLF0xb0FIQUeT 6ssw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690823989; x=1691428789; 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=gdb7QzlYcOc7UWmxcegrKrVqMfFsYHZFCwi2LL3my64=; b=kHW9jY38DfXq+is1zj6DwX3/c7sk2JwAn8G5Yc6zBKuVMXzi9T5raHzLQPAF5qJ5n3 MvN4Tu5CXHIZ69g+VhjvIaYPT/xDkj7puCP3a5te+vFh9hvWFJlVBRZy6g9nKYkAmGst 7YL+YqF+n/tse3t0Q52Ho+or903Jhva1ppuiQNX+bMs5NEVXjtHvPfWR1RoLcykUZ0Y6 /AAGnb3DqJvWrsvdm+g4HqdzSMF3fbywU4MRsuV7bn2Cba8GHIj+qMFx36slFncKGPrG l9IYgRaxy+++B0igQ63jk0zz1a/qMfF7P+19a2gdT7wBcyNbw9i1bmvdIxLyl5IiE5tD sRjw== X-Gm-Message-State: ABy/qLakiA87rwwLMT4szlaU49bOXWJvH6wNzJjkl0cw0bU1di1N1C3s 9cqFI0BJ7ztbNEep+P/k8FjdFzpYG9k= X-Google-Smtp-Source: APBJJlGDPfFjSpxr1qlDSkpPLfZlx10bTCXz+EMu9wyIQgv1N0AgtgkGqemxSj6OVMzULEQvuuVcsCXfoZ4= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:abe3:0:b0:d22:4059:b2bd with SMTP id v90-20020a25abe3000000b00d224059b2bdmr62850ybi.1.1690823989036; Mon, 31 Jul 2023 10:19:49 -0700 (PDT) Date: Mon, 31 Jul 2023 10:19:47 -0700 In-Reply-To: Mime-Version: 1.0 References: <20230729003643.1053367-1-seanjc@google.com> <20230729003643.1053367-10-seanjc@google.com> <20230731-91b64a6b787ba7e23b285785@orel> Message-ID: Subject: Re: [PATCH v4 09/34] KVM: selftests: Add a selftest for guest prints and formatted asserts From: Sean Christopherson To: Andrew Jones Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Thomas Huth , "Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?=" , Aaron Lewis X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_101950_957992_1C86C203 X-CRM114-Status: GOOD ( 17.99 ) 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 Mon, Jul 31, 2023, Sean Christopherson wrote: > On Mon, Jul 31, 2023, Andrew Jones wrote: > > diff --git a/tools/testing/selftests/kvm/include/ucall_common.h b/tools/testing/selftests/kvm/include/ucall_common.h > > index 4cf69fa8bfba..4adf526dc378 100644 > > --- a/tools/testing/selftests/kvm/include/ucall_common.h > > +++ b/tools/testing/selftests/kvm/include/ucall_common.h > > @@ -6,8 +6,19 @@ > > */ > > #ifndef SELFTEST_KVM_UCALL_COMMON_H > > #define SELFTEST_KVM_UCALL_COMMON_H > > +#include > > #include "test_util.h" > > > > +#if defined(__aarch64__) > > +#define UCALL_EXIT_REASON KVM_EXIT_MMIO > > +#elif defined(__x86_64__) > > +#define UCALL_EXIT_REASON KVM_EXIT_IO > > +#elif defined(__s390x__) > > +#define UCALL_EXIT_REASON KVM_EXIT_S390_SIEIC > > +#elif defined(__riscv) > > +#define UCALL_EXIT_REASON KVM_EXIT_RISCV_SBI > > +#endif > > + > > /* Common ucalls */ > > enum { > > UCALL_NONE, > > > > and then compiled the test for riscv and it passed. I also ran all other > > riscv tests successfully. > > Can I have your SoB for the ucall_common.h patch? I'll write a changelog and fold > in a separate prep patch for that change. On second thought, I take that back. I think it makes more sense to add a ucall.h for each arch and #define the exit type there. All then move all of the ucall_arch_do_ucall() implementations to ucall.h (except maybe x86 while it has the horrific save/restore GPRs hack...). That way the #define is colocated with the code that generates the exit reason. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel