xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: andrew.cooper3@citrix.com, xen-devel@lists.xen.org,
	wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
	roger.pau@citrix.com
Subject: Re: [PATCH v4 06/15] domctl: Add XEN_DOMCTL_acpi_access
Date: Mon, 12 Dec 2016 11:19:10 -0500	[thread overview]
Message-ID: <f127253c-8d5f-371c-b80b-383163c8b8ea@oracle.com> (raw)
In-Reply-To: <584EBC0B02000078001280CA@prv-mh.provo.novell.com>

On 12/12/2016 09:02 AM, Jan Beulich wrote:
>>>> On 12.12.16 at 14:08, <boris.ostrovsky@oracle.com> wrote:
>> On 12/02/2016 02:48 AM, Jan Beulich wrote:
>>>>>> On 01.12.16 at 17:43, <boris.ostrovsky@oracle.com> wrote:
>>>> On 12/01/2016 11:06 AM, Jan Beulich wrote:
>>>>>> +++ b/xen/include/public/domctl.h
>>>>>> @@ -1144,6 +1144,29 @@ struct xen_domctl_psr_cat_op {
>>>>>>  typedef struct xen_domctl_psr_cat_op xen_domctl_psr_cat_op_t;
>>>>>>  DEFINE_XEN_GUEST_HANDLE(xen_domctl_psr_cat_op_t);
>>>>>>
>>>>>> +/* ACPI Generic Address Structure */
>>>>>> +typedef struct gas {
>>>>> xen_acpi_gas
>>>>>
>>>>>> +#define XEN_ACPI_SYSTEM_MEMORY 0
>>>>>> +#define XEN_ACPI_SYSTEM_IO     1
>>>>>> +    uint8_t    space_id;           /* Address space */
>>>>>> +    uint8_t    bit_width;          /* Size in bits of given register */
>>>>>> +    uint8_t    bit_offset;         /* Bit offset within the register */
>>>>>> +    uint8_t    access_width;       /* Minimum Access size (ACPI 3.0) */
>>>>>> +    uint64_t   address;            /* 64-bit address of register */
>>>>> uint64_aligned_t with explicit padding added ahead of it.
>>>>>
>>>>> And then there's the question of what uses of this will look like:
>>>>> I'm not convinced we need to stick to the exact ACPI layout
>>>>> here, unless you expect (or could imagine) for the tool stack to
>>>>> hold GAS structures coming from elsewhere in its hands. If we
>>>>> don't follow the layout as strictly, we could namely widen
>>>>> bit_width (and maybe bit_offset) to allow for larger transfers
>>>>> in one go. And in such a relaxed model I don't think we'd need
>>>>> access_width at all as a field.
>>>> There is indeed no current need to use actual ACPI GAS layout but then
>>>> it's not GAS, really, and should be named something else.
>>> Which of course is fine by me; I had referred to that structure only
>>> for the underlying principle of specifying how to access the data.
>> Are there any registers that are not byte-aligned or not whole number of 
>> bytes?
>>
>> I am thinking about dropping bit_offset (along with access_width) and 
>> making bit_width (byte_)width. And keeping the latter as uint8_t will 
>> also implicitly limit register size to 256 bytes which I think is a 
>> reasonable size limit.
> Since we're doing the emulation (and hence defining the registers)
> we could require no such unusual registers. This would be something
> we can't simplify only if we foresee ever needing to hand through a
> hardware register without interposing any emulation.
>
> Whether limiting to 256 bytes is reasonable I'm not so sure, otoh.

When would we ever need to access anything larger? I'd think that the
common case is a few (1-4) bytes. The one instance when this is not true
is the VCPU map and 256 bytes allow for 16K VCPUs, which I suspect we
won't reach in a while.

But I can increase the length to uint16_t if you feel it's would be better.

-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-12-12 16:19 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 15:33 [PATCH v4 00/15] PVH VCPU hotplug support Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 01/15] x86/pmtimer: Move ACPI registers from PMTState to hvm_domain Boris Ostrovsky
2016-12-01 15:52   ` Jan Beulich
2016-12-01 16:28     ` Boris Ostrovsky
2016-12-01 16:29       ` Andrew Cooper
2016-12-01 16:45         ` Boris Ostrovsky
2016-12-12 16:24   ` Wei Liu
2016-11-29 15:33 ` [PATCH v4 02/15] acpi: Make pmtimer optional in FADT Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 03/15] acpi: Power and Sleep ACPI buttons are not emulated for PVH guests Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 04/15] acpi: PVH guests need _E02 method Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 05/15] acpi/x86: Define ACPI IO registers for PVH guests Boris Ostrovsky
2016-12-01 15:57   ` Jan Beulich
2016-12-01 16:30     ` Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 06/15] domctl: Add XEN_DOMCTL_acpi_access Boris Ostrovsky
2016-12-01 16:06   ` Jan Beulich
2016-12-01 16:43     ` Boris Ostrovsky
2016-12-02  7:48       ` Jan Beulich
2016-12-12 13:08         ` Boris Ostrovsky
2016-12-12 14:02           ` Jan Beulich
2016-12-12 16:19             ` Boris Ostrovsky [this message]
2016-12-12 16:24               ` Jan Beulich
2016-12-12 13:28   ` Julien Grall
2016-12-12 16:11     ` Boris Ostrovsky
2016-12-13 13:02       ` Julien Grall
2016-11-29 15:33 ` [PATCH v4 07/15] pvh/acpi: Install handlers for ACPI-related PVH IO accesses Boris Ostrovsky
2016-12-01 16:32   ` Jan Beulich
2016-12-01 17:03     ` Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 08/15] pvh/acpi: Handle ACPI accesses for PVH guests Boris Ostrovsky
2016-12-06 14:34   ` Jan Beulich
2016-12-06 16:37     ` Boris Ostrovsky
2016-12-07  8:06       ` Jan Beulich
2016-11-29 15:33 ` [PATCH v4 09/15] x86/domctl: Handle ACPI access from domctl Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 10/15] events/x86: Define SCI virtual interrupt Boris Ostrovsky
2016-12-06 14:36   ` Jan Beulich
2016-11-29 15:33 ` [PATCH v4 11/15] pvh: Send an SCI on VCPU hotplug event Boris Ostrovsky
2016-12-06 14:50   ` Jan Beulich
2016-12-06 16:43     ` Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 12/15] tools: Call XEN_DOMCTL_acpi_access on PVH VCPU hotplug Boris Ostrovsky
2016-12-12 16:35   ` Wei Liu
2016-12-12 16:47     ` Boris Ostrovsky
2016-12-12 16:50       ` Boris Ostrovsky
2016-12-12 17:09         ` Wei Liu
2016-12-12 17:14           ` Boris Ostrovsky
2016-12-12 17:13             ` Wei Liu
2016-11-29 15:33 ` [PATCH v4 13/15] pvh: Set online VCPU map to avail_vcpus Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 14/15] pvh/acpi: Save ACPI registers for PVH guests Boris Ostrovsky
2016-11-29 15:33 ` [PATCH v4 15/15] docs: Describe PVHv2's VCPU hotplug procedure Boris Ostrovsky
2016-12-06 20:55   ` Konrad Rzeszutek Wilk
2016-11-29 16:11 ` [PATCH v4 00/15] PVH VCPU hotplug support Jan Beulich
2016-11-29 16:40   ` Boris Ostrovsky
2016-11-29 16:43     ` Jan Beulich
2016-11-29 17:00       ` Boris Ostrovsky

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=f127253c-8d5f-371c-b80b-383163c8b8ea@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).