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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 3E6D2C63777 for ; Thu, 3 Dec 2020 09:27:47 +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 C0803217A0 for ; Thu, 3 Dec 2020 09:27:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0803217A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.43223.77744 (Exim 4.92) (envelope-from ) id 1kkktb-00024q-PT; Thu, 03 Dec 2020 09:27:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 43223.77744; Thu, 03 Dec 2020 09:27:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kkktb-00024j-MR; Thu, 03 Dec 2020 09:27:27 +0000 Received: by outflank-mailman (input) for mailman id 43223; Thu, 03 Dec 2020 09:27:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kkkta-00024e-F7 for xen-devel@lists.xenproject.org; Thu, 03 Dec 2020 09:27:26 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f12fe71c-d742-45fa-ad22-64cfe5131b73; Thu, 03 Dec 2020 09:27:25 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2A5E0AC55; Thu, 3 Dec 2020 09:27:24 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f12fe71c-d742-45fa-ad22-64cfe5131b73 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1606987644; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pVf0pzAcE5NuQeytzIki02m6gx+39mPGMJjm8+J2YLY=; b=QFsmUBIAB8E/9ubYwrPtGDIF0XEBMDJS3oW2R8PPStTJu2Kf3owlE7Nw/B7oXnyYAiQHyR DlzKSrpFpW/hN3RvsXrtsvHv8SNwAhC/syYWif/WPeDULRZ5MyGJPmuiWzi4RlnGFGUmI8 x8u4zVzazJjB27170VmjdIN4hRGagto= Subject: Re: [PATCH 1/2] include: don't use asm/page.h from common headers To: Julien Grall Cc: Andrew Cooper , George Dunlap , Ian Jackson , Stefano Stabellini , Wei Liu , Hongyan Xia , "xen-devel@lists.xenproject.org" References: <75484377-160c-a529-1cfc-96de86cfc550@suse.com> <04276039-a5d0-fefd-260e-ffaa8272fd6a@suse.com> From: Jan Beulich Message-ID: Date: Thu, 3 Dec 2020 10:27:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 02.12.2020 18:14, Julien Grall wrote: > Hi Jan, > > On 02/12/2020 14:49, Jan Beulich wrote: >> Doing so limits what can be done in (in particular included by) this per- >> arch header. Abstract out page shift/size related #define-s, which is all >> the repsecitve headers care about. Extend the replacement / removal to > > s/repsecitve/respective/ > >> some x86 headers as well; some others now need to include page.h (and >> they really should have before). >> >> Arm's VADDR_BITS gets restricted to 32-bit, as its current value is >> clearly wrong for 64-bit, but the constant also isn't used anywhere >> right now (i.e. the #define could also be dropped altogether). > > Whoops. Thankfully this is not used. > >> >> I wasn't sure about Arm's use of vaddr_t in PAGE_OFFSET(), and hence I >> kept it and provided a way to override the #define in the common header. > > vaddr_t is defined to 32-bit for arm32 or 64-bit for arm64. So I think > it would be fine to use the generic PAGE_OFFSET() implementation. Will switch. >> --- /dev/null >> +++ b/xen/include/asm-arm/page-shift.h > > The name of the file looks a bit odd given that *_BITS are also defined > in it. So how about renaming to page-size.h? I was initially meaning to use that name, but these headers specifically don't define any sizes - *_BITS are still shift values, at least in a way. If the current name isn't liked, my next best suggestion would then be page-bits.h. >> @@ -0,0 +1,15 @@ >> +#ifndef __ARM_PAGE_SHIFT_H__ >> +#define __ARM_PAGE_SHIFT_H__ >> + >> +#define PAGE_SHIFT 12 >> + >> +#define PAGE_OFFSET(ptr) ((vaddr_t)(ptr) & ~PAGE_MASK) >> + >> +#ifdef CONFIG_ARM_64 >> +#define PADDR_BITS 48 > > Shouldn't we define VADDR_BITS here? See the description - it's unused anyway. I'm fine any of the three possible ways: 1) keep as is in v1 2) drop altogether 3) also #define for 64-bit (but then you need to tell me whether 64 is the right value to use, or what the correct one would be) > But I wonder whether VADDR_BITS > should be defined as sizeof(vaddr_t) * 8. > > This would require to include asm/types.h. Which I'd specifically like to avoid. Plus use of sizeof() also precludes the use of respective #define-s in #if-s. >> --- a/xen/include/asm-x86/desc.h >> +++ b/xen/include/asm-x86/desc.h >> @@ -1,6 +1,8 @@ >> #ifndef __ARCH_DESC_H >> #define __ARCH_DESC_H >> >> +#include > > May I ask why you are including and not here? Because of DECLARE_PER_CPU(l1_pgentry_t, gdt_l1e); and DECLARE_PER_CPU(l1_pgentry_t, compat_gdt_l1e); at least (didn't check further). Jan