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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93AABC433DF for ; Wed, 1 Jul 2020 15:36:30 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 609092071A for ; Wed, 1 Jul 2020 15:36:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xen.org header.i=@xen.org header.b="N/q88qtG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 609092071A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jqemP-0005uw-Fs; Wed, 01 Jul 2020 15:36:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jqemO-0005ur-IF for xen-devel@lists.xenproject.org; Wed, 01 Jul 2020 15:36:08 +0000 X-Inumbo-ID: 93c49bc2-bbb0-11ea-bb8b-bc764e2007e4 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 93c49bc2-bbb0-11ea-bb8b-bc764e2007e4; Wed, 01 Jul 2020 15:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fdKPh9+uJZZ56Z33Me4yP5f8EtRE35rWQhI3cWDExAw=; b=N/q88qtGYkqnw+K1FwugODuRFs 1nB6Fw5zxbgpyLILgcBHj3hHcKRzxqODAz9gHzs32KifBGdlmKHJugl/Xfgv23iWB9jwQVsQBYMZm FiYX99NU5/IRPnFsb8xOdCpo4JDi1GKoX0TfQjAz7CMkwRnXD4Zbk90OV5qbAl+ulndA=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jqemF-0005Ay-G9; Wed, 01 Jul 2020 15:35:59 +0000 Received: from [54.239.6.177] (helo=a483e7b01a66.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jqemF-0000JG-6Q; Wed, 01 Jul 2020 15:35:59 +0000 Subject: Re: [PATCH v4 05/10] common/domain: allocate vmtrace_pt_buffer To: =?UTF-8?Q?Micha=c5=82_Leszczy=c5=84ski?= , xen-devel@lists.xenproject.org References: <0e02c97054da6e367f740ab8d2574e2d255553c8.1593519420.git.michal.leszczynski@cert.pl> From: Julien Grall Message-ID: <3c710ce8-c561-fd73-3be8-a92456588db9@xen.org> Date: Wed, 1 Jul 2020 16:35:56 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <0e02c97054da6e367f740ab8d2574e2d255553c8.1593519420.git.michal.leszczynski@cert.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , tamas.lengyel@intel.com, Wei Liu , Andrew Cooper , Ian Jackson , George Dunlap , Jan Beulich , luwei.kang@intel.com, =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi, On 30/06/2020 13:33, Michał Leszczyński wrote: > +static int vmtrace_alloc_buffers(struct vcpu *v) > +{ > + struct page_info *pg; > + uint64_t size = v->domain->vmtrace_pt_size; > + > + if ( size < PAGE_SIZE || size > GB(4) || (size & (size - 1)) ) > + { > + /* > + * We don't accept trace buffer size smaller than single page > + * and the upper bound is defined as 4GB in the specification. This is common code, so what specification are you talking about? I am guessing this is an Intel one, but I don't think Intel should dictate the common code implementation. > + * The buffer size must be also a power of 2. > + */ > + return -EINVAL; > + } > + > + pg = alloc_domheap_pages(v->domain, get_order_from_bytes(size), > + MEMF_no_refcount); > + > + if ( !pg ) > + return -ENOMEM; > + > + v->arch.vmtrace.pt_buf = pg; v->arch.vmtrace.pt_buf is not defined on Arm. Please make sure common code build on all arch. Cheers, -- Julien Grall