From patchwork Fri Jul 17 16:02:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 6817001 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A89AC05AC for ; Fri, 17 Jul 2015 16:02:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4964207C4 for ; Fri, 17 Jul 2015 16:02:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0462207B9 for ; Fri, 17 Jul 2015 16:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752318AbbGQQCc (ORCPT ); Fri, 17 Jul 2015 12:02:32 -0400 Received: from foss.arm.com ([217.140.101.70]:49687 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752295AbbGQQCa (ORCPT ); Fri, 17 Jul 2015 12:02:30 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A85CF619; Fri, 17 Jul 2015 09:02:48 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.203.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 444AE3F21A; Fri, 17 Jul 2015 09:02:29 -0700 (PDT) From: Andre Przywara To: will.deacon@arm.com, kvm@vger.kernel.org Cc: Szabolcs.Nagy@arm.com, marc.zyngier@arm.com, kvmarm@lists.cs.columbia.edu Subject: [PATCH 11/12] avoid using predefined PAGE_SIZE Date: Fri, 17 Jul 2015 17:02:17 +0100 Message-Id: <1437148938-5394-12-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1437148938-5394-1-git-send-email-andre.przywara@arm.com> References: <1437148938-5394-1-git-send-email-andre.przywara@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The musl-libc comes with a predefined PAGE_SIZE macro, which may be wrong on systems which support multiple smallest page sizes. Make sure we use our own (runtime evaluated) definition of PAGE_SIZE. Signed-off-by: Andre Przywara --- include/kvm/kvm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/kvm/kvm.h b/include/kvm/kvm.h index 9818046..8b12cd6 100644 --- a/include/kvm/kvm.h +++ b/include/kvm/kvm.h @@ -19,6 +19,10 @@ #define HOME_DIR getenv("HOME") #define KVM_BINARY_NAME "lkvm" +/* Let's determine the actual page size at runtime. */ +#ifdef PAGE_SIZE +#undef PAGE_SIZE +#endif #define PAGE_SIZE (sysconf(_SC_PAGE_SIZE)) #define DEFINE_KVM_EXT(ext) \