Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1173675iol; Fri, 10 Jun 2022 01:42:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcA27c4RGdbzdIg0EeLymGcL8u2/LsHQWBJFKeZhiwGIJDR7eYbrrf4j/dSUBrACeVdyJd X-Received: by 2002:a05:6402:278e:b0:431:73ab:49b9 with SMTP id b14-20020a056402278e00b0043173ab49b9mr23693568ede.415.1654850570851; Fri, 10 Jun 2022 01:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654850570; cv=none; d=google.com; s=arc-20160816; b=oQM+a5a3VI/okM64l09cmEx7SCeLNvchWPWD2QtjCxV1GDEN9ltUStlZ0/6H6G0m+E 6TcY3voO8lmFGTRm9DyPawRQeogl2je8AlRIpUBCUdvUCMJi2X6Of6B5Tj5kgQI9oeZU z5BMlxV5hBIhGOero5GzH7PFGTUChPoPGRtJuu99NloTNhuKOrzqPZE36XUhIMVQmMKz Dih4+lViWce5CRYnrGhiETVd0tTrps9ZHeLCmQfDlhzyw1PJF80tyv6SyVqNyPQB20k5 T620+vUGcm/2FL/byUDwE2FpIZOvXDgVgjBtcKzWV1ACbaswd+y1+kn7iQbDXE+ufTXL JJzQ== 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=ddYCcILpWSFWSrGEhbpAMqUQH/naqY2EfCNkEOYWkgk=; b=eolcDsU+bGIkgwR+kzGFJ6lT062mJXMKvq3IW2CBE6BoRpRx4yXqwJgdAHye4/Uq0n 6VJgoDkuRdWIsH6K0VuOGQM7SSPvAkf8q18ZxIIjAlV1O0BFHq+nMFx3jxpiLvo18IJg 9GIR9YmImP2Balbp9lfMqXsVoempgtrPx92w1rFkTO6Jx3u/PsSHwtF+vH5BjFay1SOx pDeYlpOLjKNzm2xy01NfPt59h/XcHzese7BFBnnKnCLyVEk1SG0U1BN5GQMj72RtMk0I dTVJ+h725B9fr7VjmgCa+F51QE/xHVQxlddPo2BCWtLsKSZa1dVhrsS8EVvy3sMIXfAw wQRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kHkds3xn; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=VwxlfRo0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk15-20020a170906b0cf00b006df76385c76si27523952ejb.278.2022.06.10.01.42.23; Fri, 10 Jun 2022 01:42:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kHkds3xn; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=VwxlfRo0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347327AbiFJIbh (ORCPT + 99 others); Fri, 10 Jun 2022 04:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348237AbiFJI3Q (ORCPT ); Fri, 10 Jun 2022 04:29:16 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E43313A5D6; Fri, 10 Jun 2022 01:28:11 -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 8EF8F1FE01; Fri, 10 Jun 2022 08:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654849690; 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=ddYCcILpWSFWSrGEhbpAMqUQH/naqY2EfCNkEOYWkgk=; b=kHkds3xn6vO47MLbgyIskY+RCvg7FgvsR+U6gK+LvgXtil4Fr4wIYBF9HTbADct8Cx64bx wU38fTAp6fmTm7Zl/d9SLeEtikgWessrBFWQxflsifhQqkuQ3fFW+QgTpv+QlZ+TKHnFDO 8AX5QnlR+FtNYWAlM6voIYmVSqI7vmA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654849690; 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=ddYCcILpWSFWSrGEhbpAMqUQH/naqY2EfCNkEOYWkgk=; b=VwxlfRo0Eevi5kGT6e+cfg/dOQhyBrPSk7XWFXqsLlRviEJzE8rVszINhBA4QzOsDL+1+u 5GXrJk0jJnBMB4AQ== 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 46A7C13941; Fri, 10 Jun 2022 08:28:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jxfkD5oAo2KkSQAAMHmgww (envelope-from ); Fri, 10 Jun 2022 08:28:10 +0000 Date: Fri, 10 Jun 2022 10:28:08 +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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 19:57:45, Sean Christopherson wrote: > On Wed, Jun 08, 2022, Vasant Karasulli wrote: > > 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]. > > An intermediate cast to "unsigned long" should make that go away. Yes, intermediate cast satisfied the compiler. Thanks for the tip. -- 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