Message ID | 20230110175057.715453-7-pgonda@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2886332wrt; Tue, 10 Jan 2023 09:52:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXuDAqOFFm+bu+B9h2vLNNyhLZKoYUN0AfRLJ0/gI//u5i2C7Eib5AJRz8XAiHTMtdEnyB6j X-Received: by 2002:a05:6a00:150c:b0:581:38df:f9f8 with SMTP id q12-20020a056a00150c00b0058138dff9f8mr67778313pfu.4.1673373161750; Tue, 10 Jan 2023 09:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673373161; cv=none; d=google.com; s=arc-20160816; b=r5vX1n9FdrCIaaseklc/z9FlRNdnJqGilNvGmIBPIZ6qMs8sa9l8+bGjJSXFMis+aJ xAnjLJuSVxaQWf6Vbr8gzCBb7HiiMoZFvobOGAnC+I0t+cCLi+nD0VIeABuVlbEKn1cR ukaXbHQkjuVD5B7QEBcOkbbQV8ducYPGq9YKFKx/mdbUUZ7GMZVIk9VeAFuBEYGjIP+d R5NsLGLrv4WxPHSNYNLfNBhgj6DPrWw8v+Zw8U9mid3Bh6arvVtxXzP9bkHk6iDeLS90 M4UsdOnMXvl98gWE14fVGsGzyDSgj8kwBn0SFVp4ZwCqxWl43ceSrxnAArYFuxjKkI90 krkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=Wd8IRDcm/I+X4nIj9mIHk75KksnNCPDW6vKldjVyscc=; b=x7bl2cUikFTixn4yztxSVpKW7RAi8UY1W3fWbNTu2gsp8yGAPqFcL0j4V7mZdAgzxs ZTgUdAOyyohYCAH0diGURADaX0yL3FkbCELU8ExSmxxU16BybDRzey+xNL7twvPwVdPV RP1wAwoAqgR5PQUMSr83mAvq0kWxvPfUHVhMt0isWapOuGgWeK5SVWmVf5rpukDVXB49 c8+rsI521sPdxxd6JmU7E+jN98bF1xnhCk840KymbqYX4Le171bCYTsG2IAgMFm3z3R7 b6stFIiGvpZD43QBfKsIJMZF2tRARki95REollqxxEkVSbFh6oobmMyeY+1mfyp+iimj 4UxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=b6KSQFqc; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v21-20020a056a00149500b0056e48944843si12748580pfu.355.2023.01.10.09.52.29; Tue, 10 Jan 2023 09:52:41 -0800 (PST) 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=@google.com header.s=20210112 header.b=b6KSQFqc; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235217AbjAJRvk (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Tue, 10 Jan 2023 12:51:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234882AbjAJRvR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 10 Jan 2023 12:51:17 -0500 Received: from mail-pl1-x64a.google.com (mail-pl1-x64a.google.com [IPv6:2607:f8b0:4864:20::64a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFAD654D81 for <linux-kernel@vger.kernel.org>; Tue, 10 Jan 2023 09:51:15 -0800 (PST) Received: by mail-pl1-x64a.google.com with SMTP id z3-20020a170903018300b0018fb8ca1688so8819729plg.5 for <linux-kernel@vger.kernel.org>; Tue, 10 Jan 2023 09:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Wd8IRDcm/I+X4nIj9mIHk75KksnNCPDW6vKldjVyscc=; b=b6KSQFqc5bLezor0zmWctfaPJ+f7KyxQdr3D/WxZuD9X/46Ab/0ny+3J5uSKG+8BMd uOQtNt3qd0SKGSJDc48X0DejhNnMOMN1KqX1H6Y2pq4012FFY+jsK2wdmkihUd8VYDJi lcm7hjV5n3lyYiVTAfWEbyj6PuU3nPZAPMuLFBK1dNwVn8VthonXMN8aFsG2D7/FUimc nqJ2g6PZpyu46JOs2r3mstW5uLQxFnf0GAqB1S1db+9ovE4akeJlXlcXxOEh+z4XxCNp YjtPFDZ7tPeI1jg+M4oKf7aIqOJxeUYsspIuXjhlF97sGbW0rAl1a7vOZq86idj7GWYl GBcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wd8IRDcm/I+X4nIj9mIHk75KksnNCPDW6vKldjVyscc=; b=w8TbfMpq9TWSi5uKDs9iQ8EbvT9XMAP+JXduAFM3eei7/XA91ehDojbNQfjPdRJCKX rNO+VAtFPiCJepuvxk4CW8fPwfPUmSwF0bf4AqJh0X2iibZcpO959zFAHUSgPrx/GnHn LA5mgKxNksXr9R158oYTD/hhENiWdpGUUhilamdO10acE44o/dX2bQ+flOiRnoI/u26L 4k5OxDrp+DSuE8Ay2rTSAKyqEYCT3qfe1G9/lA0+v+KEXKAEuiKaIdNhhf3CdPhzA5ba S+zP8fO2cOcwnweRW/Xb1GTz2deFPTeNWu2h9uy7pBFhwaPHjolZwnffyoWCi2QTJAKM xjXA== X-Gm-Message-State: AFqh2krUa3pra0aT9mNMcBVQ14fd87mk7LbdPptgnjfMGLfENTC/3q6q cGfwhYiYfrbC6ZpYzvGVlqhiqSNgFSE= X-Received: from pgonda1.kir.corp.google.com ([2620:0:1008:11:8358:4c2a:eae1:4752]) (user=pgonda job=sendgmr) by 2002:a63:1a0a:0:b0:478:ba6c:3879 with SMTP id a10-20020a631a0a000000b00478ba6c3879mr5162985pga.440.1673373075316; Tue, 10 Jan 2023 09:51:15 -0800 (PST) Date: Tue, 10 Jan 2023 09:50:56 -0800 In-Reply-To: <20230110175057.715453-1-pgonda@google.com> Message-Id: <20230110175057.715453-7-pgonda@google.com> Mime-Version: 1.0 References: <20230110175057.715453-1-pgonda@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH V6 6/7] KVM: selftests: Update ucall pool to allocate from shared memory From: Peter Gonda <pgonda@google.com> To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Peter Gonda <pgonda@google.com>, Paolo Bonzini <pbonzini@redhat.com>, Sean Christopherson <seanjc@google.com>, Vishal Annapurve <vannapurve@google.com>, Ackerly Tng <ackerleytng@google.com>, Andrew Jones <andrew.jones@linux.dev> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754658936517932088?= X-GMAIL-MSGID: =?utf-8?q?1754658936517932088?= |
Series |
KVM: selftests: Add simple SEV test
|
|
Commit Message
Peter Gonda
Jan. 10, 2023, 5:50 p.m. UTC
Update the per VM ucall_header allocation from vm_vaddr_alloc() to
vm_vaddr_alloc_shared(). This allows encrypted guests to use ucall pools
by placing their shared ucall structures in unencrypted (shared) memory.
No behavior change for non encrypted guests.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Vishal Annapurve <vannapurve@google.com>
Cc: Ackerly Tng <ackerleytng@google.com>
cc: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Peter Gonda <pgonda@google.com>
---
tools/testing/selftests/kvm/lib/ucall_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/lib/ucall_common.c b/tools/testing/selftests/kvm/lib/ucall_common.c index 2f0e2ea941cc..99ef4866a001 100644 --- a/tools/testing/selftests/kvm/lib/ucall_common.c +++ b/tools/testing/selftests/kvm/lib/ucall_common.c @@ -24,7 +24,7 @@ void ucall_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa) vm_vaddr_t vaddr; int i; - vaddr = __vm_vaddr_alloc(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR, MEM_REGION_DATA); + vaddr = vm_vaddr_alloc_shared(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR); hdr = (struct ucall_header *)addr_gva2hva(vm, vaddr); memset(hdr, 0, sizeof(*hdr));