Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2651287iof; Wed, 8 Jun 2022 09:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSYG1NTZPOtnP7vqoo3H3sJt7+RCQ3WfONn+NLfxM8u17fZfxfAGZg5lZwwzAP513MJKK8 X-Received: by 2002:a17:90b:17d0:b0:1e3:5324:c465 with SMTP id me16-20020a17090b17d000b001e35324c465mr38436640pjb.34.1654704783621; Wed, 08 Jun 2022 09:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654704783; cv=none; d=google.com; s=arc-20160816; b=MZqlcl6QZ0A6b5faCb9O566BIyDZDEGYRu17A56CV+rHPyrbyBJ9pf1C3hK2PGnbuk ga+xEFAbKT6u6QESd7to3uBjg3AFxY/YRbouZ89cPdPqLinOcI670AYp8vrZ21Fi9J82 q0K0EqZcaXhOg0PAjvjOSHv+tWWHj6z033Lwredj1VS7LSGn5n3b9MExu8oUJvrsVo7e muULsAoEDawkTza0uoZbs0vYmaRkWUhSs2GXAOQCmarrwHMft6SJmHKmwzx6bSKdAD0i j4texK7SrJg/6RAHu7G3elwkTbMOs7mDrREg/90UMy6gQ9JZU9wH6ybKakSjubVKdVct Toug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=Tu0OsjwZa4ludPA2tEG1vc59ARA2J6I+UUbwvpkgDZk=; b=XMBJ2wcSqx1RskaTvgDVUyHGl8H6SiOoXtclvCRsIdsvb9qIL6CbkHUyIgaMBv2JJj 00uh1TxZtwRG6SkurQzg1o7q1nuBFGrSHBVs+/ju5g/XsSUgEoMcHGR9k8/VNuEM1C4J gbnBy11LsxdAcvvK8afMOY2R93cOakYnevoS/YrH3W2xpE2BpOW0JjfxnVS4b2PupVKc tGEuEocBQc83wNv+yBJSO7lSznizKL7BNe9g+8bTRUKDDWh7E3Eys24QUp5SZ7pdYDan vNszTS5zdlxu9wDiAQDq/WKLfl0k6wqocZ7pg6YpfD1fGrwMKpQ3o1xpUWDPdtz8KsRp 7Ogw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tNSyCECu; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o21-20020a170903211500b00161d4849aa6si25052173ple.390.2022.06.08.09.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 09:13:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tNSyCECu; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5A287C1EF5; Wed, 8 Jun 2022 08:45:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244672AbiFHPpJ (ORCPT + 99 others); Wed, 8 Jun 2022 11:45:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244597AbiFHPpH (ORCPT ); Wed, 8 Jun 2022 11:45:07 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC32E1090; Wed, 8 Jun 2022 08:45:06 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 57B2B1F91D; Wed, 8 Jun 2022 15:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654703105; h=from:from:reply-to: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=Tu0OsjwZa4ludPA2tEG1vc59ARA2J6I+UUbwvpkgDZk=; b=tNSyCECuRzHYHJR8lJlXwRk7JkJpmfPk/TzfmwPcSZUX3Lv3H3lAC436XtYmRpOzCTqrfV HTgTER8aFgp44Q1zP1ptLJVxXGOc6gYI0Ci4eTYHB9WZsg/Y2ic4AxaU105FXNvU0vHo2b fvbkK7gcFyHWQ/JrVzlBnhL85ZWJ1c4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654703105; h=from:from:reply-to: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=Tu0OsjwZa4ludPA2tEG1vc59ARA2J6I+UUbwvpkgDZk=; b=5AJ2uA3fTrMStKdHoVjBCvvLp+nQHPjUtIw7c6uoujcEnEShTH58YeCwX1YD+ZKsATrLq6 eaP+Az5Z9+ymlzBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1749713AD9; Wed, 8 Jun 2022 15:45:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jQlvBAHEoGLlGgAAMHmgww (envelope-from ); Wed, 08 Jun 2022 15:45:05 +0000 Date: Wed, 8 Jun 2022 17:45:03 +0200 From: Vasant Karasulli To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, jroedel@suse.de, kvm@vger.kernel.org, bp@alien8.de, x86@kernel.org, thomas.lendacky@amd.com Subject: Re: [PATCH v6 2/4] x86/tests: Add tests for AMD SEV-ES #VC handling Add KUnit based tests to validate Linux's VC handling for instructions cpuid and wbinvd. These tests: 1. install a kretprobe on the #VC handler (sev_es_ghcb_hv_call, to access GHCB before/after the resulting VMGEXIT). 2. trigger an NAE by executing either cpuid or wbinvd. 3. check that the kretprobe was hit with the right exit_code available in GHCB. Message-ID: References: <20220318094532.7023-1-vkarasulli@suse.de> <20220318094532.7023-3-vkarasulli@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mi 08-06-22 14:35:55, Sean Christopherson wrote: > On Wed, Jun 08, 2022, Vasant Karasulli wrote: > > On Mi 06-04-22 01:22:55, Sean Christopherson wrote: > > > > + if (ret) { > > > > + kunit_info(test, "Could not register kretprobe. Skipping."); > > > > + goto out; > > > > + } > > > > + > > > > + test->priv = kunit_kzalloc(test, sizeof(u64), GFP_KERNEL); > > > > > > Allocating 8 bytes and storing the pointer an 8-byte field is rather pointless :-) > > > > > > > Actually it's necessary to allocate memory to test->priv before using according to > > https://www.kernel.org/doc/html/latest/dev-tools/kunit/tips.html > > If priv points at structure of some form, sure, but you're storing a simple value. Yes, I agree. The reason it was done this way I guess is that type of priv is a void pointer and storing a u64 value results in a compiler warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]. Thanks, Vasant Karasulli Kernel generalist www.suse.com [https://www.suse.com/assets/img/social-platforms-suse-logo.png] SUSE - Open Source Solutions for Enterprise Servers & Cloud Modernize your infrastructure with SUSE Linux Enterprise servers, cloud technology for IaaS, and SUSE's software-defined storage. www.suse.com