public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Kevin Corry <corryk@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] EVMS core 3/4: evms_ioctl.h
Date: 03 Oct 2002 17:22:03 +0200	[thread overview]
Message-ID: <p73vg4jr1ic.fsf@oldwotan.suse.de> (raw)
In-Reply-To: Kevin Corry's message of "3 Oct 2002 15:22:49 +0200"

Kevin Corry <corryk@us.ibm.com> writes:


> +struct evms_plugin_ioctl_pkt {
> +	ulong feature_id;
> +	s32 feature_command;
> +	s32 status;
> +	void *feature_ioctl_data;
> +};

This is passed between user space and kernel space right? 

For 32bit emulation on 64bit purposes you should always use explicitely
sized types (u32/u64 not ulong). The pointer will still need to be 
converted. Best is to avoid pointers if possible (e.g. couldn't the data
just be tacked on here?) 


> +#define EVMS_EVENT_END_OF_DISCOVERY     0
> +
> +/**
> + * struct evms_notify_pkt - evms event notification ioctl packet definition
> + * @command:	0 = unregister, 1 = register
> + * @eventry:	event structure
> + * @status:	returned operation status
> + *
> + * ioctl packet definition for EVMS_PROCESS_NOTIFY_EVENT ioctl
> + **/
> +struct evms_notify_pkt {
> +	s32 command;
> +	struct evms_event eventry;

If eventry contains any potential 64bit stuff it would be best to align it 
to 64bit explicitely
> + **/
> +struct evms_user_disk_info_pkt {
> +	u32 status;
> +	u32 flags;
> +	u64 disk_handle;
> +	u32 disk_dev;
> +	u32 geo_sectors;
> +	u32 geo_heads;
> +	u64 geo_cylinders;

emulation trap: on x86-64/ia64 u64 have different alignment on 32bit vs
64bit (4 bytes vs natural). Please make sure that u64 is always explicitely
64bit aligned. It isn't here.


> +	u64 disk_handle;
> +	s32 io_flag;
> +	u64 starting_sector;

Same issue


It would be best to clean the ABI up now when you can still change it.
Otherwise the emulation functions later will be very ugly
(take a look at the LVM horror in arch/x86_64/ia32/ia32_ioctl.c for a 
bad example - LVM1 wasn't cleaned up in time)

-Andi

       reply	other threads:[~2002-10-03 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <02100307370503.05904@boiler.suse.lists.linux.kernel>
2002-10-03 15:22 ` Andi Kleen [this message]
2002-10-03 22:30   ` [PATCH] EVMS core 3/4: evms_ioctl.h Kevin Corry
2002-10-03 23:49     ` Andi Kleen
2002-10-03 12:37 Kevin Corry
2002-10-03 15:00 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p73vg4jr1ic.fsf@oldwotan.suse.de \
    --to=ak@suse.de \
    --cc=corryk@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox