All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, kvm-ppc <kvm-ppc@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] PPC: Sync guest visible MMU state
Date: Thu, 26 Nov 2009 13:46:52 +0100	[thread overview]
Message-ID: <4B0E78BC.5050901@suse.de> (raw)
In-Reply-To: <4B0E7738.5030506@redhat.com>

Avi Kivity wrote:
> On 11/26/2009 01:16 PM, Alexander Graf wrote:
>> Currently userspace has no chance to find out which virtual address
>> space we're
>> in and resolve addresses. While that is a big problem for migration,
>> it's also
>> unpleasent when debugging, as gdb and the monitor don't work on virtual
>> addresses.
>>
>> This patch exports enough of the MMU segment state to userspace to make
>> debugging work and thus also includes the groundwork for migration.
>>
>>
>>   struct kvm_sregs {
>> -    __u32 pvr;
>> -    char pad[1020];
>> +    union {
>> +        struct {
>> +            __u32 pvr;
>> +            __u64 sdr1;
>> +            struct {
>> +                struct {
>> +                    __u64 slbe;
>> +                    __u64 slbv;
>> +                } slb[64];
>> +            } ppc64;
>> +            struct {
>> +                __u32 sr[16];
>> +                __u64 ibat[8];
>> +                __u64 dbat[8];
>> +            } ppc32;
>> +        };
>> +        __u8 pad[1024];
>> +    };
>>   };
>>    
>
> Please avoid unnamed unions in user-visible headers - they're a gcc
> extension.
>
> Yes, we have them elsewhere, but let's not add to the pile.

I'm open to scalable suggestions that don't break existing userspace code.
If I name the union now, existing qemu code will break. If I align the
pad array manually I'll definitely mess up something.

Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Avi Kivity <avi@redhat.com>
Cc: kvm-ppc <kvm-ppc@vger.kernel.org>,
	kvm@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] PPC: Sync guest visible MMU state
Date: Thu, 26 Nov 2009 13:46:52 +0100	[thread overview]
Message-ID: <4B0E78BC.5050901@suse.de> (raw)
In-Reply-To: <4B0E7738.5030506@redhat.com>

Avi Kivity wrote:
> On 11/26/2009 01:16 PM, Alexander Graf wrote:
>> Currently userspace has no chance to find out which virtual address
>> space we're
>> in and resolve addresses. While that is a big problem for migration,
>> it's also
>> unpleasent when debugging, as gdb and the monitor don't work on virtual
>> addresses.
>>
>> This patch exports enough of the MMU segment state to userspace to make
>> debugging work and thus also includes the groundwork for migration.
>>
>>
>>   struct kvm_sregs {
>> -    __u32 pvr;
>> -    char pad[1020];
>> +    union {
>> +        struct {
>> +            __u32 pvr;
>> +            __u64 sdr1;
>> +            struct {
>> +                struct {
>> +                    __u64 slbe;
>> +                    __u64 slbv;
>> +                } slb[64];
>> +            } ppc64;
>> +            struct {
>> +                __u32 sr[16];
>> +                __u64 ibat[8];
>> +                __u64 dbat[8];
>> +            } ppc32;
>> +        };
>> +        __u8 pad[1024];
>> +    };
>>   };
>>    
>
> Please avoid unnamed unions in user-visible headers - they're a gcc
> extension.
>
> Yes, we have them elsewhere, but let's not add to the pile.

I'm open to scalable suggestions that don't break existing userspace code.
If I name the union now, existing qemu code will break. If I align the
pad array manually I'll definitely mess up something.

Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, kvm-ppc <kvm-ppc@vger.kernel.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] PPC: Sync guest visible MMU state
Date: Thu, 26 Nov 2009 12:46:52 +0000	[thread overview]
Message-ID: <4B0E78BC.5050901@suse.de> (raw)
In-Reply-To: <4B0E7738.5030506@redhat.com>

Avi Kivity wrote:
> On 11/26/2009 01:16 PM, Alexander Graf wrote:
>> Currently userspace has no chance to find out which virtual address
>> space we're
>> in and resolve addresses. While that is a big problem for migration,
>> it's also
>> unpleasent when debugging, as gdb and the monitor don't work on virtual
>> addresses.
>>
>> This patch exports enough of the MMU segment state to userspace to make
>> debugging work and thus also includes the groundwork for migration.
>>
>>
>>   struct kvm_sregs {
>> -    __u32 pvr;
>> -    char pad[1020];
>> +    union {
>> +        struct {
>> +            __u32 pvr;
>> +            __u64 sdr1;
>> +            struct {
>> +                struct {
>> +                    __u64 slbe;
>> +                    __u64 slbv;
>> +                } slb[64];
>> +            } ppc64;
>> +            struct {
>> +                __u32 sr[16];
>> +                __u64 ibat[8];
>> +                __u64 dbat[8];
>> +            } ppc32;
>> +        };
>> +        __u8 pad[1024];
>> +    };
>>   };
>>    
>
> Please avoid unnamed unions in user-visible headers - they're a gcc
> extension.
>
> Yes, we have them elsewhere, but let's not add to the pile.

I'm open to scalable suggestions that don't break existing userspace code.
If I name the union now, existing qemu code will break. If I align the
pad array manually I'll definitely mess up something.

Alex

  reply	other threads:[~2009-11-26 12:46 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26 11:16 [PATCH] PPC: Sync guest visible MMU state Alexander Graf
2009-11-26 11:16 ` Alexander Graf
2009-11-26 11:16 ` Alexander Graf
     [not found] ` <1259234174-1104-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
2009-11-26 12:40   ` Avi Kivity
2009-11-26 12:40     ` Avi Kivity
2009-11-26 12:40     ` Avi Kivity
2009-11-26 12:46     ` Alexander Graf [this message]
2009-11-26 12:46       ` Alexander Graf
2009-11-26 12:46       ` Alexander Graf
     [not found]       ` <4B0E78BC.5050901-l3A5Bk7waGM@public.gmane.org>
2009-11-26 12:50         ` Avi Kivity
2009-11-26 12:50           ` Avi Kivity
2009-11-26 12:50           ` Avi Kivity
     [not found]           ` <4B0E799C.80209-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-11-26 13:16             ` Alexander Graf
2009-11-26 13:16               ` Alexander Graf
2009-11-26 13:16               ` Alexander Graf
     [not found]               ` <4B0E7FC0.3000803-l3A5Bk7waGM@public.gmane.org>
2009-11-26 13:20                 ` Avi Kivity
2009-11-26 13:20                   ` Avi Kivity
2009-11-26 13:20                   ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2009-11-30 13:02 Alexander Graf
2009-11-30 13:02 ` Alexander Graf
2009-11-30 13:02 ` Alexander Graf
2009-11-30 13:15 ` Avi Kivity
2009-11-30 13:15   ` Avi Kivity
2009-11-30 13:15   ` Avi Kivity
2009-11-26 15:24 Alexander Graf
2009-11-26 15:24 ` Alexander Graf
2009-11-26 15:24 ` Alexander Graf
     [not found] ` <1259249056-3953-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
2009-11-26 21:56   ` Alexander Graf
2009-11-26 21:56     ` Alexander Graf
2009-11-26 21:56     ` Alexander Graf
2009-11-24  7:50 Alexander Graf
2009-11-24  7:50 ` Alexander Graf
2009-11-24  7:50 ` Alexander Graf
     [not found] ` <1259049003-8028-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org>
2009-11-24 15:02   ` Avi Kivity
2009-11-24 15:02     ` Avi Kivity
2009-11-24 15:02     ` Avi Kivity
2009-11-24 15:04     ` Alexander Graf
2009-11-24 15:04       ` Alexander Graf
2009-11-24 15:04       ` Alexander Graf
2009-11-24 16:05       ` Avi Kivity
2009-11-24 16:05         ` Avi Kivity
2009-11-24 16:05         ` Avi Kivity

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=4B0E78BC.5050901@suse.de \
    --to=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.