From patchwork Thu Nov 23 18:31:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 119538 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1173126edl; Thu, 23 Nov 2017 10:34:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMb67hXYouiiDEklvmAkxEAfE3eU86bi7peod6glCt5pz06MUWRaBN4F6BnRRkLetV+T8m3A X-Received: by 10.36.139.198 with SMTP id g189mr12851147ite.13.1511462062640; Thu, 23 Nov 2017 10:34:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511462062; cv=none; d=google.com; s=arc-20160816; b=IQ1ABwEhm+EyBrs6gU+SXlk22i8Fr6MUCOaAXZzKE1By5TLdwirg6gs8RSXEQNqsER FvBfwwU+AmtxyQXkIHPpBuzNJNoPWmOWUzbV6JHinycLBdh/7ycgWBPhrg2cxZZTy1Fq b2tD3hRYmnxAvYlR/B0yCmkthwD83cyYcRt+EMjOXoaCfFpNZLFR4fxnp48h8cgLE0VM guQ3D4EeGMWBaw6TTZUer4K8V4ZWK5v4QmXECMMyxmHueCEc//Z9fIh+O1GJriy2F5a7 6WwDaQ2fTsHzTkW7yJHuHCNuj2GLavG4bxFJWJy5c9GAn+yupV0wVVDQHzNTshE1YAWX 5yUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=knG8ZbBzRIlGjKwYUA7rK/qavOQ6YozwK4c7o8R3GJA=; b=jIPoM8X3NjIVDycRRDEEEhz0wa8S3FDaKmZkK1MZebM+8n01BreKD7OIoTf3E+1DHg F6Adt4aTBoI7nrSwFL0TthXvJ27hwmgdNhmk89wXygiSgImjG3UmVjXiAJV9wu4Cpvqi YMAvmovRnGKJcFlMZXX2i3i77RBtMCfB6Zz9m77+x1dx+e381capzjPS6Kil5UkUN7gn 4yn6bWq5fYfpxM0dHS8VypubgNaH1xgsyETx+PRs9BxIVAv8e8aERq619U6O4G9xX2AK P/87Sr1IdzOqJm7k+VqSg/b4NrC7LbUkk7BvuFWAKLjVXDy4fBc46MOcSdl52SktNv6V XyNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VcOE5Ol6; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i62si16051154ioe.220.2017.11.23.10.34.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 10:34:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VcOE5Ol6; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHwIR-0005Cf-8W; Thu, 23 Nov 2017 18:32:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHwIP-00059i-IM for xen-devel@lists.xen.org; Thu, 23 Nov 2017 18:32:21 +0000 Received: from [193.109.254.147] by server-8.bemta-6.messagelabs.com id 82/CD-27709-534171A5; Thu, 23 Nov 2017 18:32:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBIsWRWlGSWpSXmKPExsVyMbThsK6JiHi UwZLpahZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aLXueCH0IVvd2nGBsYZ/B1MXJxCAlMYpRY eHgxO4jDIjCPWeLovbNsII6EQD+rxPn3V1i7GDmBnDyJM53TgKo4gOw0ib/v9SDCFRIfdrWxg oSFBNQk1ryJghjaxySx/8RyFpA4m4COxLoZtSDlIgLSEtc+X2YEsZkF4iUeT73OBmILC0RJrP 3xjgmknEVAVeLHuhIQk1fARuL/CkuIRfISu9ougt3CKWArcfTAB2aIpTYSnz8rTmAUXMDIsIp Rozi1qCy1SNfITC+pKDM9oyQ3MTNH19DATC83tbg4MT01JzGpWC85P3cTIzDMGIBgB+OZBYGH GCU5mJREeWV+iUUJ8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuCVFBaPEhIsSk1PrUjLzAEGPExag oNHSYR3uxBQmre4IDG3ODMdInWK0Z7jwp1Lf5g4Duy5BSSfzXzdwMwx7WprE7MQS15+XqqUOO 9mkDYBkLaM0jy4obAIvcQoKyXMywh0phBPQWpRbmYJqvwrRnEORiVh3rcgU3gy80rgdr8COos J6Kyfx4VBzipJREhJNTB2X582U27yH6W6SbVN8z1De/X4u8UDz0pdsZIzb1nQ82X1pcorL92Y brvvPsb5v7zgh82HD8Gv9HMjJio+3hBk4eO6q1NK+5RumUj9hMkTz2XufmGsfH1rzYWI6z+V1 R3KP9+PUF7PUznzVf9s7v9L/eMlvQofXK26mf4p9GSuSEAOz4pFGxcosRRnJBpqMRcVJwIAcq tfQMsCAAA= X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-27.messagelabs.com!1511461940!117542624!1 X-Originating-IP: [209.85.128.195] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17397 invoked from network); 23 Nov 2017 18:32:20 -0000 Received: from mail-wr0-f195.google.com (HELO mail-wr0-f195.google.com) (209.85.128.195) by server-16.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 23 Nov 2017 18:32:20 -0000 Received: by mail-wr0-f195.google.com with SMTP id w95so18372085wrc.2 for ; Thu, 23 Nov 2017 10:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FhFa2k4whtsema3mWHC6VkNUk+YCIUASBkprXRHjFCA=; b=VcOE5Ol6BeP67KdMREeRrrk7lsW/mFnQF8IOmPeHYcvxNUYM7ThbwVqipaVsSpSvx9 CeBt9YKQoGCFcFJhDXud2gzMfB2x1WxROo+PY2V830XcpGr1SayGeAAWhT4p1TUjT+CJ I6Q97bRx2RJJCf+CrafMoH6AH91YAEha7BYZM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FhFa2k4whtsema3mWHC6VkNUk+YCIUASBkprXRHjFCA=; b=t3UH3lcnbuSAFijDU07JzPOrwnJXGly+c+JI0pl4w24NCFAh8uY/0ERsPdN4MTUyVw AxZ4wIoZqb4DhZ7ynZn5YI+dvGbhCBkaJmoWijFHQZQDRaw7uS98XByxd37MRvQpM0Lm WilVThG9k87Zq1SODTOGBxaVtXhOEKNR0X29laPxJuzh9gFpzMVQRwnti1UHkNoL7xNe +q8Eu517ud4r2qv3hEVe0P31dhAke+IJqcs5kIvGrOWToza9DjkpFOx/2EsXBX/aR5up PwgpL2f/hYidFDGkd82zq2V/ZkB+3rZD5PO1Pt8sAGebnrFkn0VApgKi7XAt7uZWNbQS /ouA== X-Gm-Message-State: AJaThX6O/ve30ghzzsItyhxFOaHGB/2M6Wdlcq+Gu8oqLJ1tCgxmayOP 3+JM117unWTQd1nLn/VPeLmyVOi9k8w= X-Received: by 10.223.182.7 with SMTP id f7mr12208437wre.71.1511461940074; Thu, 23 Nov 2017 10:32:20 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id n32sm41412950wrb.62.2017.11.23.10.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 10:32:19 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 23 Nov 2017 18:31:59 +0000 Message-Id: <20171123183210.12045-6-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171123183210.12045-1-julien.grall@linaro.org> References: <20171123183210.12045-1-julien.grall@linaro.org> Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH for-next 05/16] xen/arm: guest_copy: Extend the prototype to pass the vCPU X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Currently, guest_copy assumes the copy will only be done for the current vCPU. A follow-up patch will require to use a different vCPU. So extend the prototype to pass the vCPU. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/guestcopy.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index 3aaa80859e..487f5ab82d 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -10,7 +10,7 @@ #define COPY_to_guest (1U << 1) static unsigned long copy_guest(void *buf, paddr_t addr, unsigned int len, - unsigned int flags) + struct vcpu *v, unsigned int flags) { /* XXX needs to handle faults */ unsigned offset = addr & ~PAGE_MASK; @@ -21,7 +21,7 @@ static unsigned long copy_guest(void *buf, paddr_t addr, unsigned int len, unsigned size = min(len, (unsigned)PAGE_SIZE - offset); struct page_info *page; - page = get_page_from_gva(current, addr, + page = get_page_from_gva(v, addr, (flags & COPY_to_guest) ? GV2M_WRITE : GV2M_READ); if ( page == NULL ) return len; @@ -62,24 +62,25 @@ static unsigned long copy_guest(void *buf, paddr_t addr, unsigned int len, unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len) { - return copy_guest((void *)from, (unsigned long)to, len, COPY_to_guest); + return copy_guest((void *)from, (unsigned long)to, len, + current, COPY_to_guest); } unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from, unsigned len) { return copy_guest((void *)from, (unsigned long)to, len, - COPY_to_guest | COPY_flush_dcache); + current, COPY_to_guest | COPY_flush_dcache); } unsigned long raw_clear_guest(void *to, unsigned len) { - return copy_guest(NULL, (unsigned long)to, len, COPY_to_guest); + return copy_guest(NULL, (unsigned long)to, len, current, COPY_to_guest); } unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned len) { - return copy_guest(to, (unsigned long)from, len, COPY_from_guest); + return copy_guest(to, (unsigned long)from, len, current, COPY_from_guest); } /*